diff --git a/contrib/dolphin/Makefile b/contrib/dolphin/Makefile index 1cc10a436db330d021ebf7a27fbc122e3b2d1f3f..33c56baf53da91714595f45fa388c61be4b18332 100644 --- a/contrib/dolphin/Makefile +++ b/contrib/dolphin/Makefile @@ -77,10 +77,10 @@ OBJS += tablecmds.o tablecmds.o: tablecmds.cpp EXTENSION = dolphin -REGRESS:=$(shell find ./sql -maxdepth 2 -type f) -REGRESS:=$(basename $(patsubst ./sql/%,%,$(REGRESS)) .sql) +#a dummy testcase to let 'make check' can run, currently I have no idea how to fix this... +REGRESS:=dummy -REGRESS_OPTS = --dlpath=$(top_builddir)/src/test/regress -c 0 -d 1 --single_node -p ${p} +REGRESS_OPTS = --dlpath=$(top_builddir)/src/test/regress -c 0 -d 1 --single_node -p ${p} --schedule=./parallel_schedule_dolphin --regconf=regress.conf -r 1 -n --keep_last_data=false --temp-config=./make_check_postgresql.conf include $(top_builddir)/$(base_dir)/configure.mk ifdef USE_PGXS @@ -92,4 +92,4 @@ subdir = contrib/dolphin top_builddir = ../.. include $(top_builddir)/src/Makefile.global include $(top_srcdir)/contrib/contrib-global.mk -endif +endif \ No newline at end of file diff --git a/contrib/dolphin/expected/builtin_funcs/bin.out b/contrib/dolphin/expected/builtin_funcs/bin.out index bbeefc7250e457783b636109a46a1c4a2b09476f..1e022f193cacb4e6326cb056b6e3a952545615b0 100644 --- a/contrib/dolphin/expected/builtin_funcs/bin.out +++ b/contrib/dolphin/expected/builtin_funcs/bin.out @@ -1,7 +1,7 @@ -drop database if exists format_test; -NOTICE: database "format_test" does not exist, skipping -create database format_test dbcompatibility 'B'; -\c format_test +drop database if exists db_bin; +NOTICE: database "db_bin" does not exist, skipping +create database db_bin dbcompatibility 'B'; +\c db_bin select bin(1); bin ----- @@ -51,4 +51,4 @@ select bin(false); (1 row) \c postgres -drop database if exists format_test; +drop database if exists db_bin; diff --git a/contrib/dolphin/expected/builtin_funcs/char.out b/contrib/dolphin/expected/builtin_funcs/char.out index 9c9aae730a5c36a00cf858d33f744e056983a901..fcbe10b15a9b76f292c3da591b0ec6021b4cc49c 100644 --- a/contrib/dolphin/expected/builtin_funcs/char.out +++ b/contrib/dolphin/expected/builtin_funcs/char.out @@ -1,7 +1,7 @@ -drop database if exists format_test; -NOTICE: database "format_test" does not exist, skipping -create database format_test dbcompatibility 'B'; -\c format_test +drop database if exists db_char; +NOTICE: database "db_char" does not exist, skipping +create database db_char dbcompatibility 'B'; +\c db_char select chara(67,66,67); chara ------- @@ -98,4 +98,4 @@ select chara(65); (1 row) \c postgres -drop database if exists format_test; +drop database if exists db_char; diff --git a/contrib/dolphin/expected/builtin_funcs/char_length.out b/contrib/dolphin/expected/builtin_funcs/char_length.out index 660250acffce3db62cd20eefbeca4cc157157c25..81c50a5e53366bbe7ba14ee3c757db9fbfca5296 100644 --- a/contrib/dolphin/expected/builtin_funcs/char_length.out +++ b/contrib/dolphin/expected/builtin_funcs/char_length.out @@ -1,7 +1,7 @@ -drop database if exists format_test; -NOTICE: database "format_test" does not exist, skipping -create database format_test dbcompatibility 'B'; -\c format_test +drop database if exists db_char_length; +NOTICE: database "db_char_length" does not exist, skipping +create database db_char_length dbcompatibility 'B'; +\c db_char_length select char_length(1234); char_length ------------- @@ -69,4 +69,4 @@ select char_length(1111111111111111111111111111111111111111111111111111111111111 (1 row) \c postgres -drop database if exists format_test; +drop database if exists db_char_length; diff --git a/contrib/dolphin/expected/builtin_funcs/character_length.out b/contrib/dolphin/expected/builtin_funcs/character_length.out index 5fe6d38e5b85b7182b6cfb3a7482bf70a0595cac..01ff1cf1820265644ff3dfacd392eff5214846d7 100644 --- a/contrib/dolphin/expected/builtin_funcs/character_length.out +++ b/contrib/dolphin/expected/builtin_funcs/character_length.out @@ -1,7 +1,7 @@ -drop database if exists format_test; -NOTICE: database "format_test" does not exist, skipping -create database format_test dbcompatibility 'B'; -\c format_test +drop database if exists db_character_length; +NOTICE: database "db_character_length" does not exist, skipping +create database db_character_length dbcompatibility 'B'; +\c db_character_length select character_length(1234); character_length ------------------ @@ -69,4 +69,4 @@ select character_length(11111111111111111111111111111111111111111111111111111111 (1 row) \c postgres -drop database if exists format_test; +drop database if exists db_character_length; diff --git a/contrib/dolphin/expected/builtin_funcs/conv.out b/contrib/dolphin/expected/builtin_funcs/conv.out index be6527b2ea9c1289382a60bcfce5747f982b73ac..50e1a6902c3df29e91b7b1ce55956dd1d4680246 100644 --- a/contrib/dolphin/expected/builtin_funcs/conv.out +++ b/contrib/dolphin/expected/builtin_funcs/conv.out @@ -1,7 +1,7 @@ -drop database if exists format_test; -NOTICE: database "format_test" does not exist, skipping -create database format_test dbcompatibility 'B'; -\c format_test +drop database if exists db_conv; +NOTICE: database "db_conv" does not exist, skipping +create database db_conv dbcompatibility 'B'; +\c db_conv select conv('a',16,2); conv ------ @@ -505,4 +505,4 @@ select conv(-9544646155975628532428411,-10,-10); (1 row) \c postgres -drop database if exists format_test; +drop database if exists db_conv; diff --git a/contrib/dolphin/expected/builtin_funcs/convert.out b/contrib/dolphin/expected/builtin_funcs/convert.out index fc149225717d05737b150cd043b0193046ed73ae..78235132554d7350462ffdb2fdc7604313a1ef4c 100644 --- a/contrib/dolphin/expected/builtin_funcs/convert.out +++ b/contrib/dolphin/expected/builtin_funcs/convert.out @@ -1,7 +1,7 @@ -drop database if exists format_test; -NOTICE: database "format_test" does not exist, skipping -create database format_test dbcompatibility 'B'; -\c format_test +drop database if exists db_convert; +NOTICE: database "db_convert" does not exist, skipping +create database db_convert dbcompatibility 'B'; +\c db_convert select convert(1 using 'utf8'); convert --------- @@ -55,4 +55,4 @@ select convert(1 using 'utf8'); (1 row) \c postgres -drop database if exists format_test; +drop database if exists db_convert; diff --git a/contrib/dolphin/expected/builtin_funcs/crc32.out b/contrib/dolphin/expected/builtin_funcs/crc32.out index bdb07c226111477a350d7b22c46d53416000c6c4..b4467321145ef7a62ef3ac00e56eca9ec8788c8e 100644 --- a/contrib/dolphin/expected/builtin_funcs/crc32.out +++ b/contrib/dolphin/expected/builtin_funcs/crc32.out @@ -1,7 +1,7 @@ -drop database if exists format_test; -NOTICE: database "format_test" does not exist, skipping -create database format_test dbcompatibility 'B'; -\c format_test +drop database if exists db_crc32; +NOTICE: database "db_crc32" does not exist, skipping +create database db_crc32 dbcompatibility 'B'; +\c db_crc32 select crc32('abc'); crc32 ----------- @@ -27,4 +27,4 @@ select crc32(10),crc32(-3.1415926),crc32(1.339E5),crc32('ab57'),crc32('HAF47'); (1 row) \c postgres -drop database if exists format_test; +drop database if exists db_crc32; diff --git a/contrib/dolphin/expected/builtin_funcs/db_b_format.out b/contrib/dolphin/expected/builtin_funcs/db_b_format.out index 8322a6b56fc22cc987b7f10156dc52fa488029e4..f8d9429913ae798023083bae402fc8d6252be522 100644 --- a/contrib/dolphin/expected/builtin_funcs/db_b_format.out +++ b/contrib/dolphin/expected/builtin_funcs/db_b_format.out @@ -1,7 +1,7 @@ -drop database if exists format_test; -NOTICE: database "format_test" does not exist, skipping -create database format_test dbcompatibility 'B'; -\c format_test +drop database if exists db_db_b_format; +NOTICE: database "db_db_b_format" does not exist, skipping +create database db_db_b_format dbcompatibility 'B'; +\c db_db_b_format -- test for b_format_mode = false select format(1234.456, 2); format @@ -531,10 +531,10 @@ select format('%s, %s, %s, %s, %s, %s',1 ,1 ,1 ,1, 1, 1); (1 row) \c postgres -drop database format_test; +drop database db_db_b_format; -- test for A compatibility to ensure the original functionality is good. -create database db_a_format_test dbcompatibility 'A'; -\c db_a_format_test +create database db_db_b_format dbcompatibility 'A'; +\c db_db_b_format select format(1234.456, 2); format ---------- @@ -548,4 +548,4 @@ select format(1234.456, 2, 'en_US'); (1 row) \c postgres -drop database db_a_format_test; +drop database db_db_b_format; diff --git a/contrib/dolphin/expected/builtin_funcs/db_b_hex.out b/contrib/dolphin/expected/builtin_funcs/db_b_hex.out index 108d0567eecd6a505045510d41cc3e508a762ae1..03a9383e685d96a66a27beeb52d8ca9c1354eadf 100644 --- a/contrib/dolphin/expected/builtin_funcs/db_b_hex.out +++ b/contrib/dolphin/expected/builtin_funcs/db_b_hex.out @@ -1,7 +1,7 @@ -drop database if exists format_test; -NOTICE: database "format_test" does not exist, skipping -create database format_test dbcompatibility 'B'; -\c format_test +drop database if exists db_b_hex; +NOTICE: database "db_b_hex" does not exist, skipping +create database db_b_hex dbcompatibility 'B'; +\c db_b_hex select hex(int1(255)); hex ----- @@ -205,4 +205,4 @@ select hex(c1) from bytea_to_hex_test; (1 row) \c postgres -drop database if exists format_test; +drop database if exists db_b_hex; diff --git a/contrib/dolphin/expected/builtin_funcs/db_b_if.out b/contrib/dolphin/expected/builtin_funcs/db_b_if.out index 0d5f0fa1ab6efd00a22a2eff2c1189655d10bea6..94e00fdcefb3b3315116a0b471992de54b35d2cd 100644 --- a/contrib/dolphin/expected/builtin_funcs/db_b_if.out +++ b/contrib/dolphin/expected/builtin_funcs/db_b_if.out @@ -1,7 +1,7 @@ -drop database if exists format_test; -NOTICE: database "format_test" does not exist, skipping -create database format_test dbcompatibility 'B'; -\c format_test +drop database if exists db_b_if; +NOTICE: database "db_b_if" does not exist, skipping +create database db_b_if dbcompatibility 'B'; +\c db_b_if select if(TRUE, 1, 2); case ------ @@ -194,4 +194,4 @@ LINE 1: select if (true, 2.2::numeric(10, 2), true) as a, if (false,... ^ CONTEXT: referenced column: a \c postgres -drop database if exists format_test; +drop database if exists db_b_if; diff --git a/contrib/dolphin/expected/builtin_funcs/elt.out b/contrib/dolphin/expected/builtin_funcs/elt.out index 42493ea4f89b70b526bd417e19872fb89b8fdc8e..76601717161a9495c8a41a449cb444e0a52b371b 100644 --- a/contrib/dolphin/expected/builtin_funcs/elt.out +++ b/contrib/dolphin/expected/builtin_funcs/elt.out @@ -1,7 +1,7 @@ -drop database if exists format_test; -NOTICE: database "format_test" does not exist, skipping -create database format_test dbcompatibility 'B'; -\c format_test +drop database if exists db_elt; +NOTICE: database "db_elt" does not exist, skipping +create database db_elt dbcompatibility 'B'; +\c db_elt select elt(1,1); elt ----- @@ -81,4 +81,4 @@ select elt(2,'a',2); (1 row) \c postgres -drop database if exists format_test; +drop database if exists db_elt; diff --git a/contrib/dolphin/expected/builtin_funcs/field.out b/contrib/dolphin/expected/builtin_funcs/field.out index 7a200d28d7b9e8f6e90b4e21a78b06ac580b4114..73924749bf3737250b8f959220110853af93ca10 100644 --- a/contrib/dolphin/expected/builtin_funcs/field.out +++ b/contrib/dolphin/expected/builtin_funcs/field.out @@ -1,7 +1,7 @@ -drop database if exists format_test; -NOTICE: database "format_test" does not exist, skipping -create database format_test dbcompatibility 'B'; -\c format_test +drop database if exists db_field; +NOTICE: database "db_field" does not exist, skipping +create database db_field dbcompatibility 'B'; +\c db_field select field(4,1,2,3,4); field ------- @@ -81,4 +81,4 @@ select field(1,2,1.2); (1 row) \c postgres -drop database if exists format_test; +drop database if exists db_field; diff --git a/contrib/dolphin/expected/builtin_funcs/find_in_set.out b/contrib/dolphin/expected/builtin_funcs/find_in_set.out index 17aefcb0d30274baf44b5058e82e1d60d207fc48..5dd3d42e1eb1898a12e216c0e4648b1882cc11f7 100644 --- a/contrib/dolphin/expected/builtin_funcs/find_in_set.out +++ b/contrib/dolphin/expected/builtin_funcs/find_in_set.out @@ -1,7 +1,7 @@ -drop database if exists format_test; -NOTICE: database "format_test" does not exist, skipping -create database format_test dbcompatibility 'B'; -\c format_test +drop database if exists db_find_in_set; +NOTICE: database "db_find_in_set" does not exist, skipping +create database db_find_in_set dbcompatibility 'B'; +\c db_find_in_set select find_in_set(1,'a,1,c'); find_in_set ------------- @@ -75,4 +75,4 @@ select find_in_set(1.1,'a,1.2,c,qwee,1212,1.1'); (1 row) \c postgres -drop database if exists format_test; +drop database if exists db_find_in_set; diff --git a/contrib/dolphin/expected/builtin_funcs/soundex.out b/contrib/dolphin/expected/builtin_funcs/soundex.out index 03e5d08d46200a32ada088f272e59267dfb227c7..76884c950bafdabf7dae7a8462c7f26fc7747994 100644 --- a/contrib/dolphin/expected/builtin_funcs/soundex.out +++ b/contrib/dolphin/expected/builtin_funcs/soundex.out @@ -1,7 +1,7 @@ -drop database if exists format_test; -NOTICE: database "format_test" does not exist, skipping -create database format_test dbcompatibility 'B'; -\c format_test +drop database if exists db_soundex; +NOTICE: database "db_soundex" does not exist, skipping +create database db_soundex dbcompatibility 'B'; +\c db_soundex select soundex('abc'); soundex --------- @@ -39,4 +39,4 @@ select soundex('hell'); (1 row) \c postgres -drop database if exists format_test; +drop database if exists db_soundex; diff --git a/contrib/dolphin/expected/builtin_funcs/space.out b/contrib/dolphin/expected/builtin_funcs/space.out index 446a82aabb4795cca9341c2aaedb167888c15f1d..a5fed3c32be2e6af9c2e54213d4641ffeacda198 100644 --- a/contrib/dolphin/expected/builtin_funcs/space.out +++ b/contrib/dolphin/expected/builtin_funcs/space.out @@ -1,7 +1,7 @@ -drop database if exists format_test; -NOTICE: database "format_test" does not exist, skipping -create database format_test dbcompatibility 'B'; -\c format_test +drop database if exists db_space; +NOTICE: database "db_space" does not exist, skipping +create database db_space dbcompatibility 'B'; +\c db_space select space('a'); space ------- @@ -33,4 +33,4 @@ select space('-1'); (1 row) \c postgres -drop database if exists format_test; +drop database if exists db_space; diff --git a/contrib/dolphin/expected/db_b_new_gram_test.out b/contrib/dolphin/expected/db_b_new_gram_test.out index e34f1b97b3c1c55307be874d685af6ce3a0f8eef..8430d0309e3fa7fd34b63d456f08a293d93f8173 100644 --- a/contrib/dolphin/expected/db_b_new_gram_test.out +++ b/contrib/dolphin/expected/db_b_new_gram_test.out @@ -1,7 +1,7 @@ -drop database if exists test; -NOTICE: database "test" does not exist, skipping -create database test dbcompatibility 'B'; -\c test +drop database if exists db_b_new_gram_test; +NOTICE: database "db_b_new_gram_test" does not exist, skipping +create database db_b_new_gram_test dbcompatibility 'B'; +\c db_b_new_gram_test -- CREATE TABLE engine test CREATE TABLE test_engine_1 (a int) engine = InnoDB; CREATE TABLE IF NOT EXISTS test_engine_2 (a int) engine = InnoDB; @@ -292,4 +292,4 @@ SELECT count(*) FROM PG_PREPARED_STATEMENTS WHERE name LIKE '%instr_test%'; DROP TEMPORARY TABLE test_engine_1 CASCADE; \c postgres -drop database test; +drop database db_b_new_gram_test; diff --git a/contrib/dolphin/expected/db_b_parser1.out b/contrib/dolphin/expected/db_b_parser1.out index 073e6ebfa2bbf3705bed34bbeb31eb420ddc95d8..d657801f7cc9f729956636436c77bb99cc5a260b 100644 --- a/contrib/dolphin/expected/db_b_parser1.out +++ b/contrib/dolphin/expected/db_b_parser1.out @@ -1,7 +1,7 @@ -drop database if exists mysql_test; -NOTICE: database "mysql_test" does not exist, skipping -create database mysql_test dbcompatibility 'b'; -\c mysql_test +drop database if exists db_b_parser1; +NOTICE: database "db_b_parser1" does not exist, skipping +create database db_b_parser1 dbcompatibility 'b'; +\c db_b_parser1 select 'bbbbb' regexp '^([bc])\1*$' as t, 'bbbbb' not regexp '^([bc])\1*$' as t2, 'bbbbb' rlike '^([bc])\1*$' as t; t | t2 | t ---+----+--- @@ -357,4 +357,4 @@ select '-12.3abc' rlike 'null'; (1 row) \c postgres -drop database if exists mysql_test; +drop database if exists db_b_parser1; diff --git a/contrib/dolphin/expected/db_b_parser2.out b/contrib/dolphin/expected/db_b_parser2.out index 70eb232bac05ed4a6ded0e8fd1ce040bc9ef22b8..46ceaf1245e31b637bab03bb2651ed1983be6b2e 100644 --- a/contrib/dolphin/expected/db_b_parser2.out +++ b/contrib/dolphin/expected/db_b_parser2.out @@ -1,7 +1,7 @@ -drop database if exists mysql_test; -NOTICE: database "mysql_test" does not exist, skipping -create database mysql_test dbcompatibility 'b'; -\c mysql_test +drop database if exists db_b_parser2; +NOTICE: database "db_b_parser2" does not exist, skipping +create database db_b_parser2 dbcompatibility 'b'; +\c db_b_parser2 --验证DAYOFMONTH() DAYOFWEEK() DAYOFYEAR() HOUR() MICROSECOND() MINUTE() QUARTER() SECOND() WEEKDAY() WEEKOFYEAR() YEAR() select DAYOFMONTH(datetime '2021-11-4 16:30:44.341191'); date_part @@ -316,4 +316,4 @@ select length(''),length(' '),length(NULL); (1 row) \c postgres -drop database if exists mysql_test; +drop database if exists db_b_parser2; diff --git a/contrib/dolphin/expected/db_b_parser3.out b/contrib/dolphin/expected/db_b_parser3.out index b685fe983e0ad3f7baacc7e2f6f467a7ff8ee3bf..e60e01d3070a6abc0d0fd4423062d824b767ea9e 100644 --- a/contrib/dolphin/expected/db_b_parser3.out +++ b/contrib/dolphin/expected/db_b_parser3.out @@ -1,7 +1,7 @@ -drop database if exists mysql_test; -NOTICE: database "mysql_test" does not exist, skipping -create database mysql_test dbcompatibility 'b'; -\c mysql_test +drop database if exists db_b_parser3; +NOTICE: database "db_b_parser3" does not exist, skipping +create database db_b_parser3 dbcompatibility 'b'; +\c db_b_parser3 --测试点一:验证lcase函数 select lcase('ABc'), lcase('哈哈'), lcase('123456'),lcase('哈市&%%¥#'),lcase(null); lcase | lcase | lcase | lcase | lcase @@ -391,4 +391,4 @@ LINE 1: select '-12.3abc' xor 'null'; ^ CONTEXT: referenced column: xor \c postgres -drop database if exists mysql_test; +drop database if exists db_b_parser3; diff --git a/contrib/dolphin/expected/db_b_parser4.out b/contrib/dolphin/expected/db_b_parser4.out index f0a56f3e573acefc92ff4b466ee8670740fc1499..d87ed1df809c0e97a917e612ce7acee13ae230b1 100644 --- a/contrib/dolphin/expected/db_b_parser4.out +++ b/contrib/dolphin/expected/db_b_parser4.out @@ -1,7 +1,7 @@ -drop database if exists mysql_test; -NOTICE: database "mysql_test" does not exist, skipping -create database mysql_test dbcompatibility 'b'; -\c mysql_test +drop database if exists db_b_parser4; +NOTICE: database "db_b_parser4" does not exist, skipping +create database db_b_parser4 dbcompatibility 'b'; +\c db_b_parser4 --验证text类型 drop table if exists tb_db_b_parser_0001; NOTICE: table "tb_db_b_parser_0001" does not exist, skipping @@ -54,4 +54,4 @@ drop table if exists tb_default_float; drop table if exists tb_default_double; drop table if exists tb_real_float; \c postgres -drop database if exists mysql_test; +drop database if exists db_b_parser4; diff --git a/contrib/dolphin/expected/db_b_plpgsql_test.out b/contrib/dolphin/expected/db_b_plpgsql_test.out index fd3d810443563985e6776869de93fbacc2830e8c..a8b28cfa094a9dc2f2a8c0b6e17fa8307a3e09b1 100644 --- a/contrib/dolphin/expected/db_b_plpgsql_test.out +++ b/contrib/dolphin/expected/db_b_plpgsql_test.out @@ -1,7 +1,7 @@ -drop database if exists test; -NOTICE: database "test" does not exist, skipping -create database test dbcompatibility 'b'; -\c test +drop database if exists db_b_plpgsql_test; +NOTICE: database "db_b_plpgsql_test" does not exist, skipping +create database db_b_plpgsql_test dbcompatibility 'b'; +\c db_b_plpgsql_test create table tb_b_grammar_0038(a text(10)) engine = 表1; create or replace procedure proc_01() as @@ -48,4 +48,4 @@ SELECT * from tb_b_grammar_0038; (1 row) \c postgres -drop database if exists test; +drop database if exists db_b_plpgsql_test; diff --git a/contrib/dolphin/expected/default_guc.out b/contrib/dolphin/expected/default_guc.out index 020d31f3568528c8d458fcd6bef68dc0d0d05fbb..b178a6eb3b100ebc33a2cdb06497b1b3ea9c8250 100644 --- a/contrib/dolphin/expected/default_guc.out +++ b/contrib/dolphin/expected/default_guc.out @@ -1,7 +1,7 @@ -drop database if exists test; -NOTICE: database "test" does not exist, skipping -create database test dbcompatibility 'b'; -\c test +drop database if exists default_guc; +NOTICE: database "default_guc" does not exist, skipping +create database default_guc dbcompatibility 'b'; +\c default_guc show behavior_compat_options; behavior_compat_options ------------------------- @@ -52,4 +52,4 @@ select md5('0.123'); (1 row) \c postgres -drop database if exists test; +drop database if exists default_guc; diff --git a/contrib/dolphin/expected/describe.out b/contrib/dolphin/expected/describe.out index 184ae4e0e56d981e3d645f6f4e7ade2437a15d79..4db8377d52ed35425c7ec141841b219fed83ca3f 100644 --- a/contrib/dolphin/expected/describe.out +++ b/contrib/dolphin/expected/describe.out @@ -1,7 +1,7 @@ -drop database if exists dolphin; -NOTICE: database "dolphin" does not exist, skipping -create database dolphin dbcompatibility 'b'; -\c dolphin +drop database if exists db_describe; +NOTICE: database "db_describe" does not exist, skipping +create database db_describe dbcompatibility 'b'; +\c db_describe CREATE TABLE test2 ( id int PRIMARY KEY @@ -140,4 +140,4 @@ desc sc.test4; (0 rows) \c postgres -drop database if exists dolphin; +drop database if exists db_describe; diff --git a/contrib/dolphin/expected/dummy.out b/contrib/dolphin/expected/dummy.out new file mode 100644 index 0000000000000000000000000000000000000000..20d219a584ea6abce4343673120b2093a50a7e86 --- /dev/null +++ b/contrib/dolphin/expected/dummy.out @@ -0,0 +1,6 @@ +select 1; + ?column? +---------- + 1 +(1 row) + diff --git a/contrib/dolphin/expected/empty_value_list.out b/contrib/dolphin/expected/empty_value_list.out index b9cfd045b755246b4f2e9f458d55b5e51408dd19..d3ecddca1a3b9039a5100bba5ac634156cc49672 100644 --- a/contrib/dolphin/expected/empty_value_list.out +++ b/contrib/dolphin/expected/empty_value_list.out @@ -1,8 +1,8 @@ -- b compatibility case -drop database if exists b; -NOTICE: database "b" does not exist, skipping -create database b dbcompatibility 'b'; -\c b +drop database if exists empty_value_list; +NOTICE: database "empty_value_list" does not exist, skipping +create database empty_value_list dbcompatibility 'b'; +\c empty_value_list create table test1(num int); create table test2(num int default 3); create table test3(num int not null); @@ -538,4 +538,4 @@ select * from pg_type_nonstrict_basic_value where typename = 'tinterval'; (1 row) \c postgres -drop database if exists b; +drop database if exists empty_value_list; diff --git a/contrib/dolphin/expected/empty_value_lists.out b/contrib/dolphin/expected/empty_value_lists.out index f83f4b07e9d61c63ce552f9457a6a35bb69bddae..98e2646a45ee2f9afb7d6b1a466a56d82f16acd2 100644 --- a/contrib/dolphin/expected/empty_value_lists.out +++ b/contrib/dolphin/expected/empty_value_lists.out @@ -1,8 +1,8 @@ -- b compatibility case -drop database if exists b; -NOTICE: database "b" does not exist, skipping -create database b dbcompatibility 'b'; -\c b +drop database if exists empty_value_lists; +NOTICE: database "empty_value_lists" does not exist, skipping +create database empty_value_lists dbcompatibility 'b'; +\c empty_value_lists create table test1(num int); create table test2(num int default 3); create table test3(num int not null); @@ -536,4 +536,4 @@ select * from m4; (2 rows) \c postgres -drop database if exists b; +drop database if exists empty_value_lists; diff --git a/contrib/dolphin/expected/empty_value_support_value.out b/contrib/dolphin/expected/empty_value_support_value.out index cdd80b8a39a042277dd1880a51b851df0d62f7af..e6433dea99d728be0593adc71297ec29e6f006a6 100644 --- a/contrib/dolphin/expected/empty_value_support_value.out +++ b/contrib/dolphin/expected/empty_value_support_value.out @@ -1,7 +1,7 @@ -drop database if exists b; -NOTICE: database "b" does not exist, skipping -create database b dbcompatibility 'b'; -\c b +drop database if exists empty_value_support_value; +NOTICE: database "empty_value_support_value" does not exist, skipping +create database empty_value_support_value dbcompatibility 'b'; +\c empty_value_support_value create table test1(num int not null); insert into test1 value(); ERROR: null value in column "num" violates not-null constraint @@ -27,4 +27,4 @@ select * from test1; (3 rows) \c postgres -drop database if exists b; +drop database if exists empty_value_support_value; diff --git a/contrib/dolphin/expected/float_numeric_test/db_b_log_test.out b/contrib/dolphin/expected/float_numeric_test/db_b_log_test.out index 73aa73d92ed571cd911785396d9b55d88166564e..dcccede5fc1d0e8627fda7b67dfe26069dc2d876 100644 --- a/contrib/dolphin/expected/float_numeric_test/db_b_log_test.out +++ b/contrib/dolphin/expected/float_numeric_test/db_b_log_test.out @@ -4,10 +4,10 @@ SELECT LOG(10); 1 (1 row) -drop database if exists test; -NOTICE: database "test" does not exist, skipping -create database test dbcompatibility 'B'; -\c test +drop database if exists db_b_log_test; +NOTICE: database "db_b_log_test" does not exist, skipping +create database db_b_log_test dbcompatibility 'B'; +\c db_b_log_test SELECT LOG(10); log ------------------ @@ -147,4 +147,4 @@ SELECT LOG(2, 0) IS NULL; (1 row) \c postgres -drop database test; +drop database db_b_log_test; diff --git a/contrib/dolphin/expected/float_numeric_test/db_b_sqrt_test.out b/contrib/dolphin/expected/float_numeric_test/db_b_sqrt_test.out index 3bcf951b2a39a74a6a2ff564ad33141a3dc67b97..e027c38f391022ba49491d3adc7335eab089f5f7 100644 --- a/contrib/dolphin/expected/float_numeric_test/db_b_sqrt_test.out +++ b/contrib/dolphin/expected/float_numeric_test/db_b_sqrt_test.out @@ -7,10 +7,10 @@ SELECT SQRT(64); SELECT SQRT(-64); ERROR: cannot take square root of a negative number CONTEXT: referenced column: sqrt -drop database if exists test; -NOTICE: database "test" does not exist, skipping -create database test dbcompatibility 'B'; -\c test +drop database if exists db_b_sqrt_test; +NOTICE: database "db_b_sqrt_test" does not exist, skipping +create database db_b_sqrt_test dbcompatibility 'B'; +\c db_b_sqrt_test SELECT SQRT(64); sqrt ------ @@ -36,4 +36,4 @@ SELECT SQRT(-64::numeric); (1 row) \c postgres -drop database test; +drop database db_b_sqrt_test; diff --git a/contrib/dolphin/expected/greatest_least.out b/contrib/dolphin/expected/greatest_least.out index c638d7ebdc009881b910faeb6cbda048f15658ef..799466e15495bcbf4ff1a22ad820df2e6ba82580 100644 --- a/contrib/dolphin/expected/greatest_least.out +++ b/contrib/dolphin/expected/greatest_least.out @@ -1,7 +1,7 @@ -drop database if exists b; -NOTICE: database "b" does not exist, skipping -create database b dbcompatibility 'b'; -\c b +drop database if exists greatest_least; +NOTICE: database "greatest_least" does not exist, skipping +create database greatest_least dbcompatibility 'b'; +\c greatest_least --return null if input include null select GREATEST(null,1,2), GREATEST(null,1,2) is null; greatest | ?column? @@ -29,4 +29,4 @@ select LEAST(1,2); (1 row) \c postgres -drop database if exists b; +drop database if exists greatest_least; diff --git a/contrib/dolphin/expected/join_without_on.out b/contrib/dolphin/expected/join_without_on.out index 5f330b88c5abd13c41038ed8069fdc1659c3b7d8..0e69cd9c610404264f11bcc100a23583e1714dcc 100644 --- a/contrib/dolphin/expected/join_without_on.out +++ b/contrib/dolphin/expected/join_without_on.out @@ -1,7 +1,7 @@ -drop database if exists mysql_test; -NOTICE: database "mysql_test" does not exist, skipping -create database mysql_test dbcompatibility 'b'; -\c mysql_test +drop database if exists join_without_on; +NOTICE: database "join_without_on" does not exist, skipping +create database join_without_on dbcompatibility 'b'; +\c join_without_on CREATE TABLE J1_TBL ( i integer, j integer, @@ -137,4 +137,4 @@ SELECT * FROM J1_TBL JOIN J2_TBL INNER JOIN J3_TBL INNER JOIN J4_TBL ON J1_TBL (4 rows) \c postgres -drop database if exists mysql_test; +drop database if exists join_without_on; diff --git a/contrib/dolphin/expected/nvarchar.out b/contrib/dolphin/expected/nvarchar.out index d35f02bd077ec7ef2b3758d632c232e6e6cbfe53..ee026d565e48d34c0e54abdba09db64af8700be1 100644 --- a/contrib/dolphin/expected/nvarchar.out +++ b/contrib/dolphin/expected/nvarchar.out @@ -1,8 +1,8 @@ -- b compatibility case -drop database if exists b; -NOTICE: database "b" does not exist, skipping -create database b dbcompatibility 'b'; -\c b +drop database if exists db_nvarchar; +NOTICE: database "db_nvarchar" does not exist, skipping +create database db_nvarchar dbcompatibility 'b'; +\c db_nvarchar -- -- VARCHAR -- @@ -117,4 +117,4 @@ SELECT '' AS four, * FROM NVARCHAR_TBL; (4 rows) \c postgres -drop database if exists b; +drop database if exists db_nvarchar; diff --git a/contrib/dolphin/expected/regexp.out b/contrib/dolphin/expected/regexp.out index 3502b79641e8a2de23dc25a125a6e02c93079617..6824f001c93863e6c393c39edc4310a73929ef64 100644 --- a/contrib/dolphin/expected/regexp.out +++ b/contrib/dolphin/expected/regexp.out @@ -1,7 +1,7 @@ -drop database if exists mysql; -NOTICE: database "mysql" does not exist, skipping -create database mysql dbcompatibility 'b'; -\c mysql +drop database if exists db_regexp; +NOTICE: database "db_regexp" does not exist, skipping +create database db_regexp dbcompatibility 'b'; +\c db_regexp select regexp('a', true); regexp -------- @@ -9,4 +9,4 @@ select regexp('a', true); (1 row) \c postgres -drop database if exists mysql; +drop database if exists db_regexp; diff --git a/contrib/dolphin/expected/show.out b/contrib/dolphin/expected/show.out index 7ba629459e464911a41f158c4fad431bcf07de6e..e108f45dd9802097110e2e1f7bd37fe9c9c2e038 100644 --- a/contrib/dolphin/expected/show.out +++ b/contrib/dolphin/expected/show.out @@ -1,7 +1,7 @@ -drop database if exists mysql; -NOTICE: database "mysql" does not exist, skipping -create database mysql dbcompatibility 'b'; -\c mysql +drop database if exists db_show; +NOTICE: database "db_show" does not exist, skipping +create database db_show dbcompatibility 'b'; +\c db_show show processlist; --? Id | Pid | QueryId | UniqueSqlId | User | Host | db | .* | BackendStart | XactStart | .* | State | .* --?.* @@ -11,10 +11,7 @@ show processlist; --?.* --?.* --?.* ---?.* ---?.* ---?.* -(9 rows) +(6 rows) show full processlist; --? Id | Pid | QueryId | UniqueSqlId | User | Host | db | .* | BackendStart | XactStart | .* | State | .* @@ -25,10 +22,7 @@ show full processlist; --?.* --?.* --?.* ---?.* ---?.* ---?.* -(9 rows) +(6 rows) \c postgres -drop database if exists mysql; +drop database if exists db_show; diff --git a/contrib/dolphin/expected/string_func_test/db_b_ascii_test.out b/contrib/dolphin/expected/string_func_test/db_b_ascii_test.out index cb96ef3717a8d1699c29e9fad02883abe074c6ac..8902df3d7186026bdf88a21ddc41da0622c28327 100644 --- a/contrib/dolphin/expected/string_func_test/db_b_ascii_test.out +++ b/contrib/dolphin/expected/string_func_test/db_b_ascii_test.out @@ -10,10 +10,10 @@ SELECT ASCII('你'); 20320 (1 row) -drop database if exists test; -NOTICE: database "test" does not exist, skipping -create database test dbcompatibility 'B'; -\c test +drop database if exists db_b_ascii_test; +NOTICE: database "db_b_ascii_test" does not exist, skipping +create database db_b_ascii_test dbcompatibility 'B'; +\c db_b_ascii_test SELECT ASCII('a'); ascii ------- @@ -27,4 +27,4 @@ SELECT ASCII('你'); (1 row) \c postgres -drop database test; +drop database db_b_ascii_test; diff --git a/contrib/dolphin/expected/string_func_test/db_b_left_right_test.out b/contrib/dolphin/expected/string_func_test/db_b_left_right_test.out index bc4c9a427f724239346b0f8ff868aa492c922044..f14bba904a4abbfa990c94ee42a477ee1d602d48 100644 --- a/contrib/dolphin/expected/string_func_test/db_b_left_right_test.out +++ b/contrib/dolphin/expected/string_func_test/db_b_left_right_test.out @@ -22,10 +22,10 @@ SELECT right('abcdefg', -3); defg (1 row) -drop database if exists test; -NOTICE: database "test" does not exist, skipping -create database test dbcompatibility 'B'; -\c test +drop database if exists db_b_left_right_test; +NOTICE: database "db_b_left_right_test" does not exist, skipping +create database db_b_left_right_test dbcompatibility 'B'; +\c db_b_left_right_test set bytea_output to escape; SELECT left('abcdefg', 3); left @@ -304,4 +304,4 @@ select right('abc',5/2); (1 row) \c postgres -drop database test; +drop database db_b_left_right_test; diff --git a/contrib/dolphin/expected/string_func_test/db_b_quote_test.out b/contrib/dolphin/expected/string_func_test/db_b_quote_test.out index d101f12f00994fda987f7447d433f310e2929378..8f5674c5f6ab5a6751d941d5a894f382d6d6d49a 100644 --- a/contrib/dolphin/expected/string_func_test/db_b_quote_test.out +++ b/contrib/dolphin/expected/string_func_test/db_b_quote_test.out @@ -1,7 +1,7 @@ -drop database if exists test; -NOTICE: database "test" does not exist, skipping -create database test dbcompatibility 'B'; -\c test +drop database if exists db_b_quote_test; +NOTICE: database "db_b_quote_test" does not exist, skipping +create database db_b_quote_test dbcompatibility 'B'; +\c db_b_quote_test SELECT QUOTE(E'Don\'t!'); quote ----------- @@ -21,4 +21,4 @@ SELECT QUOTE('O\hello'); (1 row) \c postgres -drop database test; +drop database db_b_quote_test; diff --git a/contrib/dolphin/expected/string_func_test/db_b_string_length_test.out b/contrib/dolphin/expected/string_func_test/db_b_string_length_test.out index 71f589da24cb5e920e8a9e7876d50ba7853c564f..f385e34e0b8b0adf6b449aca094c135e07fe63c4 100644 --- a/contrib/dolphin/expected/string_func_test/db_b_string_length_test.out +++ b/contrib/dolphin/expected/string_func_test/db_b_string_length_test.out @@ -22,10 +22,10 @@ SELECT length('你好呀jose'); 7 (1 row) -drop database if exists test; -NOTICE: database "test" does not exist, skipping -create database test dbcompatibility 'B'; -\c test +drop database if exists db_b_string_length_test; +NOTICE: database "db_b_string_length_test" does not exist, skipping +create database db_b_string_length_test dbcompatibility 'B'; +\c db_b_string_length_test SELECT length('jose'); length -------- @@ -51,4 +51,4 @@ SELECT length('你好呀jose'); (1 row) \c postgres -drop database test; +drop database db_b_string_length_test; diff --git a/contrib/dolphin/expected/string_func_test/db_b_substr_test.out b/contrib/dolphin/expected/string_func_test/db_b_substr_test.out index 5a6cc64bb58430ff6cbe7161e72c57783ed6dc9b..3a3c96dabc32815ac37d179cca7c3029b32d232b 100644 --- a/contrib/dolphin/expected/string_func_test/db_b_substr_test.out +++ b/contrib/dolphin/expected/string_func_test/db_b_substr_test.out @@ -55,10 +55,10 @@ FROM template_string; (1 row) DROP TABLE IF EXISTS template_string; -drop database if exists test; -NOTICE: database "test" does not exist, skipping -create database test dbcompatibility 'B'; -\c test +drop database if exists db_b_substr_test; +NOTICE: database "db_b_substr_test" does not exist, skipping +create database db_b_substr_test dbcompatibility 'B'; +\c db_b_substr_test set bytea_output to escape; DROP TABLE IF EXISTS template_string; NOTICE: table "template_string" does not exist, skipping @@ -568,4 +568,4 @@ select c1, c2, substr(c1 for c2) from test_row order by c1; (3 rows) \c postgres -drop database test; +drop database db_b_substr_test; diff --git a/contrib/dolphin/expected/string_func_test/db_b_trim_test.out b/contrib/dolphin/expected/string_func_test/db_b_trim_test.out index bc504e64d6f9263818166b0bb52c9dc8c463983c..88354f30a20b20c053a01670faa3e609d92aae51 100644 --- a/contrib/dolphin/expected/string_func_test/db_b_trim_test.out +++ b/contrib/dolphin/expected/string_func_test/db_b_trim_test.out @@ -40,10 +40,10 @@ SELECT TRIM(TRAILING 'xyz' FROM 'xyzxbarxxyz'); xyzxbar (1 row) -drop database if exists test; -NOTICE: database "test" does not exist, skipping -create database test dbcompatibility 'B'; -\c test +drop database if exists db_b_trim_test; +NOTICE: database "db_b_trim_test" does not exist, skipping +create database db_b_trim_test dbcompatibility 'B'; +\c db_b_trim_test SELECT TRIM(' bar '); trim ------ @@ -142,4 +142,4 @@ SELECT TRIM(TRAILING ' X '::bytea); (1 row) \c postgres -drop database test; +drop database db_b_trim_test; diff --git a/contrib/dolphin/expected/test_binary.out b/contrib/dolphin/expected/test_binary.out index 31413efe1589df35d7496abd14a068bd59729359..4896028c6a88eab53b854562d3d030e5f32c7dc9 100644 --- a/contrib/dolphin/expected/test_binary.out +++ b/contrib/dolphin/expected/test_binary.out @@ -1,7 +1,7 @@ -drop database if exists test; -NOTICE: database "test" does not exist, skipping -create database test dbcompatibility 'B'; -\c test +drop database if exists test_binary; +NOTICE: database "test_binary" does not exist, skipping +create database test_binary dbcompatibility 'B'; +\c test_binary create table binary_templates (a bytea, b binary(5), c varbinary(5)); -- invalid typmod create table invalid_table (b binary(-1)); @@ -122,4 +122,4 @@ select * from t_varbinary_061; drop table if exists t_binary_061; drop table if exists t_varbinary_061; \c postgres -drop database test; +drop database test_binary; diff --git a/contrib/dolphin/expected/test_blob.out b/contrib/dolphin/expected/test_blob.out index 12112fe89d4300249d14693d8c574d0105f65048..1f6ecca392b59579729bc2da3701ffd06e815f92 100644 --- a/contrib/dolphin/expected/test_blob.out +++ b/contrib/dolphin/expected/test_blob.out @@ -1,7 +1,7 @@ -drop database if exists test; -NOTICE: database "test" does not exist, skipping -create database test dbcompatibility 'B'; -\c test +drop database if exists test_blob; +NOTICE: database "test_blob" does not exist, skipping +create database test_blob dbcompatibility 'B'; +\c test_blob create table test_template (t tinyblob, b blob, m mediumblob, l longblob); insert into test_template values('aaaaaaaaa', 'aaaaaaaaa', 'aaaaaaaaa', 'aaaaaaaaa'); create table test_tiny (t tinyblob); @@ -34,4 +34,4 @@ drop table test_blob; drop table test_medium; drop table test_long; \c postgres -drop database test; +drop database test_blob; diff --git a/contrib/dolphin/expected/test_fixed.out b/contrib/dolphin/expected/test_fixed.out index f57c54f49d00dea5358cb301b332b8ed2f9e2523..22f456ee2babccc9e5e8d1be8feaa788a95c42b0 100644 --- a/contrib/dolphin/expected/test_fixed.out +++ b/contrib/dolphin/expected/test_fixed.out @@ -1,7 +1,7 @@ -drop database if exists test; -NOTICE: database "test" does not exist, skipping -create database test dbcompatibility 'B'; -\c test +drop database if exists test_fixed; +NOTICE: database "test_fixed" does not exist, skipping +create database test_fixed dbcompatibility 'B'; +\c test_fixed DROP TABLE IF EXISTS fixed_test; NOTICE: table "fixed_test" does not exist, skipping CREATE TABLE fixed_test (a fixed(10, 5)); @@ -13,4 +13,4 @@ CREATE TABLE fixed_test (a fixed(10, 5)); DROP TABLE fixed_test; \c postgres -drop database test; +drop database test_fixed; diff --git a/contrib/dolphin/expected/test_mysql_enum.out b/contrib/dolphin/expected/test_mysql_enum.out index f5f6943099af01eb647e3d49eba114ab1dca4d46..1fb13cd2de8d756352bd45565f8eac4c8ea70b45 100644 --- a/contrib/dolphin/expected/test_mysql_enum.out +++ b/contrib/dolphin/expected/test_mysql_enum.out @@ -1,7 +1,7 @@ -drop database if exists test_db; -NOTICE: database "test_db" does not exist, skipping -CREATE DATABASE test_db with dbcompatibility='B'; -\c test_db +drop database if exists test_enum; +NOTICE: database "test_enum" does not exist, skipping +CREATE DATABASE test_enum with dbcompatibility='B'; +\c test_enum -- create extension dolphin; show sql_compatibility; sql_compatibility @@ -199,4 +199,4 @@ DELETE FROM test WHERE myname=0; DELETE FROM test WHERE myname=4; DROP TABLE test; \c postgres -DROP DATABASE test_db; +DROP DATABASE test_enum; diff --git a/contrib/dolphin/make_check_postgresql.conf b/contrib/dolphin/make_check_postgresql.conf new file mode 100644 index 0000000000000000000000000000000000000000..121c3f190a7177000014b99e19af137e636cac70 --- /dev/null +++ b/contrib/dolphin/make_check_postgresql.conf @@ -0,0 +1,39 @@ +shared_buffers = 256MB +work_mem = 16MB +fsync = off +synchronous_commit = off +archive_mode = off +audit_user_violation = 1 +audit_system_object = 511 +audit_dml_state = 1 +audit_function_exec = 1 +audit_copy_exec = 1 +full_page_writes = off +wal_keep_segments = 50 +checkpoint_segments = 16 +checkpoint_timeout = 30min +enable_bbox_dump = off +bbox_dump_count = 4 +bbox_dump_path = '/tmp/invalidpath' +comm_tcp_mode = on +#comm_cn_dn_logic_conn = false +enable_absolute_tablespace = true +#enable_dynamic_workload = false +max_connections = 1000 +query_mem='256MB' +auth_iteration_count=2048 +enable_sonic_hashagg=on +enable_sonic_hashjoin=on +enable_cbm_tracking = on +enable_opfusion=on +uncontrolled_memory_context='HashCacheContext,TupleHashTable,TupleSort,AggContext,SRF multi-call context,CteScan*,FunctionScan*,RemoteQuery*,VecAgg*,HashContext,TopTransactionContext' +#enable_tsdb = on +enable_thread_pool = on +enable_default_cfunc_libpath = off +enable_stateless_pooler_reuse = on +enable_ustore = on +wal_level = logical +sql_beta_feature = 'a_style_coerce' +enable_global_syscache = on +gs_clean_timeout=0 +use_workload_manager=off diff --git a/contrib/dolphin/parallel_schedule_dolphin b/contrib/dolphin/parallel_schedule_dolphin new file mode 100644 index 0000000000000000000000000000000000000000..2ebcda76960818335871ae516130d23fafb78312 --- /dev/null +++ b/contrib/dolphin/parallel_schedule_dolphin @@ -0,0 +1,26 @@ +test: float_numeric_test/db_b_log_test float_numeric_test/db_b_sqrt_test + +test: keyword_ignore_test/ignore_no_matched_partition keyword_ignore_test/ignore_not_null_constraints keyword_ignore_test/ignore_type_transform keyword_ignore_test/ignore_unique_constraints + +test: string_func_test/db_b_ascii_test string_func_test/db_b_left_right_test string_func_test/db_b_quote_test string_func_test/db_b_string_length_test string_func_test/db_b_substr_test string_func_test/db_b_trim_test + +test: ast b_compatibility_time_type db_b_new_gram_test + +test: db_b_parser1 db_b_parser2 db_b_parser3 db_b_parser4 + +test: db_b_plpgsql_test default_guc describe + +test: empty_value_list empty_value_lists empty_value_support_value + +test: greatest_least join_without_on mysqlmode_fullgroup mysqlmode_strict + +# must be single test group, cause other connection will affect the result +test: show + +test: nvarchar regexp + +test: test_binary test_blob test_datatype test_fixed test_mysql_enum + +test: builtin_funcs/bin builtin_funcs/char builtin_funcs/char_length builtin_funcs/character_length builtin_funcs/conv builtin_funcs/convert builtin_funcs/crc32 builtin_funcs/db_b_format + +test: builtin_funcs/db_b_hex builtin_funcs/db_b_if builtin_funcs/elt builtin_funcs/field builtin_funcs/find_in_set builtin_funcs/soundex builtin_funcs/space \ No newline at end of file diff --git a/contrib/dolphin/regress.conf b/contrib/dolphin/regress.conf new file mode 100644 index 0000000000000000000000000000000000000000..f7920699bc78a3251fcf6dd272aeb74fe2b3b92f --- /dev/null +++ b/contrib/dolphin/regress.conf @@ -0,0 +1,49 @@ +# ---------------------------------- +# Regression test configuration file +# ---------------------------------- +# +# This file consists of lines of the form: +# +# name = value +# +# (The "=" is optional.) Whitespace may be used. +# +# Comments are introduced with "#" anywhere on a line. +# + +#column_name_present = on # "off" indicates only tuples are printed as a + # result of the table query. The number of rows + # printed, also is disabled + # "on" indicates tuples are printed along with + # field names and total number of tuples. + +#column_separator = '|' # The user given string will be used as the + # field separator in the result of table query + # Special characters like \ " e.t.c, should + # be escaped using \ + # e.g. If \ has to be the field separator, + # then give column_separator = '\\' + +performance_data_printing = on + # "on": Prints the performance related info + # like Start time, Time taken, CPU and + # Memory usage by the tests. + # This configuration parameter works only + # on linux machines and if the DB Server + # is running on the same machine as the + # tests are running. + # "off": Turns off the feature. + +diagnostic_collect_on_fail = off + # "on": If a test fails, the db data folder contents + # are copied into a new folder with the same name + # as the failed test. This folder will be placed + # outside the existing db data folder. + # "off": Turns off the feature. + + +# GLOBAL VARIABLES + +@TC_SEP@ = '-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --' +@TC_SECTION_SEP@ = "-- ************************************************************************** --" +@RegressPath@ = "." diff --git a/contrib/dolphin/sql/builtin_funcs/bin.sql b/contrib/dolphin/sql/builtin_funcs/bin.sql index ca26e100017afe1e9254ee6929dbf796d7cdaf93..05b67ca391f001556041ab7f4f2b8ab1191d3095 100644 --- a/contrib/dolphin/sql/builtin_funcs/bin.sql +++ b/contrib/dolphin/sql/builtin_funcs/bin.sql @@ -1,6 +1,6 @@ -drop database if exists format_test; -create database format_test dbcompatibility 'B'; -\c format_test +drop database if exists db_bin; +create database db_bin dbcompatibility 'B'; +\c db_bin select bin(1); select bin(0); @@ -12,4 +12,4 @@ select bin(true); select bin(false); \c postgres -drop database if exists format_test; +drop database if exists db_bin; diff --git a/contrib/dolphin/sql/builtin_funcs/char.sql b/contrib/dolphin/sql/builtin_funcs/char.sql index 84eb94763cd20390086d8e6017cad8820776b633..e0bd65e0e2844593cf2d5578c3032c9c390ccd73 100644 --- a/contrib/dolphin/sql/builtin_funcs/char.sql +++ b/contrib/dolphin/sql/builtin_funcs/char.sql @@ -1,6 +1,6 @@ -drop database if exists format_test; -create database format_test dbcompatibility 'B'; -\c format_test +drop database if exists db_char; +create database db_char dbcompatibility 'B'; +\c db_char select chara(67,66,67); select chara('65','66','67'); @@ -20,4 +20,4 @@ select chara(18446744073709551615); select chara(65); \c postgres -drop database if exists format_test; +drop database if exists db_char; diff --git a/contrib/dolphin/sql/builtin_funcs/char_length.sql b/contrib/dolphin/sql/builtin_funcs/char_length.sql index c1ea3508418f33b16f86856af60235cffce85dac..874697a6a6e6603acfef2e9e103d2ce3241fb20b 100644 --- a/contrib/dolphin/sql/builtin_funcs/char_length.sql +++ b/contrib/dolphin/sql/builtin_funcs/char_length.sql @@ -1,6 +1,6 @@ -drop database if exists format_test; -create database format_test dbcompatibility 'B'; -\c format_test +drop database if exists db_char_length; +create database db_char_length dbcompatibility 'B'; +\c db_char_length select char_length(1234); select char_length( '1234'); @@ -15,4 +15,4 @@ select 1.1+char_length(1); select char_length(111111111111111111111111111111111111111111111111111111111111111111111111111111111); \c postgres -drop database if exists format_test; +drop database if exists db_char_length; diff --git a/contrib/dolphin/sql/builtin_funcs/character_length.sql b/contrib/dolphin/sql/builtin_funcs/character_length.sql index 7dc94adb8b861281ee15d55da3fe35e282fa2949..06a1fcfbf44a02d96142259729eddd9ac2d05506 100644 --- a/contrib/dolphin/sql/builtin_funcs/character_length.sql +++ b/contrib/dolphin/sql/builtin_funcs/character_length.sql @@ -1,6 +1,6 @@ -drop database if exists format_test; -create database format_test dbcompatibility 'B'; -\c format_test +drop database if exists db_character_length; +create database db_character_length dbcompatibility 'B'; +\c db_character_length select character_length(1234); select character_length( '1234'); @@ -15,4 +15,4 @@ select 1.1+character_length(1); select character_length(111111111111111111111111111111111111111111111111111111111111111111111111111111111); \c postgres -drop database if exists format_test; +drop database if exists db_character_length; diff --git a/contrib/dolphin/sql/builtin_funcs/conv.sql b/contrib/dolphin/sql/builtin_funcs/conv.sql index 87c3072616d17124ea276f8e54f831bc44dd48da..e70fc6f62805ba1bda803689835fde9d925c7e1e 100644 --- a/contrib/dolphin/sql/builtin_funcs/conv.sql +++ b/contrib/dolphin/sql/builtin_funcs/conv.sql @@ -1,6 +1,6 @@ -drop database if exists format_test; -create database format_test dbcompatibility 'B'; -\c format_test +drop database if exists db_conv; +create database db_conv dbcompatibility 'B'; +\c db_conv select conv('a',16,2); select conv('6e',18,8); @@ -98,4 +98,4 @@ select conv(-9544646155975628532428411,-10,10); select conv(-9544646155975628532428411,-10,-10); \c postgres -drop database if exists format_test; +drop database if exists db_conv; diff --git a/contrib/dolphin/sql/builtin_funcs/convert.sql b/contrib/dolphin/sql/builtin_funcs/convert.sql index 023dfc4a1bbf249eef701b478a8135dd2fb0cad0..2c07011e38b7a4468ef09eb43c56bd80d9f0478d 100644 --- a/contrib/dolphin/sql/builtin_funcs/convert.sql +++ b/contrib/dolphin/sql/builtin_funcs/convert.sql @@ -1,6 +1,6 @@ -drop database if exists format_test; -create database format_test dbcompatibility 'B'; -\c format_test +drop database if exists db_convert; +create database db_convert dbcompatibility 'B'; +\c db_convert select convert(1 using 'utf8'); select convert('1' using 'utf8'); @@ -13,4 +13,4 @@ select convert(1 using 'gbk'); select convert(1 using 'utf8'); \c postgres -drop database if exists format_test; +drop database if exists db_convert; diff --git a/contrib/dolphin/sql/builtin_funcs/crc32.sql b/contrib/dolphin/sql/builtin_funcs/crc32.sql index f0598c87b4de1cc4ad5c97c89e56dc3ed59b7f65..7edbac123c039fd812d4eac7dd59b921c05516c8 100644 --- a/contrib/dolphin/sql/builtin_funcs/crc32.sql +++ b/contrib/dolphin/sql/builtin_funcs/crc32.sql @@ -1,6 +1,6 @@ -drop database if exists format_test; -create database format_test dbcompatibility 'B'; -\c format_test +drop database if exists db_crc32; +create database db_crc32 dbcompatibility 'B'; +\c db_crc32 select crc32('abc'); select crc32(''); @@ -9,4 +9,4 @@ select crc32(1); select crc32(10),crc32(-3.1415926),crc32(1.339E5),crc32('ab57'),crc32('HAF47'); \c postgres -drop database if exists format_test; +drop database if exists db_crc32; diff --git a/contrib/dolphin/sql/builtin_funcs/db_b_format.sql b/contrib/dolphin/sql/builtin_funcs/db_b_format.sql index 6d5237b7332a5dc923614d10d7f4cb9fcdb3fb13..2c3afe01a843d3ef658b5d95da36552d1f886922 100644 --- a/contrib/dolphin/sql/builtin_funcs/db_b_format.sql +++ b/contrib/dolphin/sql/builtin_funcs/db_b_format.sql @@ -1,6 +1,6 @@ -drop database if exists format_test; -create database format_test dbcompatibility 'B'; -\c format_test +drop database if exists db_db_b_format; +create database db_db_b_format dbcompatibility 'B'; +\c db_db_b_format -- test for b_format_mode = false select format(1234.456, 2); select format(1234.456, 2, 'en_US'); @@ -130,12 +130,12 @@ select format('%s, %s, %s, %s, %s',1 ,1 ,1 ,1, 1); select format('%s, %s, %s, %s, %s, %s',1 ,1 ,1 ,1, 1, 1); \c postgres -drop database format_test; +drop database db_db_b_format; -- test for A compatibility to ensure the original functionality is good. -create database db_a_format_test dbcompatibility 'A'; -\c db_a_format_test +create database db_db_b_format dbcompatibility 'A'; +\c db_db_b_format select format(1234.456, 2); select format(1234.456, 2, 'en_US'); \c postgres -drop database db_a_format_test; \ No newline at end of file +drop database db_db_b_format; \ No newline at end of file diff --git a/contrib/dolphin/sql/builtin_funcs/db_b_hex.sql b/contrib/dolphin/sql/builtin_funcs/db_b_hex.sql index 31d40235329c91937f3b75322ee5cd11c97e8aa4..42636b6b5fee856af44e386bd32309a55169ce86 100644 --- a/contrib/dolphin/sql/builtin_funcs/db_b_hex.sql +++ b/contrib/dolphin/sql/builtin_funcs/db_b_hex.sql @@ -1,6 +1,6 @@ -drop database if exists format_test; -create database format_test dbcompatibility 'B'; -\c format_test +drop database if exists db_b_hex; +create database db_b_hex dbcompatibility 'B'; +\c db_b_hex select hex(int1(255)); select hex(int1(256)); @@ -57,4 +57,4 @@ insert into bytea_to_hex_test values (E'\\xDEADBEEF'); select hex(c1) from bytea_to_hex_test; \c postgres -drop database if exists format_test; +drop database if exists db_b_hex; diff --git a/contrib/dolphin/sql/builtin_funcs/db_b_if.sql b/contrib/dolphin/sql/builtin_funcs/db_b_if.sql index 96304a53ce2e756542f924f50a49013ee1442a5e..278b90afb5b65f8c8baacf34edf5045a00bcc6be 100644 --- a/contrib/dolphin/sql/builtin_funcs/db_b_if.sql +++ b/contrib/dolphin/sql/builtin_funcs/db_b_if.sql @@ -1,6 +1,6 @@ -drop database if exists format_test; -create database format_test dbcompatibility 'B'; -\c format_test +drop database if exists db_b_if; +create database db_b_if dbcompatibility 'B'; +\c db_b_if select if(TRUE, 1, 2); select if(FALSE, 1, 2); @@ -78,4 +78,4 @@ select if (true, 1.1::float8, true) as a, if (false, 1.1::float8, true) as b; select if (true, 2.2::numeric(10, 2), true) as a, if (false, 2.2::numeric(10, 2), true) as b; \c postgres -drop database if exists format_test; \ No newline at end of file +drop database if exists db_b_if; \ No newline at end of file diff --git a/contrib/dolphin/sql/builtin_funcs/elt.sql b/contrib/dolphin/sql/builtin_funcs/elt.sql index 40cb4177749a57749aa53cd868ec46e9ebc20bf3..39e89d500b5d90171a07650a05120f690daa4a46 100644 --- a/contrib/dolphin/sql/builtin_funcs/elt.sql +++ b/contrib/dolphin/sql/builtin_funcs/elt.sql @@ -1,6 +1,6 @@ -drop database if exists format_test; -create database format_test dbcompatibility 'B'; -\c format_test +drop database if exists db_elt; +create database db_elt dbcompatibility 'B'; +\c db_elt select elt(1,1); select elt(-1,1); select elt(1.2,'a'); @@ -16,4 +16,4 @@ select elt(1,'a',2); select elt(2,'a',2); \c postgres -drop database if exists format_test; +drop database if exists db_elt; diff --git a/contrib/dolphin/sql/builtin_funcs/field.sql b/contrib/dolphin/sql/builtin_funcs/field.sql index 0fad42960d144bdf9c0ed9bf5ee190be0a2c030a..91830daa4f3b00bd49c04f97be3c209e7f1c1fe6 100644 --- a/contrib/dolphin/sql/builtin_funcs/field.sql +++ b/contrib/dolphin/sql/builtin_funcs/field.sql @@ -1,6 +1,6 @@ -drop database if exists format_test; -create database format_test dbcompatibility 'B'; -\c format_test +drop database if exists db_field; +create database db_field dbcompatibility 'B'; +\c db_field select field(4,1,2,3,4); select field(2,1.1,2.1,3.1); @@ -16,4 +16,4 @@ select field(1,'a','b','1'); select field('a','b',1,'a'); select field(1,2,1.2); \c postgres -drop database if exists format_test; +drop database if exists db_field; diff --git a/contrib/dolphin/sql/builtin_funcs/find_in_set.sql b/contrib/dolphin/sql/builtin_funcs/find_in_set.sql index 4048bd953ac8c5d7b84f77c0871f5525793dfad4..ea732d07aedc71d5793f6cf9880d5b0d00d7d5ce 100644 --- a/contrib/dolphin/sql/builtin_funcs/find_in_set.sql +++ b/contrib/dolphin/sql/builtin_funcs/find_in_set.sql @@ -1,6 +1,6 @@ -drop database if exists format_test; -create database format_test dbcompatibility 'B'; -\c format_test +drop database if exists db_find_in_set; +create database db_find_in_set dbcompatibility 'B'; +\c db_find_in_set select find_in_set(1,'a,1,c'); select find_in_set(1.2,'a,1.2,c'); @@ -15,4 +15,4 @@ select find_in_set(1,'1,1.2,c,qwee,1212,1.1,12,qw'); select find_in_set(1,'1.1,1.2,c,qwee,1212,1.1,12,1'); select find_in_set(1.1,'a,1.2,c,qwee,1212,1.1'); \c postgres -drop database if exists format_test; +drop database if exists db_find_in_set; diff --git a/contrib/dolphin/sql/builtin_funcs/soundex.sql b/contrib/dolphin/sql/builtin_funcs/soundex.sql index 40bde3c1bc9df424f366aa8a18c27ebbe7750cdd..e0afa8634206f0a675fb57c3e921022f64071b93 100644 --- a/contrib/dolphin/sql/builtin_funcs/soundex.sql +++ b/contrib/dolphin/sql/builtin_funcs/soundex.sql @@ -1,6 +1,6 @@ -drop database if exists format_test; -create database format_test dbcompatibility 'B'; -\c format_test +drop database if exists db_soundex; +create database db_soundex dbcompatibility 'B'; +\c db_soundex select soundex('abc'); select soundex(10); @@ -11,4 +11,4 @@ select soundex('hell'); \c postgres -drop database if exists format_test; +drop database if exists db_soundex; diff --git a/contrib/dolphin/sql/builtin_funcs/space.sql b/contrib/dolphin/sql/builtin_funcs/space.sql index 4f6196f65f681745253e55ea9a900478e7e6f55b..7d14503c4210bfb35eef1ad71e907682308e02b0 100644 --- a/contrib/dolphin/sql/builtin_funcs/space.sql +++ b/contrib/dolphin/sql/builtin_funcs/space.sql @@ -1,6 +1,6 @@ -drop database if exists format_test; -create database format_test dbcompatibility 'B'; -\c format_test +drop database if exists db_space; +create database db_space dbcompatibility 'B'; +\c db_space select space('a'); select space(10); @@ -8,4 +8,4 @@ select space(-1); select space('0'); select space('-1'); \c postgres -drop database if exists format_test; +drop database if exists db_space; diff --git a/contrib/dolphin/sql/db_b_new_gram_test.sql b/contrib/dolphin/sql/db_b_new_gram_test.sql index 71ee63a3ff16f28abc446a7431947eb413e6fe9c..a5ea09043754105a5b90a127f81d28c131e7a6b8 100644 --- a/contrib/dolphin/sql/db_b_new_gram_test.sql +++ b/contrib/dolphin/sql/db_b_new_gram_test.sql @@ -1,6 +1,6 @@ -drop database if exists test; -create database test dbcompatibility 'B'; -\c test +drop database if exists db_b_new_gram_test; +create database db_b_new_gram_test dbcompatibility 'B'; +\c db_b_new_gram_test -- CREATE TABLE engine test CREATE TABLE test_engine_1 (a int) engine = InnoDB; @@ -126,4 +126,4 @@ SELECT count(*) FROM PG_PREPARED_STATEMENTS WHERE name LIKE '%instr_test%'; DROP TEMPORARY TABLE test_engine_1 CASCADE; \c postgres -drop database test; +drop database db_b_new_gram_test; diff --git a/contrib/dolphin/sql/db_b_parser1.sql b/contrib/dolphin/sql/db_b_parser1.sql index a4331e58c665f6d24f0f27578050144423455b67..c5244c9feb8b17cb54c0711c8b930863aa581238 100644 --- a/contrib/dolphin/sql/db_b_parser1.sql +++ b/contrib/dolphin/sql/db_b_parser1.sql @@ -1,6 +1,6 @@ -drop database if exists mysql_test; -create database mysql_test dbcompatibility 'b'; -\c mysql_test +drop database if exists db_b_parser1; +create database db_b_parser1 dbcompatibility 'b'; +\c db_b_parser1 select 'bbbbb' regexp '^([bc])\1*$' as t, 'bbbbb' not regexp '^([bc])\1*$' as t2, 'bbbbb' rlike '^([bc])\1*$' as t; select 'ccc' regexp '^([bc])\1*$' as t, 'ccc' not regexp '^([bc])\1*$' as t2, 'ccc' rlike '^([bc])\1*$' as t; select 'xxx' regexp '^([bc])\1*$' as f, 'xxx' not regexp '^([bc])\1*$' as f2, 'xxx' rlike '^([bc])\1*$' as f; @@ -65,4 +65,4 @@ select '-12.3abc' rlike false; select '-12.3abc' rlike 'null'; \c postgres -drop database if exists mysql_test; \ No newline at end of file +drop database if exists db_b_parser1; \ No newline at end of file diff --git a/contrib/dolphin/sql/db_b_parser2.sql b/contrib/dolphin/sql/db_b_parser2.sql index 71b7a697019b142b8eff485fc35b72ff21ece0bc..7083ee595fb7671b06a47647b1773b4075401647 100644 --- a/contrib/dolphin/sql/db_b_parser2.sql +++ b/contrib/dolphin/sql/db_b_parser2.sql @@ -1,6 +1,6 @@ -drop database if exists mysql_test; -create database mysql_test dbcompatibility 'b'; -\c mysql_test +drop database if exists db_b_parser2; +create database db_b_parser2 dbcompatibility 'b'; +\c db_b_parser2 --验证DAYOFMONTH() DAYOFWEEK() DAYOFYEAR() HOUR() MICROSECOND() MINUTE() QUARTER() SECOND() WEEKDAY() WEEKOFYEAR() YEAR() select DAYOFMONTH(datetime '2021-11-4 16:30:44.341191'); @@ -94,4 +94,4 @@ select length(E'哈1哈\n'),length(E'\n'),length(E'\\n'); select length(''),length(' '),length(NULL); \c postgres -drop database if exists mysql_test; \ No newline at end of file +drop database if exists db_b_parser2; \ No newline at end of file diff --git a/contrib/dolphin/sql/db_b_parser3.sql b/contrib/dolphin/sql/db_b_parser3.sql index 98eceffa1d02e56c64bf19aa6ccce72908046319..df3bebf34e3d816d926298a9c4228eb38d8e74e5 100644 --- a/contrib/dolphin/sql/db_b_parser3.sql +++ b/contrib/dolphin/sql/db_b_parser3.sql @@ -1,6 +1,6 @@ -drop database if exists mysql_test; -create database mysql_test dbcompatibility 'b'; -\c mysql_test +drop database if exists db_b_parser3; +create database db_b_parser3 dbcompatibility 'b'; +\c db_b_parser3 --测试点一:验证lcase函数 select lcase('ABc'), lcase('哈哈'), lcase('123456'),lcase('哈市&%%¥#'),lcase(null); @@ -111,4 +111,4 @@ select '-12.3abc' xor 'null'; \c postgres -drop database if exists mysql_test; \ No newline at end of file +drop database if exists db_b_parser3; \ No newline at end of file diff --git a/contrib/dolphin/sql/db_b_parser4.sql b/contrib/dolphin/sql/db_b_parser4.sql index f1d7981d102248e0989f7cacd372e36ba66b9506..e48a08c89285f94c5bd3895a801897a62cbf5812 100644 --- a/contrib/dolphin/sql/db_b_parser4.sql +++ b/contrib/dolphin/sql/db_b_parser4.sql @@ -1,6 +1,6 @@ -drop database if exists mysql_test; -create database mysql_test dbcompatibility 'b'; -\c mysql_test +drop database if exists db_b_parser4; +create database db_b_parser4 dbcompatibility 'b'; +\c db_b_parser4 --验证text类型 drop table if exists tb_db_b_parser_0001; create table tb_db_b_parser_0001(a text(10),b tinytext,c mediumtext,d longtext); @@ -31,4 +31,4 @@ drop table if exists tb_real_float; \c postgres -drop database if exists mysql_test; \ No newline at end of file +drop database if exists db_b_parser4; \ No newline at end of file diff --git a/contrib/dolphin/sql/db_b_plpgsql_test.sql b/contrib/dolphin/sql/db_b_plpgsql_test.sql index ca76e629098b27f265145b79a33145915ec391da..209788734ff222fd3d867469991dac771b89c97b 100644 --- a/contrib/dolphin/sql/db_b_plpgsql_test.sql +++ b/contrib/dolphin/sql/db_b_plpgsql_test.sql @@ -1,6 +1,6 @@ -drop database if exists test; -create database test dbcompatibility 'b'; -\c test +drop database if exists db_b_plpgsql_test; +create database db_b_plpgsql_test dbcompatibility 'b'; +\c db_b_plpgsql_test create table tb_b_grammar_0038(a text(10)) engine = 表1; @@ -45,4 +45,4 @@ SELECT * from proc_01(); SELECT * from tb_b_grammar_0038; \c postgres -drop database if exists test; \ No newline at end of file +drop database if exists db_b_plpgsql_test; \ No newline at end of file diff --git a/contrib/dolphin/sql/default_guc.sql b/contrib/dolphin/sql/default_guc.sql index 9db07757cc56796da3ea92371f8dab77a08f6c94..1fa1aae467a39140c3da7aaee7a1bb6097ad90e6 100644 --- a/contrib/dolphin/sql/default_guc.sql +++ b/contrib/dolphin/sql/default_guc.sql @@ -1,6 +1,6 @@ -drop database if exists test; -create database test dbcompatibility 'b'; -\c test +drop database if exists default_guc; +create database default_guc dbcompatibility 'b'; +\c default_guc show behavior_compat_options; select 0.123; @@ -14,4 +14,4 @@ select md5(0.123); select md5('0.123'); \c postgres -drop database if exists test; \ No newline at end of file +drop database if exists default_guc; \ No newline at end of file diff --git a/contrib/dolphin/sql/describe.sql b/contrib/dolphin/sql/describe.sql index 25794f2b8b1f168be1e982d5fe876796af228166..0801da4d067062a11cf4b7593c8ee22847e21d38 100644 --- a/contrib/dolphin/sql/describe.sql +++ b/contrib/dolphin/sql/describe.sql @@ -1,6 +1,6 @@ -drop database if exists dolphin; -create database dolphin dbcompatibility 'b'; -\c dolphin +drop database if exists db_describe; +create database db_describe dbcompatibility 'b'; +\c db_describe CREATE TABLE test2 ( id int PRIMARY KEY @@ -52,4 +52,4 @@ desc sc.test; desc public.test4; desc sc.test4; \c postgres -drop database if exists dolphin; \ No newline at end of file +drop database if exists db_describe; \ No newline at end of file diff --git a/contrib/dolphin/sql/dummy.sql b/contrib/dolphin/sql/dummy.sql new file mode 100644 index 0000000000000000000000000000000000000000..9e13a3eff4a7379fc61761756cb4e63065b2ea15 --- /dev/null +++ b/contrib/dolphin/sql/dummy.sql @@ -0,0 +1 @@ +select 1; \ No newline at end of file diff --git a/contrib/dolphin/sql/empty_value_list.sql b/contrib/dolphin/sql/empty_value_list.sql index 1a37e92d074ef71961558199ca116da526e6feb1..59ffd20371e9a2a1fd32ef97261fd0e20395c1dc 100644 --- a/contrib/dolphin/sql/empty_value_list.sql +++ b/contrib/dolphin/sql/empty_value_list.sql @@ -1,8 +1,8 @@ -- b compatibility case -drop database if exists b; -create database b dbcompatibility 'b'; +drop database if exists empty_value_list; +create database empty_value_list dbcompatibility 'b'; -\c b +\c empty_value_list create table test1(num int); create table test2(num int default 3); @@ -201,4 +201,4 @@ select * from pg_type_nonstrict_basic_value where typename = 'point'; select * from pg_type_nonstrict_basic_value where typename = 'tinterval'; \c postgres -drop database if exists b; +drop database if exists empty_value_list; diff --git a/contrib/dolphin/sql/empty_value_lists.sql b/contrib/dolphin/sql/empty_value_lists.sql index a371ba895e05594e0ee586c73bf7634c3250d41b..590b0116d15c70aa6a7570e836e912dbc8c8155b 100644 --- a/contrib/dolphin/sql/empty_value_lists.sql +++ b/contrib/dolphin/sql/empty_value_lists.sql @@ -1,8 +1,8 @@ -- b compatibility case -drop database if exists b; -create database b dbcompatibility 'b'; +drop database if exists empty_value_lists; +create database empty_value_lists dbcompatibility 'b'; -\c b +\c empty_value_lists create table test1(num int); create table test2(num int default 3); @@ -189,4 +189,4 @@ insert into m4 values(),(); select * from m4; \c postgres -drop database if exists b; +drop database if exists empty_value_lists; diff --git a/contrib/dolphin/sql/empty_value_support_value.sql b/contrib/dolphin/sql/empty_value_support_value.sql index 357b76bb9733fa990e146a5449091873d644bf98..79a61f7bceebb18c4d3e3e18ad6b4de287e5a6d5 100644 --- a/contrib/dolphin/sql/empty_value_support_value.sql +++ b/contrib/dolphin/sql/empty_value_support_value.sql @@ -1,7 +1,7 @@ -drop database if exists b; -create database b dbcompatibility 'b'; +drop database if exists empty_value_support_value; +create database empty_value_support_value dbcompatibility 'b'; -\c b +\c empty_value_support_value create table test1(num int not null); insert into test1 value(); insert into test1 value(),(); @@ -12,4 +12,4 @@ insert into test1 value(),(); select * from test1; \c postgres -drop database if exists b; \ No newline at end of file +drop database if exists empty_value_support_value; \ No newline at end of file diff --git a/contrib/dolphin/sql/float_numeric_test/db_b_log_test.sql b/contrib/dolphin/sql/float_numeric_test/db_b_log_test.sql index eab5ff8da80f1b8b92f1aebb12eb49969aae9185..73c11c31ad40b72015e6f3881dc14d9b9679c153 100644 --- a/contrib/dolphin/sql/float_numeric_test/db_b_log_test.sql +++ b/contrib/dolphin/sql/float_numeric_test/db_b_log_test.sql @@ -1,7 +1,7 @@ SELECT LOG(10); -drop database if exists test; -create database test dbcompatibility 'B'; -\c test +drop database if exists db_b_log_test; +create database db_b_log_test dbcompatibility 'B'; +\c db_b_log_test SELECT LOG(10); SELECT LOG10(100); @@ -34,4 +34,4 @@ SELECT LOG(0, 64) IS NULL; SELECT LOG(2, 0) IS NULL; \c postgres -drop database test; +drop database db_b_log_test; diff --git a/contrib/dolphin/sql/float_numeric_test/db_b_sqrt_test.sql b/contrib/dolphin/sql/float_numeric_test/db_b_sqrt_test.sql index 3f6b938883facaba67620ee3bb5059638b246bd3..a4b7101a85b27a62c4ece0c7d6752a58328c0ed6 100644 --- a/contrib/dolphin/sql/float_numeric_test/db_b_sqrt_test.sql +++ b/contrib/dolphin/sql/float_numeric_test/db_b_sqrt_test.sql @@ -1,9 +1,9 @@ SELECT SQRT(64); SELECT SQRT(-64); -drop database if exists test; -create database test dbcompatibility 'B'; -\c test +drop database if exists db_b_sqrt_test; +create database db_b_sqrt_test dbcompatibility 'B'; +\c db_b_sqrt_test SELECT SQRT(64); SELECT SQRT(-64); @@ -12,4 +12,4 @@ SELECT SQRT(64::numeric); SELECT SQRT(-64::numeric); \c postgres -drop database test; +drop database db_b_sqrt_test; diff --git a/contrib/dolphin/sql/greatest_least.sql b/contrib/dolphin/sql/greatest_least.sql index 2d213f942bd4ac8a84da79e30305ba3cffb671a2..f9633f1cc7db10bea658bd1bcc55f6f3dc248125 100644 --- a/contrib/dolphin/sql/greatest_least.sql +++ b/contrib/dolphin/sql/greatest_least.sql @@ -1,6 +1,6 @@ -drop database if exists b; -create database b dbcompatibility 'b'; -\c b +drop database if exists greatest_least; +create database greatest_least dbcompatibility 'b'; +\c greatest_least --return null if input include null select GREATEST(null,1,2), GREATEST(null,1,2) is null; select GREATEST(1,2); @@ -9,4 +9,4 @@ select LEAST(null,1,2), LEAST(null,1,2) is null; select LEAST(1,2); \c postgres -drop database if exists b; +drop database if exists greatest_least; diff --git a/contrib/dolphin/sql/join_without_on.sql b/contrib/dolphin/sql/join_without_on.sql index 8c6c72af2c7d1a980add040b60d6753a907d970b..9a00342a0b18666ee7f49cd89d0c0f2c8293a05f 100644 --- a/contrib/dolphin/sql/join_without_on.sql +++ b/contrib/dolphin/sql/join_without_on.sql @@ -1,6 +1,6 @@ -drop database if exists mysql_test; -create database mysql_test dbcompatibility 'b'; -\c mysql_test +drop database if exists join_without_on; +create database join_without_on dbcompatibility 'b'; +\c join_without_on CREATE TABLE J1_TBL ( i integer, @@ -62,4 +62,4 @@ SELECT * FROM J1_TBL JOIN J2_TBL JOIN J3_TBL JOIN J4_TBL ON J1_TBL.i = J4_TBL. SELECT * FROM J1_TBL JOIN J2_TBL INNER JOIN J3_TBL INNER JOIN J4_TBL ON J1_TBL.i = J4_TBL.i; \c postgres -drop database if exists mysql_test; \ No newline at end of file +drop database if exists join_without_on; \ No newline at end of file diff --git a/contrib/dolphin/sql/nvarchar.sql b/contrib/dolphin/sql/nvarchar.sql index e30cd1dd8d376c607f11e1430f405de6e9719764..4ce4a1e199095ce60237acee5e132845e342f10a 100644 --- a/contrib/dolphin/sql/nvarchar.sql +++ b/contrib/dolphin/sql/nvarchar.sql @@ -1,8 +1,8 @@ -- b compatibility case -drop database if exists b; -create database b dbcompatibility 'b'; +drop database if exists db_nvarchar; +create database db_nvarchar dbcompatibility 'b'; -\c b +\c db_nvarchar -- -- VARCHAR -- @@ -70,4 +70,4 @@ INSERT INTO NVARCHAR_TBL (f1) VALUES ('abcd '); SELECT '' AS four, * FROM NVARCHAR_TBL; \c postgres -drop database if exists b; \ No newline at end of file +drop database if exists db_nvarchar; \ No newline at end of file diff --git a/contrib/dolphin/sql/regexp.sql b/contrib/dolphin/sql/regexp.sql index 7e68b8dacabaf447ab1cbda8481cc2f5a6d70ea2..ee9895a8d06de3ef48d02112d8d48a2523bcedbd 100644 --- a/contrib/dolphin/sql/regexp.sql +++ b/contrib/dolphin/sql/regexp.sql @@ -1,7 +1,7 @@ -drop database if exists mysql; -create database mysql dbcompatibility 'b'; -\c mysql +drop database if exists db_regexp; +create database db_regexp dbcompatibility 'b'; +\c db_regexp select regexp('a', true); \c postgres -drop database if exists mysql; \ No newline at end of file +drop database if exists db_regexp; \ No newline at end of file diff --git a/contrib/dolphin/sql/show.sql b/contrib/dolphin/sql/show.sql index d6cbc2e4af798764ecf9ce961be298e69c8d2a16..16444342efddd0a0931af90bcc3c61c05ecc2eb5 100644 --- a/contrib/dolphin/sql/show.sql +++ b/contrib/dolphin/sql/show.sql @@ -1,7 +1,7 @@ -drop database if exists mysql; -create database mysql dbcompatibility 'b'; -\c mysql +drop database if exists db_show; +create database db_show dbcompatibility 'b'; +\c db_show show processlist; show full processlist; \c postgres -drop database if exists mysql; \ No newline at end of file +drop database if exists db_show; \ No newline at end of file diff --git a/contrib/dolphin/sql/string_func_test/db_b_ascii_test.sql b/contrib/dolphin/sql/string_func_test/db_b_ascii_test.sql index bd0b74d4d14d888d05157d42fccc7b69a4231cd4..855ab5e54e5b6ec57780f3775f5c7f5a470b475c 100644 --- a/contrib/dolphin/sql/string_func_test/db_b_ascii_test.sql +++ b/contrib/dolphin/sql/string_func_test/db_b_ascii_test.sql @@ -1,11 +1,11 @@ SELECT ASCII('a'); SELECT ASCII('你'); -drop database if exists test; -create database test dbcompatibility 'B'; -\c test +drop database if exists db_b_ascii_test; +create database db_b_ascii_test dbcompatibility 'B'; +\c db_b_ascii_test SELECT ASCII('a'); SELECT ASCII('你'); \c postgres -drop database test; +drop database db_b_ascii_test; diff --git a/contrib/dolphin/sql/string_func_test/db_b_left_right_test.sql b/contrib/dolphin/sql/string_func_test/db_b_left_right_test.sql index 199e3a00e8414225c0ac79f96a6665a4954ce1ac..8c2c3f9f538a92de6f23eb166b13fe8a2ff8f606 100644 --- a/contrib/dolphin/sql/string_func_test/db_b_left_right_test.sql +++ b/contrib/dolphin/sql/string_func_test/db_b_left_right_test.sql @@ -3,9 +3,9 @@ SELECT left('abcdefg', -3); SELECT right('abcdefg', 3); SELECT right('abcdefg', -3); -drop database if exists test; -create database test dbcompatibility 'B'; -\c test +drop database if exists db_b_left_right_test; +create database db_b_left_right_test dbcompatibility 'B'; +\c db_b_left_right_test set bytea_output to escape; @@ -69,4 +69,4 @@ select right('abc',2.5); select right('abc',5/2); \c postgres -drop database test; \ No newline at end of file +drop database db_b_left_right_test; \ No newline at end of file diff --git a/contrib/dolphin/sql/string_func_test/db_b_quote_test.sql b/contrib/dolphin/sql/string_func_test/db_b_quote_test.sql index 4dc3029c63164fdf623ffc3c30cb36c5f0db2fdc..1228354d4fc09020ec827e78db8ca60793e0815a 100644 --- a/contrib/dolphin/sql/string_func_test/db_b_quote_test.sql +++ b/contrib/dolphin/sql/string_func_test/db_b_quote_test.sql @@ -1,10 +1,10 @@ -drop database if exists test; -create database test dbcompatibility 'B'; -\c test +drop database if exists db_b_quote_test; +create database db_b_quote_test dbcompatibility 'B'; +\c db_b_quote_test SELECT QUOTE(E'Don\'t!'); SELECT QUOTE(E'O\'hello'); SELECT QUOTE('O\hello'); \c postgres -drop database test; \ No newline at end of file +drop database db_b_quote_test; \ No newline at end of file diff --git a/contrib/dolphin/sql/string_func_test/db_b_string_length_test.sql b/contrib/dolphin/sql/string_func_test/db_b_string_length_test.sql index d554667577a29dd2bb29a714867f657b633a3539..78155f18d5f23c863e95db74d1bf14d13737bb05 100644 --- a/contrib/dolphin/sql/string_func_test/db_b_string_length_test.sql +++ b/contrib/dolphin/sql/string_func_test/db_b_string_length_test.sql @@ -3,9 +3,9 @@ SELECT length('你好呀'); SELECT LENGTH(B'101'); SELECT length('你好呀jose'); -drop database if exists test; -create database test dbcompatibility 'B'; -\c test +drop database if exists db_b_string_length_test; +create database db_b_string_length_test dbcompatibility 'B'; +\c db_b_string_length_test SELECT length('jose'); SELECT length('你好呀'); @@ -13,4 +13,4 @@ SELECT LENGTH(B'101'); SELECT length('你好呀jose'); \c postgres -drop database test; \ No newline at end of file +drop database db_b_string_length_test; \ No newline at end of file diff --git a/contrib/dolphin/sql/string_func_test/db_b_substr_test.sql b/contrib/dolphin/sql/string_func_test/db_b_substr_test.sql index 91b7471fd16b6b310a8d47c65b9a7f6ae3ff6ce2..ea95bef62e188975e026ea051d3673a435790cf7 100644 --- a/contrib/dolphin/sql/string_func_test/db_b_substr_test.sql +++ b/contrib/dolphin/sql/string_func_test/db_b_substr_test.sql @@ -39,9 +39,9 @@ FROM template_string; DROP TABLE IF EXISTS template_string; -drop database if exists test; -create database test dbcompatibility 'B'; -\c test +drop database if exists db_b_substr_test; +create database db_b_substr_test dbcompatibility 'B'; +\c db_b_substr_test set bytea_output to escape; @@ -194,4 +194,4 @@ select c1, c2, substr(c1 for c2) from test_column order by c1; select c1, c2, substr(c1 for c2) from test_row order by c1; \c postgres -drop database test; +drop database db_b_substr_test; diff --git a/contrib/dolphin/sql/string_func_test/db_b_trim_test.sql b/contrib/dolphin/sql/string_func_test/db_b_trim_test.sql index 6612ebb15a542b8bcd5f00e0ed3a0e51bb5a842e..79bd07ee8ff0d9be04843feac58ff060bde30049 100644 --- a/contrib/dolphin/sql/string_func_test/db_b_trim_test.sql +++ b/contrib/dolphin/sql/string_func_test/db_b_trim_test.sql @@ -6,9 +6,9 @@ SELECT TRIM(LEADING 'xyz' FROM 'xyzxbarxxyz'); SELECT TRIM(BOTH 'xyz' FROM 'xyzxbarxxyz'); SELECT TRIM(TRAILING 'xyz' FROM 'xyzxbarxxyz'); -drop database if exists test; -create database test dbcompatibility 'B'; -\c test +drop database if exists db_b_trim_test; +create database db_b_trim_test dbcompatibility 'B'; +\c db_b_trim_test SELECT TRIM(' bar '); SELECT TRIM(LEADING 'x' FROM 'xxxbarxxx'); @@ -32,4 +32,4 @@ SELECT TRIM(LEADING ' X '::bytea); SELECT TRIM(TRAILING ' X '::bytea); \c postgres -drop database test; \ No newline at end of file +drop database db_b_trim_test; \ No newline at end of file diff --git a/contrib/dolphin/sql/test_binary.sql b/contrib/dolphin/sql/test_binary.sql index 6e361d41ba303b92e3b802b1dc76b41a703611b8..376aaf5a969ce880562f53c403ad2983c4b77b52 100644 --- a/contrib/dolphin/sql/test_binary.sql +++ b/contrib/dolphin/sql/test_binary.sql @@ -1,6 +1,6 @@ -drop database if exists test; -create database test dbcompatibility 'B'; -\c test +drop database if exists test_binary; +create database test_binary dbcompatibility 'B'; +\c test_binary create table binary_templates (a bytea, b binary(5), c varbinary(5)); -- invalid typmod @@ -84,4 +84,4 @@ drop table if exists t_binary_061; drop table if exists t_varbinary_061; \c postgres -drop database test; \ No newline at end of file +drop database test_binary; \ No newline at end of file diff --git a/contrib/dolphin/sql/test_blob.sql b/contrib/dolphin/sql/test_blob.sql index 2ca9dbda7a45a020702d8b97d73ef13a5dd954de..b781a587939606e856b586484d439761d22bb6c8 100644 --- a/contrib/dolphin/sql/test_blob.sql +++ b/contrib/dolphin/sql/test_blob.sql @@ -1,6 +1,6 @@ -drop database if exists test; -create database test dbcompatibility 'B'; -\c test +drop database if exists test_blob; +create database test_blob dbcompatibility 'B'; +\c test_blob create table test_template (t tinyblob, b blob, m mediumblob, l longblob); insert into test_template values('aaaaaaaaa', 'aaaaaaaaa', 'aaaaaaaaa', 'aaaaaaaaa'); create table test_tiny (t tinyblob); @@ -39,4 +39,4 @@ drop table test_blob; drop table test_medium; drop table test_long; \c postgres -drop database test; \ No newline at end of file +drop database test_blob; \ No newline at end of file diff --git a/contrib/dolphin/sql/test_fixed.sql b/contrib/dolphin/sql/test_fixed.sql index 2911b7207b513de5c610f0177d20f1d3e7587194..19d01842b7d7b0d7c14178da0dac027fa20fa519 100644 --- a/contrib/dolphin/sql/test_fixed.sql +++ b/contrib/dolphin/sql/test_fixed.sql @@ -1,9 +1,9 @@ -drop database if exists test; -create database test dbcompatibility 'B'; -\c test +drop database if exists test_fixed; +create database test_fixed dbcompatibility 'B'; +\c test_fixed DROP TABLE IF EXISTS fixed_test; CREATE TABLE fixed_test (a fixed(10, 5)); \d fixed_test DROP TABLE fixed_test; \c postgres -drop database test; \ No newline at end of file +drop database test_fixed; \ No newline at end of file diff --git a/contrib/dolphin/sql/test_mysql_enum.sql b/contrib/dolphin/sql/test_mysql_enum.sql index d343639b76b93cbecb559856b34f7fbb662cf175..6db3cb136a98fbb6e3cc4b118a3638192ff2df71 100644 --- a/contrib/dolphin/sql/test_mysql_enum.sql +++ b/contrib/dolphin/sql/test_mysql_enum.sql @@ -1,6 +1,6 @@ -drop database if exists test_db; -CREATE DATABASE test_db with dbcompatibility='B'; -\c test_db +drop database if exists test_enum; +CREATE DATABASE test_enum with dbcompatibility='B'; +\c test_enum -- create extension dolphin; show sql_compatibility; -- when drop a column using an auto created enum type, the created enum type will also be dropped. @@ -133,4 +133,4 @@ DELETE FROM test WHERE myname=4; DROP TABLE test; \c postgres -DROP DATABASE test_db; +DROP DATABASE test_enum;