From 582713f9db352db1168d066db9cf0d92742a63d9 Mon Sep 17 00:00:00 2001 From: TotaJ Date: Fri, 1 Jul 2022 11:52:52 +0800 Subject: [PATCH] Enhance testcase. --- contrib/dolphin/Makefile | 8 +-- .../dolphin/expected/builtin_funcs/bin.out | 10 ++-- .../dolphin/expected/builtin_funcs/char.out | 10 ++-- .../expected/builtin_funcs/char_length.out | 10 ++-- .../builtin_funcs/character_length.out | 10 ++-- .../dolphin/expected/builtin_funcs/conv.out | 10 ++-- .../expected/builtin_funcs/convert.out | 10 ++-- .../dolphin/expected/builtin_funcs/crc32.out | 10 ++-- .../expected/builtin_funcs/db_b_format.out | 16 +++--- .../expected/builtin_funcs/db_b_hex.out | 10 ++-- .../expected/builtin_funcs/db_b_if.out | 10 ++-- .../dolphin/expected/builtin_funcs/elt.out | 10 ++-- .../dolphin/expected/builtin_funcs/field.out | 10 ++-- .../expected/builtin_funcs/find_in_set.out | 10 ++-- .../expected/builtin_funcs/soundex.out | 10 ++-- .../dolphin/expected/builtin_funcs/space.out | 10 ++-- .../dolphin/expected/db_b_new_gram_test.out | 10 ++-- contrib/dolphin/expected/db_b_parser1.out | 10 ++-- contrib/dolphin/expected/db_b_parser2.out | 10 ++-- contrib/dolphin/expected/db_b_parser3.out | 10 ++-- contrib/dolphin/expected/db_b_parser4.out | 10 ++-- .../dolphin/expected/db_b_plpgsql_test.out | 10 ++-- contrib/dolphin/expected/default_guc.out | 10 ++-- contrib/dolphin/expected/describe.out | 10 ++-- contrib/dolphin/expected/dummy.out | 6 +++ contrib/dolphin/expected/empty_value_list.out | 10 ++-- .../dolphin/expected/empty_value_lists.out | 10 ++-- .../expected/empty_value_support_value.out | 10 ++-- .../float_numeric_test/db_b_log_test.out | 10 ++-- .../float_numeric_test/db_b_sqrt_test.out | 10 ++-- contrib/dolphin/expected/greatest_least.out | 10 ++-- contrib/dolphin/expected/join_without_on.out | 10 ++-- contrib/dolphin/expected/nvarchar.out | 10 ++-- contrib/dolphin/expected/regexp.out | 10 ++-- contrib/dolphin/expected/show.out | 20 +++----- .../string_func_test/db_b_ascii_test.out | 10 ++-- .../string_func_test/db_b_left_right_test.out | 10 ++-- .../string_func_test/db_b_quote_test.out | 10 ++-- .../db_b_string_length_test.out | 10 ++-- .../string_func_test/db_b_substr_test.out | 10 ++-- .../string_func_test/db_b_trim_test.out | 10 ++-- contrib/dolphin/expected/test_binary.out | 10 ++-- contrib/dolphin/expected/test_blob.out | 10 ++-- contrib/dolphin/expected/test_fixed.out | 10 ++-- contrib/dolphin/expected/test_mysql_enum.out | 10 ++-- contrib/dolphin/make_check_postgresql.conf | 39 +++++++++++++++ contrib/dolphin/parallel_schedule_dolphin | 26 ++++++++++ contrib/dolphin/regress.conf | 49 +++++++++++++++++++ contrib/dolphin/sql/builtin_funcs/bin.sql | 8 +-- contrib/dolphin/sql/builtin_funcs/char.sql | 8 +-- .../dolphin/sql/builtin_funcs/char_length.sql | 8 +-- .../sql/builtin_funcs/character_length.sql | 8 +-- contrib/dolphin/sql/builtin_funcs/conv.sql | 8 +-- contrib/dolphin/sql/builtin_funcs/convert.sql | 8 +-- contrib/dolphin/sql/builtin_funcs/crc32.sql | 8 +-- .../dolphin/sql/builtin_funcs/db_b_format.sql | 14 +++--- .../dolphin/sql/builtin_funcs/db_b_hex.sql | 8 +-- contrib/dolphin/sql/builtin_funcs/db_b_if.sql | 8 +-- contrib/dolphin/sql/builtin_funcs/elt.sql | 8 +-- contrib/dolphin/sql/builtin_funcs/field.sql | 8 +-- .../dolphin/sql/builtin_funcs/find_in_set.sql | 8 +-- contrib/dolphin/sql/builtin_funcs/soundex.sql | 8 +-- contrib/dolphin/sql/builtin_funcs/space.sql | 8 +-- contrib/dolphin/sql/db_b_new_gram_test.sql | 8 +-- contrib/dolphin/sql/db_b_parser1.sql | 8 +-- contrib/dolphin/sql/db_b_parser2.sql | 8 +-- contrib/dolphin/sql/db_b_parser3.sql | 8 +-- contrib/dolphin/sql/db_b_parser4.sql | 8 +-- contrib/dolphin/sql/db_b_plpgsql_test.sql | 8 +-- contrib/dolphin/sql/default_guc.sql | 8 +-- contrib/dolphin/sql/describe.sql | 8 +-- contrib/dolphin/sql/dummy.sql | 1 + contrib/dolphin/sql/empty_value_list.sql | 8 +-- contrib/dolphin/sql/empty_value_lists.sql | 8 +-- .../dolphin/sql/empty_value_support_value.sql | 8 +-- .../sql/float_numeric_test/db_b_log_test.sql | 8 +-- .../sql/float_numeric_test/db_b_sqrt_test.sql | 8 +-- contrib/dolphin/sql/greatest_least.sql | 8 +-- contrib/dolphin/sql/join_without_on.sql | 8 +-- contrib/dolphin/sql/nvarchar.sql | 8 +-- contrib/dolphin/sql/regexp.sql | 8 +-- contrib/dolphin/sql/show.sql | 8 +-- .../sql/string_func_test/db_b_ascii_test.sql | 8 +-- .../string_func_test/db_b_left_right_test.sql | 8 +-- .../sql/string_func_test/db_b_quote_test.sql | 8 +-- .../db_b_string_length_test.sql | 8 +-- .../sql/string_func_test/db_b_substr_test.sql | 8 +-- .../sql/string_func_test/db_b_trim_test.sql | 8 +-- contrib/dolphin/sql/test_binary.sql | 8 +-- contrib/dolphin/sql/test_blob.sql | 8 +-- contrib/dolphin/sql/test_fixed.sql | 8 +-- contrib/dolphin/sql/test_mysql_enum.sql | 8 +-- 92 files changed, 520 insertions(+), 405 deletions(-) create mode 100644 contrib/dolphin/expected/dummy.out create mode 100644 contrib/dolphin/make_check_postgresql.conf create mode 100644 contrib/dolphin/parallel_schedule_dolphin create mode 100644 contrib/dolphin/regress.conf create mode 100644 contrib/dolphin/sql/dummy.sql diff --git a/contrib/dolphin/Makefile b/contrib/dolphin/Makefile index 1cc10a436..33c56baf5 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 bbeefc725..1e022f193 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 9c9aae730..fcbe10b15 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 660250acf..81c50a5e5 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 5fe6d38e5..01ff1cf18 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 be6527b2e..50e1a6902 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 fc1492257..782351325 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 bdb07c226..b44673211 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 8322a6b56..f8d942991 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 108d0567e..03a9383e6 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 0d5f0fa1a..94e00fdce 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 42493ea4f..766017171 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 7a200d28d..73924749b 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 17aefcb0d..5dd3d42e1 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 03e5d08d4..76884c950 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 446a82aab..a5fed3c32 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 e34f1b97b..8430d0309 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 073e6ebfa..d657801f7 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 70eb232ba..46ceaf124 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 b685fe983..e60e01d30 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 f0a56f3e5..d87ed1df8 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 fd3d81044..a8b28cfa0 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 020d31f35..b178a6eb3 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 184ae4e0e..4db8377d5 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 000000000..20d219a58 --- /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 b9cfd045b..d3ecddca1 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 f83f4b07e..98e2646a4 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 cdd80b8a3..e6433dea9 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 73aa73d92..dcccede5f 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 3bcf951b2..e027c38f3 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 c638d7ebd..799466e15 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 5f330b88c..0e69cd9c6 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 d35f02bd0..ee026d565 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 3502b7964..6824f001c 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 7ba629459..e108f45dd 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 cb96ef371..8902df3d7 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 bc4c9a427..f14bba904 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 d101f12f0..8f5674c5f 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 71f589da2..f385e34e0 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 5a6cc64bb..3a3c96dab 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 bc504e64d..88354f30a 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 31413efe1..4896028c6 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 12112fe89..1f6ecca39 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 f57c54f49..22f456ee2 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 f5f694309..1fb13cd2d 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 000000000..121c3f190 --- /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 000000000..2ebcda769 --- /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 000000000..f7920699b --- /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 ca26e1000..05b67ca39 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 84eb94763..e0bd65e0e 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 c1ea35084..874697a6a 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 7dc94adb8..06a1fcfbf 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 87c307261..e70fc6f62 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 023dfc4a1..2c07011e3 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 f0598c87b..7edbac123 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 6d5237b73..2c3afe01a 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 31d402353..42636b6b5 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 96304a53c..278b90afb 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 40cb41777..39e89d500 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 0fad42960..91830daa4 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 4048bd953..ea732d07a 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 40bde3c1b..e0afa8634 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 4f6196f65..7d14503c4 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 71ee63a3f..a5ea09043 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 a4331e58c..c5244c9fe 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 71b7a6970..7083ee595 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 98eceffa1..df3bebf34 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 f1d7981d1..e48a08c89 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 ca76e6290..209788734 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 9db07757c..1fa1aae46 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 25794f2b8..0801da4d0 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 000000000..9e13a3eff --- /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 1a37e92d0..59ffd2037 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 a371ba895..590b0116d 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 357b76bb9..79a61f7bc 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 eab5ff8da..73c11c31a 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 3f6b93888..a4b7101a8 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 2d213f942..f9633f1cc 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 8c6c72af2..9a00342a0 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 e30cd1dd8..4ce4a1e19 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 7e68b8dac..ee9895a8d 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 d6cbc2e4a..16444342e 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 bd0b74d4d..855ab5e54 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 199e3a00e..8c2c3f9f5 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 4dc3029c6..1228354d4 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 d55466757..78155f18d 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 91b7471fd..ea95bef62 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 6612ebb15..79bd07ee8 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 6e361d41b..376aaf5a9 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 2ca9dbda7..b781a5879 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 2911b7207..19d01842b 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 d343639b7..6db3cb136 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; -- Gitee