diff --git a/.github/composite-actions/minor-version-upgrade-util/action.yml b/.github/composite-actions/minor-version-upgrade-util/action.yml index 519ffa5a70..00a4d5e79d 100644 --- a/.github/composite-actions/minor-version-upgrade-util/action.yml +++ b/.github/composite-actions/minor-version-upgrade-util/action.yml @@ -81,7 +81,7 @@ runs: tar_dir: ${{ matrix.upgrade-path.last_version }} run: | cd test/JDBC/ - export isUpgradeTestMode=false + export isUpgradeTestMode=true if [[ ${{ inputs.server_collation_name }} != "default" ]]; then export serverCollationName=${{ inputs.server_collation_name }} fi diff --git a/.github/composite-actions/run-verify-tests/action.yml b/.github/composite-actions/run-verify-tests/action.yml index 0a058cd73f..e69434b201 100644 --- a/.github/composite-actions/run-verify-tests/action.yml +++ b/.github/composite-actions/run-verify-tests/action.yml @@ -41,7 +41,7 @@ runs: touch dummy_schedule echo "all" > dummy_schedule export scheduleFile=dummy_schedule - export isUpgradeTestMode=false + export isUpgradeTestMode=true if [[ ${{ inputs.server_collation_name }} != "default" ]]; then export serverCollationName=${{ inputs.server_collation_name }} fi diff --git a/.github/composite-actions/setup-base-version/action.yml b/.github/composite-actions/setup-base-version/action.yml index 66226e6a6b..628518778c 100644 --- a/.github/composite-actions/setup-base-version/action.yml +++ b/.github/composite-actions/setup-base-version/action.yml @@ -210,7 +210,7 @@ runs: exit 1 fi done - export isUpgradeTestMode=false + export isUpgradeTestMode=true export inputFilesPath=input for filename in $(grep -v "^ignore.*\|^#.*\|^cmd.*\|^all.*\|^$" upgrade/$base_dir/schedule); do sed -i "s/\b$filename[ ]*\b$/$filename-vu-prepare/g" upgrade/$base_dir/schedule diff --git a/test/JDBC/expected/BABEL-2955-vu-cleanup.out b/test/JDBC/expected/BABEL-2955-vu-cleanup.out index 3dc09466d1..b85aa3deae 100644 --- a/test/JDBC/expected/BABEL-2955-vu-cleanup.out +++ b/test/JDBC/expected/BABEL-2955-vu-cleanup.out @@ -12,11 +12,3 @@ go drop table babel_2955_vu_prepare_t2 go - -SELECT set_config('babelfishpg_tsql.escape_hatch_storage_options', 'ignore', 'false') -go -~~START~~ -text -ignore -~~END~~ - diff --git a/test/JDBC/expected/BABEL-2955-vu-prepare.out b/test/JDBC/expected/BABEL-2955-vu-prepare.out index 70285389b2..162c677a4b 100644 --- a/test/JDBC/expected/BABEL-2955-vu-prepare.out +++ b/test/JDBC/expected/BABEL-2955-vu-prepare.out @@ -52,3 +52,11 @@ insert into babel_2955_vu_prepare_t2 values (1) GO ~~ROW COUNT: 1~~ + +SELECT set_config('babelfishpg_tsql.escape_hatch_storage_options', 'ignore', 'false') +go +~~START~~ +text +ignore +~~END~~ + diff --git a/test/JDBC/expected/BABEL-3156.out b/test/JDBC/expected/BABEL-3156.out index 72d3604978..72f97f2f3d 100644 --- a/test/JDBC/expected/BABEL-3156.out +++ b/test/JDBC/expected/BABEL-3156.out @@ -127,15 +127,17 @@ int#!#varchar#!#int#!#nvarchar#!#smallint#!#tinyint#!#tinyint#!#int#!#varchar#!# ~~ERROR (Message: column "not_a_col" of relation "babel_3156" does not exist)~~ - exec sp_describe_undeclared_parameters N'UPDATE BABEL_3156 SET a=@P1 WHERE not_a_col=@P2'; -G -DROP TABLE BABEL_3156; GO +~~START~~ +int#!#varchar#!#int#!#nvarchar#!#smallint#!#tinyint#!#tinyint#!#int#!#varchar#!#varchar#!#varchar#!#nvarchar#!#int#!#varchar#!#varchar#!#varchar#!#bit#!#bit#!#bit#!#bit#!#bit#!#varchar#!#int#!#int ~~ERROR (Code: 33557097)~~ -~~ERROR (Message: syntax error near 'DROP' at line 4 and character position 0)~~ +~~ERROR (Message: column "not_a_col" of relation "babel_3156" does not exist)~~ + +DROP TABLE BABEL_3156; +GO DROP TABLE dbo.performancetable; GO diff --git a/test/JDBC/expected/BABEL-3291.out b/test/JDBC/expected/BABEL-3291.out index 78b57a7b42..270eb209f0 100644 --- a/test/JDBC/expected/BABEL-3291.out +++ b/test/JDBC/expected/BABEL-3291.out @@ -1,3 +1,4 @@ +-- tsql drop table if exists babel_3291_t1 go diff --git a/test/JDBC/expected/BABEL-3292.out b/test/JDBC/expected/BABEL-3292.out index fe6345d91a..2228699479 100644 --- a/test/JDBC/expected/BABEL-3292.out +++ b/test/JDBC/expected/BABEL-3292.out @@ -1,3 +1,4 @@ +-- tsql drop table if exists babel_3292_t1 go diff --git a/test/JDBC/expected/BABEL-3293.out b/test/JDBC/expected/BABEL-3293.out index 53856242a5..0c598ac752 100644 --- a/test/JDBC/expected/BABEL-3293.out +++ b/test/JDBC/expected/BABEL-3293.out @@ -1,3 +1,4 @@ +-- tsql drop table if exists babel_3293_t1 go diff --git a/test/JDBC/expected/BABEL-3294.out b/test/JDBC/expected/BABEL-3294.out index 9478a88a24..62895b7b55 100644 --- a/test/JDBC/expected/BABEL-3294.out +++ b/test/JDBC/expected/BABEL-3294.out @@ -1,3 +1,4 @@ +-- tsql drop table if exists babel_3294_t1 go diff --git a/test/JDBC/expected/BABEL-3295.out b/test/JDBC/expected/BABEL-3295.out index a841128e00..e2f1ccc5b5 100644 --- a/test/JDBC/expected/BABEL-3295.out +++ b/test/JDBC/expected/BABEL-3295.out @@ -1,3 +1,4 @@ +-- tsql drop table if exists babel_3295_t1 go diff --git a/test/JDBC/expected/BABEL-3512.out b/test/JDBC/expected/BABEL-3512.out index 8946001def..2aa19d49cb 100644 --- a/test/JDBC/expected/BABEL-3512.out +++ b/test/JDBC/expected/BABEL-3512.out @@ -1,3 +1,4 @@ +-- tsql /* * Test stored procs WITH hints. All tests examine the query plan AND the diff --git a/test/JDBC/expected/BABEL-3592.out b/test/JDBC/expected/BABEL-3592.out index 0058bc5980..d055db3812 100644 --- a/test/JDBC/expected/BABEL-3592.out +++ b/test/JDBC/expected/BABEL-3592.out @@ -1,3 +1,4 @@ +-- tsql drop procedure if exists babel_3592_insert_multiline go diff --git a/test/JDBC/expected/BABEL-4294-vu-verify.out b/test/JDBC/expected/BABEL-4294-vu-verify.out index 93f1481ad1..fac52b4c21 100644 --- a/test/JDBC/expected/BABEL-4294-vu-verify.out +++ b/test/JDBC/expected/BABEL-4294-vu-verify.out @@ -1,3 +1,4 @@ +-- tsql -- Test to check if initialisation of Parallel Worker crash when babelfishpg_tsql.enable_pg_hint is set /* diff --git a/test/JDBC/expected/babel_index_nulls_order-before-15-5-vu-verify.out b/test/JDBC/expected/babel_index_nulls_order-before-15-5-vu-verify.out index a1426a6279..5885bac640 100644 --- a/test/JDBC/expected/babel_index_nulls_order-before-15-5-vu-verify.out +++ b/test/JDBC/expected/babel_index_nulls_order-before-15-5-vu-verify.out @@ -1,3 +1,4 @@ +-- tsql -- Nulls check SELECT * FROM babel_index_nulls_order_before_15_5_a_v1 go diff --git a/test/JDBC/expected/babel_index_nulls_order-vu-verify.out b/test/JDBC/expected/babel_index_nulls_order-vu-verify.out index 09ed2f1c51..048f889185 100644 --- a/test/JDBC/expected/babel_index_nulls_order-vu-verify.out +++ b/test/JDBC/expected/babel_index_nulls_order-vu-verify.out @@ -1,3 +1,4 @@ +-- tsql -- Nulls check SELECT * FROM babel_index_nulls_order_a_v1 go diff --git a/test/JDBC/expected/linked_servers-vu-verify.out b/test/JDBC/expected/linked_servers-vu-verify.out index fb1aa78620..e4e91340d9 100644 --- a/test/JDBC/expected/linked_servers-vu-verify.out +++ b/test/JDBC/expected/linked_servers-vu-verify.out @@ -1,3 +1,4 @@ +-- tsql -- Check if the linked server added is reflected in the system view SELECT name, product, provider, data_source, provider_string, catalog, is_linked FROM sys.servers WHERE name NOT LIKE 'bbf_server%' AND name NOT LIKE 'server_4229%' ORDER BY name GO diff --git a/test/JDBC/expected/linked_srv_4229-vu-verify.out b/test/JDBC/expected/linked_srv_4229-vu-verify.out index 8a0ca1cb0e..4dcb779814 100644 --- a/test/JDBC/expected/linked_srv_4229-vu-verify.out +++ b/test/JDBC/expected/linked_srv_4229-vu-verify.out @@ -1,3 +1,4 @@ +-- tsql -- Call OPENQUERY() / four-part-object name from a database other than master USE tempdb CREATE TABLE t_tempdb_babel_4229 (a int) diff --git a/test/JDBC/expected/openquery-vu-verify.out b/test/JDBC/expected/openquery-vu-verify.out index c1574e87f2..b9dbd7823a 100644 --- a/test/JDBC/expected/openquery-vu-verify.out +++ b/test/JDBC/expected/openquery-vu-verify.out @@ -1,6 +1,5 @@ -# Here we run all the datatype related prepare scripts +-- tsql -# bigint CREATE TABLE testBIGINT_dt (a BIGINT) prepst#!# INSERT INTO testBIGINT_dt(a) values(?) #!#BIGINT|-|a|-|0 ~~ROW COUNT: 1~~ @@ -63,7 +62,6 @@ INSERT INTO testBIGINT_dt(a) values(NULL) ~~ROW COUNT: 1~~ -# numeric CREATE TABLE numeric_table1(num numeric(5, 2)); prepst#!#INSERT INTO numeric_table1(num) VALUES(?) #!#numeric|-|a|-|3|-|5|-|2 @@ -494,7 +492,6 @@ insert into testnumeric_vu_prepare_tab2 values (1879323.2222, 2383823.343, 4.548 ~~ROW COUNT: 1~~ -# bit CREATE TABLE testBIT_dt (a BIT) prepst#!# INSERT INTO testBIT_dt(a) values(?) #!#BIT|-|a|-|false ~~ROW COUNT: 1~~ @@ -521,7 +518,6 @@ INSERT INTO testBIT_dt(a) values(NULL) ~~ROW COUNT: 1~~ -# smallint CREATE TABLE SMALLINT_dt (a SMALLINT) prepst#!# INSERT INTO SMALLINT_dt(a) values(?) #!#SMALLINT|-|a|-|0 ~~ROW COUNT: 1~~ @@ -584,7 +580,6 @@ INSERT INTO SMALLINT_dt(a) values(NULL) ~~ROW COUNT: 1~~ -# decimal CREATE TABLE testdecimal_table1(num decimal(5, 2)); prepst#!#INSERT INTO testdecimal_table1(num) VALUES(?) #!#decimal|-|a|-|3|-|5|-|2 @@ -1003,7 +998,6 @@ insert into testdecimal_vu_prepare_tab2 values (1879323.2222, 2383823.343, 4.548 ~~ROW COUNT: 1~~ -# smallmoney CREATE TABLE smallmoney_dt(a smallmoney); prepst#!#INSERT INTO smallmoney_dt(a) VALUES (?) #!#smallmoney|-|a|-|100.5 @@ -1070,7 +1064,6 @@ INSERT INTO smallmoney_dt(a) values(NULL); ~~ROW COUNT: 1~~ -# int CREATE TABLE INT_dt(a INT); prepst#!#INSERT INTO INT_dt(a) values(?) #!#INT|-|a|-|0 ~~ROW COUNT: 1~~ @@ -1136,7 +1129,6 @@ INSERT INTO INT_dt(a) values(NULL) ~~ROW COUNT: 1~~ -# tinyint CREATE TABLE TINYINT_dt (a TINYINT) prepst#!# INSERT INTO TINYINT_dt(a) values(?) #!#TINYINT|-|a|-|0 ~~ROW COUNT: 1~~ @@ -1203,7 +1195,6 @@ INSERT INTO TINYINT_dt(a) values(NULL) ~~ROW COUNT: 1~~ -# money CREATE TABLE money_dt(a money); prepst#!#INSERT INTO money_dt(a) VALUES (?) #!#money|-|a|-|10.05 @@ -1264,7 +1255,6 @@ INSERT INTO money_dt(a) values(NULL); ~~ROW COUNT: 1~~ -# float CREATE TABLE FLOAT_dt (a FLOAT) prepst#!# INSERT INTO FLOAT_dt(a) values(?) #!#FLOAT|-|a|-|0 ~~ROW COUNT: 1~~ @@ -1327,7 +1317,6 @@ INSERT INTO FLOAT_dt(a) values(NULL) ~~ROW COUNT: 1~~ -# real CREATE TABLE REAL_dt (a REAL) prepst#!# INSERT INTO REAL_dt(a) values(?) #!#REAL|-|a|-|0 ~~ROW COUNT: 1~~ @@ -1390,7 +1379,6 @@ INSERT INTO REAL_dt(a) values(NULL) ~~ROW COUNT: 1~~ -# date CREATE TABLE DATE_dt (a DATE) prepst#!# INSERT INTO DATE_dt(a) values(?) #!#DATE|-|a|-|2000-12-13 ~~ROW COUNT: 1~~ @@ -1423,7 +1411,6 @@ INSERT INTO DATE_dt(a) values(NULL) ~~ROW COUNT: 1~~ -# datetimeoffset -- Testing inserting into the table create table TestDatetimeoffset_vu_prepare_testing (df datetimeoffset); go @@ -1498,7 +1485,6 @@ BEGIN END; go -# datetime2 Create table TestDatetime2_vu_prepare_t(a Datetime2(6)) prepst#!# Insert into TestDatetime2_vu_prepare_t Values(?) #!#Datetime2|-|a|-|2016-10-23 12:45:37.123|-|0 @@ -1527,7 +1513,6 @@ prepst#!#exec#!#Datetime2|-|a|-| ~~ROW COUNT: 1~~ -# smalldatetime CREATE TABLE SMALLDATETIME_dt (a SMALLDATETIME) prepst#!# INSERT INTO SMALLDATETIME_dt(a) values(?) #!#SMALLDATETIME|-|a|-|2000-12-13 12:58:23 ~~ROW COUNT: 1~~ @@ -1622,7 +1607,6 @@ INSERT INTO SMALLDATETIME_dt(a) values(NULL); ~~ROW COUNT: 1~~ -# datetime CREATE TABLE TestDatetime_vu_prepare_dt (a DATETIME) prepst#!# INSERT INTO TestDatetime_vu_prepare_dt(a) values(?) #!#DATETIME|-|a|-|2000-12-13 12:58:23.123 ~~ROW COUNT: 1~~ @@ -1721,7 +1705,6 @@ INSERT INTO TestDatetime_vu_prepare_dt(a) values(NULL) ~~ROW COUNT: 1~~ -# time Create table TestTime1(a1 time(6)) prepst#!# Insert into TestTime1 Values(?) #!#Time|-|a1|-|12:45:37.123|-|0 @@ -1911,7 +1894,6 @@ prepst#!#exec#!#Time|-|a7|-| ~~ROW COUNT: 1~~ -# char and nchar CREATE TABLE testCHAR_dt (a CHAR(24), b NCHAR(24)) prepst#!# INSERT INTO testCHAR_dt(a, b) values(?, ?) #!#CHAR|-|a|-|Dipesh#!#NCHAR|-|b|-|Dhameliya ~~ROW COUNT: 1~~ @@ -1946,7 +1928,6 @@ INSERT INTO testCHAR_dt(a,b) values(NULL,NULL) ~~ROW COUNT: 1~~ -# varchar and nvarchar CREATE TABLE VARCHAR_dt1 (a VARCHAR(20), b NVARCHAR(24)) prepst#!# INSERT INTO VARCHAR_dt1(a, b) values(?, ?) #!#VARCHAR|-|a|-|Dipesh#!#NVARCHAR|-|b|-|Dhameliya ~~ROW COUNT: 1~~ @@ -2043,7 +2024,6 @@ insert into VARCHAR_dt4 (a,b,c,d,e,f,g,h,i) values (NULL,1,2,3,4,5,6,7,8); ~~ROW COUNT: 1~~ -# text and ntext CREATE TABLE TEXT_dt (a text, b ntext) #path to file should be with respect to root of test suite prepst#!# INSERT INTO TEXT_dt(a, b) values(?, ?) #!#TEXT|-|a|-|utils/sample.txt#!#NTEXT|-|b|-|utils/sample.txt @@ -2065,7 +2045,6 @@ prepst#!#exec#!#TEXT|-|a|-|#!#NTEXT|-|b|-|utils/devanagari.txt ~~ROW COUNT: 1~~ -# binary and varbinary CREATE TABLE testBINARY_dt1(a BINARY(8), b VARBINARY(10)); #inserting random values INSERT INTO testBINARY_dt1(a, b) values (1234, 12345); @@ -2100,7 +2079,6 @@ prepst#!#exec#!#binary|-|a|-|1234#!#varbinary|-|b|-|123456789 ~~ROW COUNT: 1~~ -# image CREATE TABLE IMAGE_dt1(a IMAGE); #inserting random values INSERT INTO IMAGE_dt1(a) values (1234); @@ -2149,7 +2127,6 @@ prepst#!#exec#!#image|-|a|-|utils/flower.jpg ~~ROW COUNT: 1~~ -# user defined data types CREATE TYPE udd_varchar from varchar(15); CREATE TYPE udd_nvarchar from nvarchar(15); CREATE TYPE udd_int from int; @@ -2260,7 +2237,6 @@ prepst#!#INSERT INTO udd_dt2(a, b, c, e, f, g) VALUES (?, ?, ?, ?, ?, ?)#!#varch ~~ROW COUNT: 1~~ -# uniqueidentifier CREATE TABLE uniqueidentifier_dt (a uniqueidentifier); INSERT INTO uniqueidentifier_dt VALUES ('51f178a6-53c7-472c-9be1-1c08942342d7') @@ -2339,8 +2315,34 @@ prepst#!#exec#!#uniqueidentifier|-|a|-|767392df-87d0-450d-9b24-85a86c02811dthisI ~~ROW COUNT: 1~~ -# Run SELECTs but using OPENQUERY now +-- Here we run all the datatype related prepare scripts +-- bigint +-- numeric +-- bit +-- smallint +-- decimal +-- smallmoney +-- int +-- tinyint +-- money +-- float +-- real +-- date +-- datetimeoffset +-- datetime2 +-- smalldatetime +-- datetime +-- time +-- char and nchar +-- varchar and nvarchar +-- text and ntext +-- binary and varbinary +-- image +-- user defined data types +-- uniqueidentifier +-- Run SELECTs but using OPENQUERY now SELECT * FROM OPENQUERY(bbf_server, 'SELECT * FROM testBIGINT_dt'); +GO ~~START~~ bigint 0 @@ -2367,6 +2369,7 @@ bigint SELECT * FROM OPENQUERY(bbf_server, 'SELECT * FROM numeric_table1'); +GO ~~START~~ numeric 3.00 @@ -2382,7 +2385,9 @@ numeric -123.00 ~~END~~ + SELECT * FROM OPENQUERY(bbf_server, 'SELECT * FROM numeric_table2'); +GO ~~START~~ numeric 3.000 @@ -2404,7 +2409,9 @@ numeric -2147483648.000 ~~END~~ + SELECT * FROM OPENQUERY(bbf_server, 'SELECT * FROM numeric_table3'); +GO ~~START~~ numeric 3.00000000000000000000 @@ -2421,7 +2428,9 @@ numeric 2147483647.00000000000000000000 ~~END~~ + SELECT * FROM OPENQUERY(bbf_server, 'SELECT * FROM numeric_table4'); +GO ~~START~~ numeric 3.00000000000000000000 @@ -2438,7 +2447,9 @@ numeric 2147483647.00000000000000000000 ~~END~~ + SELECT * FROM OPENQUERY(bbf_server, 'SELECT * FROM numeric_table5'); +GO ~~START~~ numeric 3.000000000000000000000 @@ -2455,7 +2466,9 @@ numeric 2147483647.000000000000000000000 ~~END~~ + SELECT * FROM OPENQUERY(bbf_server, 'SELECT * FROM numeric_table6'); +GO ~~START~~ numeric 3.0000000000000000000000 @@ -2472,7 +2485,9 @@ numeric 2147483647.0000000000000000000000 ~~END~~ + SELECT * FROM OPENQUERY(bbf_server, 'SELECT * FROM numeric_table7'); +GO ~~START~~ numeric 3.00000000000000000000000 @@ -2489,7 +2504,9 @@ numeric 2147483647.00000000000000000000000 ~~END~~ + SELECT * FROM OPENQUERY(bbf_server, 'SELECT * FROM numeric_table8'); +GO ~~START~~ numeric 3.0000000000000000000000000 @@ -2507,7 +2524,9 @@ numeric -247483647.0000000000000000000000000 ~~END~~ + SELECT * FROM OPENQUERY(bbf_server, 'SELECT * FROM numeric_table9'); +GO ~~START~~ numeric 2147483647.0000000000000000000000000 @@ -2523,6 +2542,7 @@ numeric SELECT * FROM OPENQUERY(bbf_server, 'SELECT * FROM testBIT_dt'); +GO ~~START~~ bit 0 @@ -2535,6 +2555,7 @@ bit SELECT * FROM OPENQUERY(bbf_server, 'SELECT * FROM SMALLINT_dt'); +GO ~~START~~ smallint 0 @@ -2561,6 +2582,7 @@ smallint SELECT * FROM OPENQUERY(bbf_server, 'SELECT * FROM testdecimal_table1'); +GO ~~START~~ numeric 3.00 @@ -2576,7 +2598,9 @@ numeric -123.00 ~~END~~ + SELECT * FROM OPENQUERY(bbf_server, 'SELECT * FROM testdecimal_table2'); +GO ~~START~~ numeric 3.000 @@ -2598,7 +2622,9 @@ numeric -2147483648.000 ~~END~~ + SELECT * FROM OPENQUERY(bbf_server, 'SELECT * FROM testdecimal_table3'); +GO ~~START~~ numeric 3.00000000000000000000 @@ -2615,7 +2641,9 @@ numeric 2147483647.00000000000000000000 ~~END~~ + SELECT * FROM OPENQUERY(bbf_server, 'SELECT * FROM testdecimal_table4'); +GO ~~START~~ numeric 3.00000000000000000000 @@ -2632,7 +2660,9 @@ numeric 2147483647.00000000000000000000 ~~END~~ + SELECT * FROM OPENQUERY(bbf_server, 'SELECT * FROM testdecimal_table5'); +GO ~~START~~ numeric 3.000000000000000000000 @@ -2649,7 +2679,9 @@ numeric 2147483647.000000000000000000000 ~~END~~ + SELECT * FROM OPENQUERY(bbf_server, 'SELECT * FROM testdecimal_table6'); +GO ~~START~~ numeric 3.0000000000000000000000 @@ -2666,7 +2698,9 @@ numeric 2147483647.0000000000000000000000 ~~END~~ + SELECT * FROM OPENQUERY(bbf_server, 'SELECT * FROM testdecimal_table7'); +GO ~~START~~ numeric 3.00000000000000000000000 @@ -2683,7 +2717,9 @@ numeric 2147483647.00000000000000000000000 ~~END~~ + SELECT * FROM OPENQUERY(bbf_server, 'SELECT * FROM testdecimal_table8'); +GO ~~START~~ numeric 3.0000000000000000000000000 @@ -2701,7 +2737,9 @@ numeric -247483647.0000000000000000000000000 ~~END~~ + SELECT * FROM OPENQUERY(bbf_server, 'SELECT * FROM testdecimal_table9'); +GO ~~START~~ numeric 2147483647.0000000000000000000000000 @@ -2717,6 +2755,7 @@ numeric SELECT * FROM OPENQUERY(bbf_server, 'SELECT * FROM smallmoney_dt'); +GO ~~START~~ smallmoney 100.5000 @@ -2744,6 +2783,7 @@ smallmoney SELECT * FROM OPENQUERY(bbf_server, 'SELECT * FROM INT_dt'); +GO ~~START~~ int 0 @@ -2771,6 +2811,7 @@ int SELECT * FROM OPENQUERY(bbf_server, 'SELECT * FROM TINYINT_dt'); +GO ~~START~~ tinyint 0 @@ -2795,6 +2836,7 @@ tinyint SELECT * FROM OPENQUERY(bbf_server, 'SELECT * FROM money_dt'); +GO ~~START~~ money 10.0500 @@ -2820,6 +2862,7 @@ money SELECT * FROM OPENQUERY(bbf_server, 'SELECT * FROM FLOAT_dt'); +GO ~~START~~ float 0.0 @@ -2846,6 +2889,7 @@ float SELECT * FROM OPENQUERY(bbf_server, 'SELECT * FROM REAL_dt'); +GO ~~START~~ real 0.0 @@ -2872,6 +2916,7 @@ real SELECT * FROM OPENQUERY(bbf_server, 'SELECT * FROM DATE_dt'); +GO ~~START~~ date 2000-12-13 @@ -2888,6 +2933,7 @@ date SELECT * FROM OPENQUERY(bbf_server, 'SELECT * from TestDatetimeoffset_vu_prepare_testing'); +GO ~~START~~ datetimeoffset 1900-01-01 23:40:29.998000 +00:00 @@ -2902,6 +2948,7 @@ datetimeoffset SELECT * FROM OPENQUERY(bbf_server, 'SELECT * from TestDatetime2_vu_prepare_t'); +GO ~~START~~ datetime2 2016-10-23 12:45:37.123000 @@ -2916,6 +2963,7 @@ datetime2 SELECT * FROM OPENQUERY(bbf_server, 'SELECT * FROM SMALLDATETIME_dt'); +GO ~~START~~ smalldatetime 2000-12-13 12:58:00.0 @@ -2952,6 +3000,7 @@ smalldatetime SELECT * FROM OPENQUERY(bbf_server, 'SELECT * FROM TestDatetime_vu_prepare_dt'); +GO ~~START~~ datetime 2000-12-13 12:58:23.123 @@ -2990,6 +3039,7 @@ datetime SELECT * FROM OPENQUERY(bbf_server, 'SELECT * from TestTime1'); +GO ~~START~~ time 12:45:37.000000 @@ -3003,6 +3053,7 @@ time ~~END~~ SELECT * FROM OPENQUERY(bbf_server, 'SELECT * from TestTime2'); +GO ~~START~~ time 12:45:37.00000 @@ -3016,6 +3067,7 @@ time ~~END~~ SELECT * FROM OPENQUERY(bbf_server, 'SELECT * from TestTime3'); +GO ~~START~~ time 12:45:37.0000 @@ -3029,6 +3081,7 @@ time ~~END~~ SELECT * FROM OPENQUERY(bbf_server, 'SELECT * from TestTime4'); +GO ~~START~~ time 12:45:37.000 @@ -3042,6 +3095,7 @@ time ~~END~~ SELECT * FROM OPENQUERY(bbf_server, 'SELECT * from TestTime5'); +GO ~~START~~ time 12:45:37.00 @@ -3055,6 +3109,7 @@ time ~~END~~ SELECT * FROM OPENQUERY(bbf_server, 'SELECT * from TestTime6'); +GO ~~START~~ time 12:45:37.0 @@ -3068,6 +3123,7 @@ time ~~END~~ SELECT * FROM OPENQUERY(bbf_server, 'SELECT * from TestTime7'); +GO ~~START~~ time 12:45:37 @@ -3082,6 +3138,7 @@ time SELECT * FROM OPENQUERY(bbf_server, 'SELECT * FROM testBINARY_dt1'); +GO ~~START~~ binary#!#varbinary 00000000000004D2#!#00003039 @@ -3089,18 +3146,21 @@ binary#!#varbinary ~~END~~ SELECT * FROM OPENQUERY(bbf_server, 'SELECT * FROM testBINARY_dt2'); +GO ~~START~~ varbinary ~~END~~ SELECT * FROM OPENQUERY(bbf_server, 'SELECT * FROM testBINARY_dt3'); +GO ~~START~~ varbinary#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int #!#1#!#2#!#3#!#4#!#5#!#6#!#7#!#8 ~~END~~ SELECT * FROM OPENQUERY(bbf_server, 'SELECT * FROM testBINARY_dt4'); +GO ~~START~~ binary#!#varbinary 00000000000004D2#!#00003039 @@ -3111,6 +3171,7 @@ binary#!#varbinary SELECT * FROM OPENQUERY(bbf_server, 'SELECT * FROM IMAGE_dt1'); +GO ~~START~~ image 000004D2 @@ -3123,12 +3184,14 @@ FFFFFFFF ~~END~~ SELECT * FROM OPENQUERY(bbf_server, 'SELECT * FROM IMAGE_dt2'); +GO ~~START~~ image#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int #!#1#!#2#!#3#!#4#!#5#!#6#!#7#!#8 ~~END~~ SELECT * FROM OPENQUERY(bbf_server, 'SELECT * FROM IMAGE_dt3'); +GO ~~START~~ image 00003039 @@ -3139,6 +3202,7 @@ FFD8FFE000104A46494600010200000100010000FFDB004300080606070605080707070909080A0C SELECT * FROM OPENQUERY(bbf_server, 'SELECT * FROM testCHAR_dt'); +GO ~~START~~ char#!#nchar Dipesh #!#Dhameliya @@ -3155,6 +3219,7 @@ Dipesh #!#Dhameliya SELECT * FROM OPENQUERY(bbf_server, 'SELECT * FROM VARCHAR_dt1'); +GO ~~START~~ varchar#!#nvarchar Dipesh#!#Dhameliya @@ -3178,6 +3243,7 @@ abcdefghijklmnopqrst#!#abcdefghijklmnopqrstuvwx ~~END~~ SELECT * FROM OPENQUERY(bbf_server, 'SELECT * FROM VARCHAR_dt2'); +GO ~~START~~ varchar#!#nvarchar hello#!#hello😃 @@ -3189,12 +3255,14 @@ hello#!#hello😃 ~~END~~ SELECT * FROM OPENQUERY(bbf_server, 'SELECT * FROM VARCHAR_dt3'); +GO ~~START~~ varchar#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int #!#1#!#2#!#3#!#4#!#5#!#6#!#7#!#8 ~~END~~ SELECT * FROM OPENQUERY(bbf_server, 'SELECT * FROM VARCHAR_dt4'); +GO ~~START~~ varchar#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int #!#1#!#2#!#3#!#4#!#5#!#6#!#7#!#8 @@ -3202,6 +3270,7 @@ varchar#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int SELECT * FROM OPENQUERY(bbf_server, 'SELECT * FROM TEXT_dt'); +GO ~~START~~ text#!#ntext AAAAAAAAAAAAAAAAAAAABBBBBBBBBBCCCCCbadksjvbajsdcbvjadssejvhsdbfjhcgvasdhgcvsj21639812365091264#!#AAAAAAAAAAAAAAAAAAAABBBBBBBBBBCCCCCbadksjvbajsdcbvjadssejvhsdbfjhcgvasdhgcvsj21639812365091264 @@ -3214,6 +3283,7 @@ AAAAAAAAAAAAAAAAAAAABBBBBBBBBBCCCCCbadksjvbajsdcbvjad SELECT * FROM OPENQUERY(bbf_server, 'SELECT * FROM udd_dt1'); +GO ~~START~~ varchar#!#nvarchar#!#int#!#char#!#nchar#!#datetime#!#numeric Apple#!#red#!#1#!#Delhi #!#Sad😞 #!#2000-12-13 12:58:23.123#!#123.1 @@ -3221,6 +3291,7 @@ Orange#!##!#3#!#Whoops! #!#Happy😀 #!#1900- ~~END~~ SELECT * FROM OPENQUERY(bbf_server, 'SELECT * FROM udd_dt2'); +GO ~~START~~ varchar#!#nvarchar#!#int#!#char#!#nchar#!#datetime#!#numeric Apple#!#red#!#1#!#Delhi #!#Sad😞 #!#2000-12-13 12:58:23.123#!#123.1 @@ -3229,6 +3300,7 @@ Orange#!##!#5#!#Whoops! #!#Happy😀 #!#1900- SELECT * FROM OPENQUERY(bbf_server, 'SELECT * FROM uniqueidentifier_dt'); +GO ~~START~~ uniqueidentifier 51F178A6-53C7-472C-9BE1-1C08942342D7 @@ -3258,11 +3330,8 @@ CE8AF10A-2709-43B0-9E4E-A02753929D17 ~~END~~ -# Drop all tables -# bigint DROP TABLE testBIGINT_dt; -# numeric DROP TABLE numeric_table1; DROP TABLE numeric_table2; @@ -3303,13 +3372,10 @@ drop table testnumeric_vu_prepare_tab1; drop table testnumeric_vu_prepare_tab2; -# bit DROP TABLE testBIT_dt; -# smallint DROP TABLE SMALLINT_dt; -# decimal DROP TABLE testdecimal_table1; DROP TABLE testdecimal_table2; @@ -3347,28 +3413,20 @@ drop table testdecimal_vu_prepare_tab1; drop table testdecimal_vu_prepare_tab2; -# smallmoney DROP TABLE smallmoney_dt; -# int DROP TABLE INT_dt; -# tinyint DROP TABLE TINYINT_dt; -# money DROP TABLE money_dt; -# float DROP TABLE FLOAT_dt; -# real DROP TABLE REAL_dt; -# date DROP TABLE DATE_dt; -# datetimeoffset -- Clean up drop table TestDatetimeoffset_vu_prepare_testing; go @@ -3379,16 +3437,12 @@ go drop procedure TestDatetimeoffset_vu_prepare_cmp; go -# datetime2 Drop table TestDatetime2_vu_prepare_t -# smalldatetime DROP TABLE SMALLDATETIME_dt; -# datetime DROP TABLE TestDatetime_vu_prepare_dt; -# time Drop table TestTime1 Drop table TestTime2 Drop table TestTime3 @@ -3397,30 +3451,24 @@ Drop table TestTime5 Drop table TestTime6 Drop table TestTime7 -# char and nchar DROP TABLE testCHAR_dt; -# varchar and nvarchar DROP TABLE VARCHAR_dt1; DROP TABLE VARCHAR_dt2; DROP TABLE VARCHAR_dt3; DROP TABLE VARCHAR_dt4; -# text and ntext DROP TABLE TEXT_dt; -# binary and varbinary DROP TABLE testBINARY_dt1 DROP TABLE testBINARY_dt2 DROP TABLE testBINARY_dt3 DROP TABLE testBINARY_dt4 -# image DROP TABLE IMAGE_dt1 DROP TABLE IMAGE_dt2 DROP TABLE IMAGE_dt3 -# user defined data types DROP TABLE udd_dt1; DROP TABLE udd_dt2; @@ -3433,11 +3481,36 @@ DROP TYPE udd_nchar DROP TYPE udd_datetime DROP TYPE udd_numeric -# uniqueidentifier DROP TABLE uniqueidentifier_dt; -# Test OPENQUERY error handling +-- Drop all tables +-- bigint +-- numeric +-- bit +-- smallint +-- decimal +-- smallmoney +-- int +-- tinyint +-- money +-- float +-- real +-- date +-- datetimeoffset +-- datetime2 +-- smalldatetime +-- datetime +-- time +-- char and nchar +-- varchar and nvarchar +-- text and ntext +-- binary and varbinary +-- image +-- user defined data types +-- uniqueidentifier +-- Test OPENQUERY error handling SELECT * FROM OPENQUERY(bbf_server, 'select 1/0 as a') +GO ~~START~~ int ~~ERROR (Code: 33557097)~~ @@ -3445,63 +3518,71 @@ int ~~ERROR (Message: TDS client library error: Msg #: 8134, Msg state: 1, Msg: division by zero, Server: BABELFISH, Process: , Line: 1, Level: 16)~~ -# Try executing a query that does not return a result set +-- Try executing a query that does not return a result set SELECT * FROM OPENQUERY(bbf_server, 'INSERT INTO just_a_table_which_does_not_exist VALUES (1)') +GO ~~ERROR (Code: 33557097)~~ ~~ERROR (Message: Query passed to OPENQUERY did not return a result set)~~ -# try executing query where column alias does not exist +-- try executing query where column alias does not exist SELECT * FROM OPENQUERY(bbf_server, 'select 1') +GO ~~START~~ int 1 ~~END~~ -# execute query that returns 2 result sets. We should only return the first +-- execute query that returns 2 result sets. We should only return the first SELECT * FROM OPENQUERY(bbf_server, 'select 123; select 456') +GO ~~START~~ int 123 ~~END~~ -# Test view dependent on OPENQUERY +-- Test view dependent on OPENQUERY SELECT * FROM openquery_vu_prepare__openquery_view +GO ~~START~~ int 1 ~~END~~ -# Test OPENQUERY with an unreachable server +-- Test OPENQUERY with an unreachable server SELECT * FROM OPENQUERY(bbf_server_unreachable, 'select 1') +GO ~~ERROR (Code: 33557097)~~ ~~ERROR (Message: TDS client library error: DB #: 20012, DB Msg: server name not found in configuration files, OS #: 0, OS Msg: Success, Level: 2)~~ -#Test OPENQUERY where argument has quotes +-- Test OPENQUERY where argument has quotes SELECT * FROM OPENQUERY(bbf_server, 'SELECT ''Query having both ''''single'''' and "double" quotes''') +GO ~~START~~ varchar Query having both 'single' and "double" quotes ~~END~~ -# Test query timeout behaviour in OPENQUERY -# check the value of query timeout from sys.servers +-- Test query timeout behaviour in OPENQUERY +-- check the value of query timeout from sys.servers select name, query_timeout from sys.servers where name = 'bbf_server_1' +GO ~~START~~ varchar#!#int bbf_server_1#!#1 ~~END~~ -# execute a query which takes more time than the timeout set +-- execute a query which takes more time than the timeout set SELECT * FROM OPENQUERY(bbf_server_1, 'select CAST(pg_sleep(5) AS text)') +GO ~~START~~ text ~~ERROR (Code: 33557097)~~ @@ -3509,32 +3590,36 @@ text ~~ERROR (Message: TDS client library error: DB #: 20003, DB Msg: server connection timed out, OS #: 0, OS Msg: Success, Level: 6)~~ -# Test connect timeout behaviour in OPENQUERY -# check the value of connect timeout from sys.servers +-- Test connect timeout behaviour in OPENQUERY +-- check the value of connect timeout from sys.servers select name, connect_timeout from sys.servers where name = 'bbf_server_2' +GO ~~START~~ varchar#!#int bbf_server_2#!#1 ~~END~~ -# Make openquery against a non-existing server +-- Make openquery against a non-existing server SELECT * FROM OPENQUERY(bbf_server_2, 'select 1') +GO ~~ERROR (Code: 33557097)~~ ~~ERROR (Message: TDS client library error: DB #: 20009, DB Msg: Unable to connect: server is unavailable or does not exist (1.2.3.4), OS #: 110, OS Msg: Connection timed out, Level: 9)~~ -# Test procedure dependent on OPENQUERY +-- Test procedure dependent on OPENQUERY EXEC openquery_vu_prepare__openquery_proc +GO ~~START~~ int 2 ~~END~~ -# Test function dependent on OPENQUERY +-- Test function dependent on OPENQUERY SELECT openquery_vu_prepare__openquery_func() +GO ~~START~~ int 1 diff --git a/test/JDBC/expected/parallel_query/BABEL-3291.out b/test/JDBC/expected/parallel_query/BABEL-3291.out index 6c14f140b3..cf7d32d959 100644 --- a/test/JDBC/expected/parallel_query/BABEL-3291.out +++ b/test/JDBC/expected/parallel_query/BABEL-3291.out @@ -1,3 +1,4 @@ +-- tsql drop table if exists babel_3291_t1 go diff --git a/test/JDBC/expected/parallel_query/BABEL-3292.out b/test/JDBC/expected/parallel_query/BABEL-3292.out index 95cb1a2365..2848b5e0ef 100644 --- a/test/JDBC/expected/parallel_query/BABEL-3292.out +++ b/test/JDBC/expected/parallel_query/BABEL-3292.out @@ -1,3 +1,4 @@ +-- tsql drop table if exists babel_3292_t1 go diff --git a/test/JDBC/expected/parallel_query/BABEL-3293.out b/test/JDBC/expected/parallel_query/BABEL-3293.out index 11aa4e226f..a9e8ecd0c3 100644 --- a/test/JDBC/expected/parallel_query/BABEL-3293.out +++ b/test/JDBC/expected/parallel_query/BABEL-3293.out @@ -1,3 +1,4 @@ +-- tsql drop table if exists babel_3293_t1 go diff --git a/test/JDBC/expected/parallel_query/BABEL-3294.out b/test/JDBC/expected/parallel_query/BABEL-3294.out index 217c9e0d54..c29f1ff2d2 100644 --- a/test/JDBC/expected/parallel_query/BABEL-3294.out +++ b/test/JDBC/expected/parallel_query/BABEL-3294.out @@ -1,3 +1,4 @@ +-- tsql drop table if exists babel_3294_t1 go diff --git a/test/JDBC/expected/parallel_query/BABEL-3295.out b/test/JDBC/expected/parallel_query/BABEL-3295.out index 425668edb6..69aa35e6b3 100644 --- a/test/JDBC/expected/parallel_query/BABEL-3295.out +++ b/test/JDBC/expected/parallel_query/BABEL-3295.out @@ -1,3 +1,4 @@ +-- tsql drop table if exists babel_3295_t1 go diff --git a/test/JDBC/expected/parallel_query/BABEL-3512.out b/test/JDBC/expected/parallel_query/BABEL-3512.out index 94951520bc..a4fb9118ac 100644 --- a/test/JDBC/expected/parallel_query/BABEL-3512.out +++ b/test/JDBC/expected/parallel_query/BABEL-3512.out @@ -1,3 +1,4 @@ +-- tsql /* * Test stored procs WITH hints. All tests examine the query plan AND the diff --git a/test/JDBC/expected/parallel_query/BABEL-3592.out b/test/JDBC/expected/parallel_query/BABEL-3592.out index d9dbc23eea..463855e226 100644 --- a/test/JDBC/expected/parallel_query/BABEL-3592.out +++ b/test/JDBC/expected/parallel_query/BABEL-3592.out @@ -1,3 +1,4 @@ +-- tsql drop procedure if exists babel_3592_insert_multiline go diff --git a/test/JDBC/expected/parallel_query/BABEL-4294-vu-verify.out b/test/JDBC/expected/parallel_query/BABEL-4294-vu-verify.out index 3a24f08536..bcc11a0633 100644 --- a/test/JDBC/expected/parallel_query/BABEL-4294-vu-verify.out +++ b/test/JDBC/expected/parallel_query/BABEL-4294-vu-verify.out @@ -1,3 +1,4 @@ +-- tsql -- Test to check if initialisation of Parallel Worker crash when babelfishpg_tsql.enable_pg_hint is set /* diff --git a/test/JDBC/expected/parallel_query/babel_index_nulls_order-vu-verify.out b/test/JDBC/expected/parallel_query/babel_index_nulls_order-vu-verify.out index d7d720c467..529a1d5deb 100644 --- a/test/JDBC/expected/parallel_query/babel_index_nulls_order-vu-verify.out +++ b/test/JDBC/expected/parallel_query/babel_index_nulls_order-vu-verify.out @@ -1,3 +1,4 @@ +-- tsql -- Nulls check SELECT * FROM babel_index_nulls_order_a_v1 go diff --git a/test/JDBC/expected/securityadmin_role-vu-verify.out b/test/JDBC/expected/securityadmin_role-vu-verify.out index 97c6c10cc1..d63537a48c 100644 --- a/test/JDBC/expected/securityadmin_role-vu-verify.out +++ b/test/JDBC/expected/securityadmin_role-vu-verify.out @@ -411,6 +411,7 @@ int -- terminate-tsql-conn user=securityadmin_login1 password=123 -- psql +SET client_min_messages = 'error'; CREATE EXTENSION IF NOT EXISTS tds_fdw; GO diff --git a/test/JDBC/input/BABEL-2955-vu-cleanup.sql b/test/JDBC/input/BABEL-2955-vu-cleanup.sql index e207d24703..b85aa3deae 100644 --- a/test/JDBC/input/BABEL-2955-vu-cleanup.sql +++ b/test/JDBC/input/BABEL-2955-vu-cleanup.sql @@ -12,6 +12,3 @@ go drop table babel_2955_vu_prepare_t2 go - -SELECT set_config('babelfishpg_tsql.escape_hatch_storage_options', 'ignore', 'false') -go diff --git a/test/JDBC/input/BABEL-2955-vu-prepare.sql b/test/JDBC/input/BABEL-2955-vu-prepare.sql index 18dc92f1a8..22b0d4caac 100644 --- a/test/JDBC/input/BABEL-2955-vu-prepare.sql +++ b/test/JDBC/input/BABEL-2955-vu-prepare.sql @@ -31,3 +31,6 @@ go insert into babel_2955_vu_prepare_t2 values (1) GO + +SELECT set_config('babelfishpg_tsql.escape_hatch_storage_options', 'ignore', 'false') +go diff --git a/test/JDBC/input/BABEL-3156.sql b/test/JDBC/input/BABEL-3156.sql index 70cf1689c5..3881a0838a 100644 --- a/test/JDBC/input/BABEL-3156.sql +++ b/test/JDBC/input/BABEL-3156.sql @@ -56,7 +56,7 @@ GO exec sp_describe_undeclared_parameters N'UPDATE BABEL_3156 SET a=@P1 WHERE not_a_col=@P2'; -G +GO DROP TABLE BABEL_3156; GO diff --git a/test/JDBC/input/database_metadata.txt b/test/JDBC/input/database_metadata.txt index fb6a35c93a..cde2aff80b 100644 --- a/test/JDBC/input/database_metadata.txt +++ b/test/JDBC/input/database_metadata.txt @@ -1,5 +1,5 @@ -- sla 120000 --- sla_for_parallel_query_enforced 200000 +-- sla_for_parallel_query_enforced 350000 create table dbmeta_tab1(col1 int primary key, col2 nvarchar(max) not null) create table dbmeta_tab2(fcol1 int not null, foreign key (fcol1) references dbmeta_tab1(col1)) diff --git a/test/JDBC/input/ddl/babel_index_nulls_order-before-15-5-vu-verify.sql b/test/JDBC/input/ddl/babel_index_nulls_order-before-15-5-vu-verify.mix similarity index 99% rename from test/JDBC/input/ddl/babel_index_nulls_order-before-15-5-vu-verify.sql rename to test/JDBC/input/ddl/babel_index_nulls_order-before-15-5-vu-verify.mix index 2e649becba..7d46ff56f3 100644 --- a/test/JDBC/input/ddl/babel_index_nulls_order-before-15-5-vu-verify.sql +++ b/test/JDBC/input/ddl/babel_index_nulls_order-before-15-5-vu-verify.mix @@ -1,3 +1,4 @@ +-- tsql -- Nulls check SELECT * FROM babel_index_nulls_order_before_15_5_a_v1 go diff --git a/test/JDBC/input/ddl/babel_index_nulls_order-vu-verify.sql b/test/JDBC/input/ddl/babel_index_nulls_order-vu-verify.mix similarity index 99% rename from test/JDBC/input/ddl/babel_index_nulls_order-vu-verify.sql rename to test/JDBC/input/ddl/babel_index_nulls_order-vu-verify.mix index 504e0db333..7ecd5fc0e5 100644 --- a/test/JDBC/input/ddl/babel_index_nulls_order-vu-verify.sql +++ b/test/JDBC/input/ddl/babel_index_nulls_order-vu-verify.mix @@ -1,4 +1,5 @@ -- parallel_query_expected +-- tsql -- Nulls check SELECT * FROM babel_index_nulls_order_a_v1 go diff --git a/test/JDBC/input/functions/datepart-vu-verify.sql b/test/JDBC/input/functions/datepart-vu-verify.sql index 76b984b481..8e3097d80e 100644 --- a/test/JDBC/input/functions/datepart-vu-verify.sql +++ b/test/JDBC/input/functions/datepart-vu-verify.sql @@ -1,3 +1,4 @@ +-- sla_for_parallel_query_enforced 70000 SELECT DATEPART(dd, '07-18-2022') GO diff --git a/test/JDBC/input/linked_servers-vu-verify.sql b/test/JDBC/input/linked_servers-vu-verify.mix similarity index 99% rename from test/JDBC/input/linked_servers-vu-verify.sql rename to test/JDBC/input/linked_servers-vu-verify.mix index 6667a3e0a9..48e30c29a5 100644 --- a/test/JDBC/input/linked_servers-vu-verify.sql +++ b/test/JDBC/input/linked_servers-vu-verify.mix @@ -1,3 +1,4 @@ +-- tsql -- Check if the linked server added is reflected in the system view SELECT name, product, provider, data_source, provider_string, catalog, is_linked FROM sys.servers WHERE name NOT LIKE 'bbf_server%' AND name NOT LIKE 'server_4229%' ORDER BY name GO diff --git a/test/JDBC/input/linked_srv_4229-vu-verify.sql b/test/JDBC/input/linked_srv_4229-vu-verify.mix similarity index 99% rename from test/JDBC/input/linked_srv_4229-vu-verify.sql rename to test/JDBC/input/linked_srv_4229-vu-verify.mix index 476a3d9721..e46be5c15d 100644 --- a/test/JDBC/input/linked_srv_4229-vu-verify.sql +++ b/test/JDBC/input/linked_srv_4229-vu-verify.mix @@ -1,3 +1,4 @@ +-- tsql -- Call OPENQUERY() / four-part-object name from a database other than master USE tempdb CREATE TABLE t_tempdb_babel_4229 (a int) diff --git a/test/JDBC/input/openquery-vu-verify.txt b/test/JDBC/input/openquery-vu-verify.mix similarity index 80% rename from test/JDBC/input/openquery-vu-verify.txt rename to test/JDBC/input/openquery-vu-verify.mix index 7cdbfa84dd..f8b9506d0e 100644 --- a/test/JDBC/input/openquery-vu-verify.txt +++ b/test/JDBC/input/openquery-vu-verify.mix @@ -1,268 +1,353 @@ -- sla 250000 -# Here we run all the datatype related prepare scripts +-- tsql +-- Here we run all the datatype related prepare scripts -# bigint +-- bigint include#!#input/datatypes/TestBigInt-vu-prepare.txt -# numeric +-- numeric include#!#input/datatypes/TestNumeric-vu-prepare.txt -# bit +-- bit include#!#input/datatypes/TestBIT-vu-prepare.txt -# smallint +-- smallint include#!#input/datatypes/TestSmallInt-vu-prepare.txt -# decimal +-- decimal include#!#input/datatypes/TestDecimal-vu-prepare.txt -# smallmoney +-- smallmoney include#!#input/datatypes/TestSmallMoney-vu-prepare.txt -# int +-- int include#!#input/datatypes/TestInt-vu-prepare.txt -# tinyint +-- tinyint include#!#input/datatypes/TestTinyInt-vu-prepare.txt -# money +-- money include#!#input/datatypes/TestMoney-vu-prepare.txt -# float +-- float include#!#input/datatypes/TestFloat-vu-prepare.txt -# real +-- real include#!#input/datatypes/TestReal-vu-prepare.txt -# date +-- date include#!#input/datatypes/TestDate-vu-prepare.txt -# datetimeoffset +-- datetimeoffset include#!#input/datatypes/TestDatetimeoffset-vu-prepare.sql -# datetime2 +-- datetime2 include#!#input/datatypes/TestDatetime2-vu-prepare.txt -# smalldatetime +-- smalldatetime include#!#input/datatypes/TestSmallDatetime-vu-prepare.txt -# datetime +-- datetime include#!#input/datatypes/TestDatetime-vu-prepare.txt -# time +-- time include#!#input/datatypes/TestTime-vu-prepare.txt -# char and nchar +-- char and nchar include#!#input/datatypes/TestChar-vu-prepare.txt -# varchar and nvarchar +-- varchar and nvarchar include#!#input/datatypes/TestVarChar-vu-prepare.txt -# text and ntext +-- text and ntext include#!#input/datatypes/TestText-vu-prepare.txt -# binary and varbinary +-- binary and varbinary include#!#input/datatypes/TestBinary-vu-prepare.txt -# image +-- image include#!#input/datatypes/TestImage-vu-prepare.txt -# user defined data types +-- user defined data types include#!#input/datatypes/TestUDD-vu-prepare.txt -# uniqueidentifier +-- uniqueidentifier include#!#input/datatypes/TestUniqueIdentifier-vu-prepare.txt -# Run SELECTs but using OPENQUERY now +-- Run SELECTs but using OPENQUERY now SELECT * FROM OPENQUERY(bbf_server, 'SELECT * FROM testBIGINT_dt'); +GO SELECT * FROM OPENQUERY(bbf_server, 'SELECT * FROM numeric_table1'); +GO + SELECT * FROM OPENQUERY(bbf_server, 'SELECT * FROM numeric_table2'); +GO + SELECT * FROM OPENQUERY(bbf_server, 'SELECT * FROM numeric_table3'); +GO + SELECT * FROM OPENQUERY(bbf_server, 'SELECT * FROM numeric_table4'); +GO + SELECT * FROM OPENQUERY(bbf_server, 'SELECT * FROM numeric_table5'); +GO + SELECT * FROM OPENQUERY(bbf_server, 'SELECT * FROM numeric_table6'); +GO + SELECT * FROM OPENQUERY(bbf_server, 'SELECT * FROM numeric_table7'); +GO + SELECT * FROM OPENQUERY(bbf_server, 'SELECT * FROM numeric_table8'); +GO + SELECT * FROM OPENQUERY(bbf_server, 'SELECT * FROM numeric_table9'); +GO SELECT * FROM OPENQUERY(bbf_server, 'SELECT * FROM testBIT_dt'); +GO SELECT * FROM OPENQUERY(bbf_server, 'SELECT * FROM SMALLINT_dt'); +GO SELECT * FROM OPENQUERY(bbf_server, 'SELECT * FROM testdecimal_table1'); +GO + SELECT * FROM OPENQUERY(bbf_server, 'SELECT * FROM testdecimal_table2'); +GO + SELECT * FROM OPENQUERY(bbf_server, 'SELECT * FROM testdecimal_table3'); +GO + SELECT * FROM OPENQUERY(bbf_server, 'SELECT * FROM testdecimal_table4'); +GO + SELECT * FROM OPENQUERY(bbf_server, 'SELECT * FROM testdecimal_table5'); +GO + SELECT * FROM OPENQUERY(bbf_server, 'SELECT * FROM testdecimal_table6'); +GO + SELECT * FROM OPENQUERY(bbf_server, 'SELECT * FROM testdecimal_table7'); +GO + SELECT * FROM OPENQUERY(bbf_server, 'SELECT * FROM testdecimal_table8'); +GO + SELECT * FROM OPENQUERY(bbf_server, 'SELECT * FROM testdecimal_table9'); +GO SELECT * FROM OPENQUERY(bbf_server, 'SELECT * FROM smallmoney_dt'); +GO SELECT * FROM OPENQUERY(bbf_server, 'SELECT * FROM INT_dt'); +GO SELECT * FROM OPENQUERY(bbf_server, 'SELECT * FROM TINYINT_dt'); +GO SELECT * FROM OPENQUERY(bbf_server, 'SELECT * FROM money_dt'); +GO SELECT * FROM OPENQUERY(bbf_server, 'SELECT * FROM FLOAT_dt'); +GO SELECT * FROM OPENQUERY(bbf_server, 'SELECT * FROM REAL_dt'); +GO SELECT * FROM OPENQUERY(bbf_server, 'SELECT * FROM DATE_dt'); +GO SELECT * FROM OPENQUERY(bbf_server, 'SELECT * from TestDatetimeoffset_vu_prepare_testing'); +GO SELECT * FROM OPENQUERY(bbf_server, 'SELECT * from TestDatetime2_vu_prepare_t'); +GO SELECT * FROM OPENQUERY(bbf_server, 'SELECT * FROM SMALLDATETIME_dt'); +GO SELECT * FROM OPENQUERY(bbf_server, 'SELECT * FROM TestDatetime_vu_prepare_dt'); +GO SELECT * FROM OPENQUERY(bbf_server, 'SELECT * from TestTime1'); +GO SELECT * FROM OPENQUERY(bbf_server, 'SELECT * from TestTime2'); +GO SELECT * FROM OPENQUERY(bbf_server, 'SELECT * from TestTime3'); +GO SELECT * FROM OPENQUERY(bbf_server, 'SELECT * from TestTime4'); +GO SELECT * FROM OPENQUERY(bbf_server, 'SELECT * from TestTime5'); +GO SELECT * FROM OPENQUERY(bbf_server, 'SELECT * from TestTime6'); +GO SELECT * FROM OPENQUERY(bbf_server, 'SELECT * from TestTime7'); +GO SELECT * FROM OPENQUERY(bbf_server, 'SELECT * FROM testBINARY_dt1'); +GO SELECT * FROM OPENQUERY(bbf_server, 'SELECT * FROM testBINARY_dt2'); +GO SELECT * FROM OPENQUERY(bbf_server, 'SELECT * FROM testBINARY_dt3'); +GO SELECT * FROM OPENQUERY(bbf_server, 'SELECT * FROM testBINARY_dt4'); +GO SELECT * FROM OPENQUERY(bbf_server, 'SELECT * FROM IMAGE_dt1'); +GO SELECT * FROM OPENQUERY(bbf_server, 'SELECT * FROM IMAGE_dt2'); +GO SELECT * FROM OPENQUERY(bbf_server, 'SELECT * FROM IMAGE_dt3'); +GO SELECT * FROM OPENQUERY(bbf_server, 'SELECT * FROM testCHAR_dt'); +GO SELECT * FROM OPENQUERY(bbf_server, 'SELECT * FROM VARCHAR_dt1'); +GO SELECT * FROM OPENQUERY(bbf_server, 'SELECT * FROM VARCHAR_dt2'); +GO SELECT * FROM OPENQUERY(bbf_server, 'SELECT * FROM VARCHAR_dt3'); +GO SELECT * FROM OPENQUERY(bbf_server, 'SELECT * FROM VARCHAR_dt4'); +GO SELECT * FROM OPENQUERY(bbf_server, 'SELECT * FROM TEXT_dt'); +GO SELECT * FROM OPENQUERY(bbf_server, 'SELECT * FROM udd_dt1'); +GO SELECT * FROM OPENQUERY(bbf_server, 'SELECT * FROM udd_dt2'); +GO SELECT * FROM OPENQUERY(bbf_server, 'SELECT * FROM uniqueidentifier_dt'); +GO -# Drop all tables -# bigint +-- Drop all tables +-- bigint include#!#input/datatypes/TestBigInt-vu-cleanup.txt -# numeric +-- numeric include#!#input/datatypes/TestNumeric-vu-cleanup.txt -# bit +-- bit include#!#input/datatypes/TestBIT-vu-cleanup.txt -# smallint +-- smallint include#!#input/datatypes/TestSmallInt-vu-cleanup.txt -# decimal +-- decimal include#!#input/datatypes/TestDecimal-vu-cleanup.txt -# smallmoney +-- smallmoney include#!#input/datatypes/TestSmallMoney-vu-cleanup.txt -# int +-- int include#!#input/datatypes/TestInt-vu-cleanup.txt -# tinyint +-- tinyint include#!#input/datatypes/TestTinyInt-vu-cleanup.txt -# money +-- money include#!#input/datatypes/TestMoney-vu-cleanup.txt -# float +-- float include#!#input/datatypes/TestFloat-vu-cleanup.txt -# real +-- real include#!#input/datatypes/TestReal-vu-cleanup.txt -# date +-- date include#!#input/datatypes/TestDate-vu-cleanup.txt -# datetimeoffset +-- datetimeoffset include#!#input/datatypes/TestDatetimeoffset-vu-cleanup.sql -# datetime2 +-- datetime2 include#!#input/datatypes/TestDatetime2-vu-cleanup.txt -# smalldatetime +-- smalldatetime include#!#input/datatypes/TestSmallDatetime-vu-cleanup.txt -# datetime +-- datetime include#!#input/datatypes/TestDatetime-vu-cleanup.txt -# time +-- time include#!#input/datatypes/TestTime-vu-cleanup.txt -# char and nchar +-- char and nchar include#!#input/datatypes/TestChar-vu-cleanup.txt -# varchar and nvarchar +-- varchar and nvarchar include#!#input/datatypes/TestVarChar-vu-cleanup.txt -# text and ntext +-- text and ntext include#!#input/datatypes/TestText-vu-cleanup.txt -# binary and varbinary +-- binary and varbinary include#!#input/datatypes/TestBinary-vu-cleanup.txt -# image +-- image include#!#input/datatypes/TestImage-vu-cleanup.txt -# user defined data types +-- user defined data types include#!#input/datatypes/TestUDD-vu-cleanup.txt -# uniqueidentifier +-- uniqueidentifier include#!#input/datatypes/TestUniqueIdentifier-vu-cleanup.txt -# Test OPENQUERY error handling +-- Test OPENQUERY error handling SELECT * FROM OPENQUERY(bbf_server, 'select 1/0 as a') +GO -# Try executing a query that does not return a result set +-- Try executing a query that does not return a result set SELECT * FROM OPENQUERY(bbf_server, 'INSERT INTO just_a_table_which_does_not_exist VALUES (1)') +GO -# try executing query where column alias does not exist +-- try executing query where column alias does not exist SELECT * FROM OPENQUERY(bbf_server, 'select 1') +GO -# execute query that returns 2 result sets. We should only return the first +-- execute query that returns 2 result sets. We should only return the first SELECT * FROM OPENQUERY(bbf_server, 'select 123; select 456') +GO -# Test view dependent on OPENQUERY +-- Test view dependent on OPENQUERY SELECT * FROM openquery_vu_prepare__openquery_view +GO -# Test OPENQUERY with an unreachable server +-- Test OPENQUERY with an unreachable server SELECT * FROM OPENQUERY(bbf_server_unreachable, 'select 1') +GO -#Test OPENQUERY where argument has quotes +-- Test OPENQUERY where argument has quotes SELECT * FROM OPENQUERY(bbf_server, 'SELECT ''Query having both ''''single'''' and "double" quotes''') +GO -# Test query timeout behaviour in OPENQUERY -# check the value of query timeout from sys.servers +-- Test query timeout behaviour in OPENQUERY +-- check the value of query timeout from sys.servers select name, query_timeout from sys.servers where name = 'bbf_server_1' +GO -# execute a query which takes more time than the timeout set +-- execute a query which takes more time than the timeout set SELECT * FROM OPENQUERY(bbf_server_1, 'select CAST(pg_sleep(5) AS text)') +GO -# Test connect timeout behaviour in OPENQUERY -# check the value of connect timeout from sys.servers +-- Test connect timeout behaviour in OPENQUERY +-- check the value of connect timeout from sys.servers select name, connect_timeout from sys.servers where name = 'bbf_server_2' +GO -# Make openquery against a non-existing server +-- Make openquery against a non-existing server SELECT * FROM OPENQUERY(bbf_server_2, 'select 1') +GO -# Test procedure dependent on OPENQUERY +-- Test procedure dependent on OPENQUERY EXEC openquery_vu_prepare__openquery_proc +GO -# Test function dependent on OPENQUERY +-- Test function dependent on OPENQUERY SELECT openquery_vu_prepare__openquery_func() +GO diff --git a/test/JDBC/input/pg_hint_plan/BABEL-3291.sql b/test/JDBC/input/pg_hint_plan/BABEL-3291.mix similarity index 99% rename from test/JDBC/input/pg_hint_plan/BABEL-3291.sql rename to test/JDBC/input/pg_hint_plan/BABEL-3291.mix index 3d5dfa0c43..c2157b29ea 100644 --- a/test/JDBC/input/pg_hint_plan/BABEL-3291.sql +++ b/test/JDBC/input/pg_hint_plan/BABEL-3291.mix @@ -1,4 +1,5 @@ -- parallel_query_expected +-- tsql drop table if exists babel_3291_t1 go diff --git a/test/JDBC/input/pg_hint_plan/BABEL-3292.sql b/test/JDBC/input/pg_hint_plan/BABEL-3292.mix similarity index 99% rename from test/JDBC/input/pg_hint_plan/BABEL-3292.sql rename to test/JDBC/input/pg_hint_plan/BABEL-3292.mix index 1c563fccaa..4574cfdf35 100644 --- a/test/JDBC/input/pg_hint_plan/BABEL-3292.sql +++ b/test/JDBC/input/pg_hint_plan/BABEL-3292.mix @@ -1,4 +1,5 @@ -- parallel_query_expected +-- tsql drop table if exists babel_3292_t1 go diff --git a/test/JDBC/input/pg_hint_plan/BABEL-3293.sql b/test/JDBC/input/pg_hint_plan/BABEL-3293.mix similarity index 99% rename from test/JDBC/input/pg_hint_plan/BABEL-3293.sql rename to test/JDBC/input/pg_hint_plan/BABEL-3293.mix index 656deb209c..cfb3f55705 100644 --- a/test/JDBC/input/pg_hint_plan/BABEL-3293.sql +++ b/test/JDBC/input/pg_hint_plan/BABEL-3293.mix @@ -1,4 +1,5 @@ -- parallel_query_expected +-- tsql drop table if exists babel_3293_t1 go diff --git a/test/JDBC/input/pg_hint_plan/BABEL-3294.sql b/test/JDBC/input/pg_hint_plan/BABEL-3294.mix similarity index 99% rename from test/JDBC/input/pg_hint_plan/BABEL-3294.sql rename to test/JDBC/input/pg_hint_plan/BABEL-3294.mix index e93d200722..3cb19b66c8 100644 --- a/test/JDBC/input/pg_hint_plan/BABEL-3294.sql +++ b/test/JDBC/input/pg_hint_plan/BABEL-3294.mix @@ -1,4 +1,5 @@ -- parallel_query_expected +-- tsql drop table if exists babel_3294_t1 go diff --git a/test/JDBC/input/pg_hint_plan/BABEL-3295.sql b/test/JDBC/input/pg_hint_plan/BABEL-3295.mix similarity index 99% rename from test/JDBC/input/pg_hint_plan/BABEL-3295.sql rename to test/JDBC/input/pg_hint_plan/BABEL-3295.mix index bb77ea1335..3208d48bd4 100644 --- a/test/JDBC/input/pg_hint_plan/BABEL-3295.sql +++ b/test/JDBC/input/pg_hint_plan/BABEL-3295.mix @@ -1,4 +1,5 @@ -- parallel_query_expected +-- tsql drop table if exists babel_3295_t1 go diff --git a/test/JDBC/input/pg_hint_plan/BABEL-3512.sql b/test/JDBC/input/pg_hint_plan/BABEL-3512.mix similarity index 99% rename from test/JDBC/input/pg_hint_plan/BABEL-3512.sql rename to test/JDBC/input/pg_hint_plan/BABEL-3512.mix index bc639b26f4..89f0b5c68e 100644 --- a/test/JDBC/input/pg_hint_plan/BABEL-3512.sql +++ b/test/JDBC/input/pg_hint_plan/BABEL-3512.mix @@ -1,4 +1,5 @@ -- parallel_query_expected +-- tsql /* * Test stored procs WITH hints. All tests examine the query plan AND the * pg_proc table to ensure that subsequent connections will be using the correct diff --git a/test/JDBC/input/pg_hint_plan/BABEL-3592.sql b/test/JDBC/input/pg_hint_plan/BABEL-3592.mix similarity index 99% rename from test/JDBC/input/pg_hint_plan/BABEL-3592.sql rename to test/JDBC/input/pg_hint_plan/BABEL-3592.mix index 29b74cac1a..48b2a516f7 100644 --- a/test/JDBC/input/pg_hint_plan/BABEL-3592.sql +++ b/test/JDBC/input/pg_hint_plan/BABEL-3592.mix @@ -1,4 +1,5 @@ -- parallel_query_expected +-- tsql drop procedure if exists babel_3592_insert_multiline go diff --git a/test/JDBC/input/pg_hint_plan/BABEL-4294-vu-verify.sql b/test/JDBC/input/pg_hint_plan/BABEL-4294-vu-verify.mix similarity index 99% rename from test/JDBC/input/pg_hint_plan/BABEL-4294-vu-verify.sql rename to test/JDBC/input/pg_hint_plan/BABEL-4294-vu-verify.mix index 281adc5cd1..75e3a81796 100644 --- a/test/JDBC/input/pg_hint_plan/BABEL-4294-vu-verify.sql +++ b/test/JDBC/input/pg_hint_plan/BABEL-4294-vu-verify.mix @@ -1,4 +1,5 @@ -- parallel_query_expected +-- tsql -- Test to check if initialisation of Parallel Worker crash when babelfishpg_tsql.enable_pg_hint is set /* * Set the enable_pg_hint, try to create parallel worker diff --git a/test/JDBC/input/securityadmin_role-vu-verify.mix b/test/JDBC/input/securityadmin_role-vu-verify.mix index 60c56562b8..f3c057af24 100644 --- a/test/JDBC/input/securityadmin_role-vu-verify.mix +++ b/test/JDBC/input/securityadmin_role-vu-verify.mix @@ -243,6 +243,7 @@ go -- terminate-tsql-conn user=securityadmin_login1 password=123 -- psql +SET client_min_messages = 'error'; CREATE EXTENSION IF NOT EXISTS tds_fdw; GO diff --git a/test/JDBC/jdbc_schedule b/test/JDBC/jdbc_schedule index dc8084a456..79ebd44a95 100644 --- a/test/JDBC/jdbc_schedule +++ b/test/JDBC/jdbc_schedule @@ -85,6 +85,9 @@ ignore#!#BABEL-2736-before-16_5-vu-cleanup ignore#!#BABEL-2736-before-15_3-vu-prepare ignore#!#BABEL-2736-before-15_3-vu-verify ignore#!#BABEL-2736-before-15_3-vu-cleanup +ignore#!#restricted_procedures-vu-prepare +ignore#!#restricted_procedures-vu-verify +ignore#!#restricted_procedures-vu-cleanup ignore#!#smalldatetime_date_cmp-before-15_5-16_1-vu-prepare ignore#!#smalldatetime_date_cmp-before-15_5-16_1-vu-verify ignore#!#smalldatetime_date_cmp-before-15_5-16_1-vu-cleanup diff --git a/test/JDBC/src/main/java/com/sqlsamples/JDBCCrossDialect.java b/test/JDBC/src/main/java/com/sqlsamples/JDBCCrossDialect.java index a58db0bba3..54f5a9aa2a 100644 --- a/test/JDBC/src/main/java/com/sqlsamples/JDBCCrossDialect.java +++ b/test/JDBC/src/main/java/com/sqlsamples/JDBCCrossDialect.java @@ -162,17 +162,23 @@ Connection getPsqlConnection (String strLine, BufferedWriter bw, Logger logger) } void closeConnectionsUtil (HashMap connectionMap, BufferedWriter bw, Logger logger) { - connectionMap.forEach( - (connectionAttribute, connection) -> { - if (connection != null) { - try { - connection.close(); - } catch (SQLException e) { - handleSQLExceptionWithFile(e, bw, logger); - } + boolean needSkipFirst = isUpgradeTestMode ? false : true; + Iterator> iterator = connectionMap.entrySet().iterator(); + + while (iterator.hasNext()) { + Map.Entry entry = iterator.next(); + Connection connection = entry.getValue(); + + if (!needSkipFirst) { + try { + connection.close(); + } catch (SQLException e) { + handleSQLExceptionWithFile(e, bw, logger); } } - ); + else + needSkipFirst = false; + } } void closeConnections (BufferedWriter bw, Logger logger) { diff --git a/test/JDBC/src/main/java/com/sqlsamples/batch_run.java b/test/JDBC/src/main/java/com/sqlsamples/batch_run.java index 70097ac986..4098ac8743 100644 --- a/test/JDBC/src/main/java/com/sqlsamples/batch_run.java +++ b/test/JDBC/src/main/java/com/sqlsamples/batch_run.java @@ -212,7 +212,7 @@ static void batch_run_sql(Connection con_bbl, BufferedWriter bw, String testFile } else if (strLine.startsWith("java_auth")) { jdbcAuthentication.javaAuthentication(strLine, bw, logger); - } else if (strLine.startsWith("include") && !isSQLFile) { + } else if (strLine.startsWith("include") && (!isSQLFile || isCrossDialectFile)) { String[] result = strLine.split("#!#"); String filePath = new File(result[1]).getAbsolutePath(); diff --git a/test/JDBC/src/test/java/com/sqlsamples/TestQueryFile.java b/test/JDBC/src/test/java/com/sqlsamples/TestQueryFile.java index d293d03f53..68ecb7f892 100644 --- a/test/JDBC/src/test/java/com/sqlsamples/TestQueryFile.java +++ b/test/JDBC/src/test/java/com/sqlsamples/TestQueryFile.java @@ -39,7 +39,7 @@ public class TestQueryFile { static File diffFile; String inputFileName; - Connection connection_bbl; // connection object for Babel instance + static Connection connection_bbl; // connection object for Babel instance public static void createTestFilesListUtil(String directory, String testToRun) { File dir = new File(directory); @@ -220,7 +220,7 @@ static Stream inputFileNames() { // if this is a normal JDBC test run, we need to run the prepare, verify // and cleanup scripts for one use-case, one after the other - if (!isUpgradeTestMode) { + // if (!isUpgradeTestMode) { // first sort all files based only on file prefix Collections.sort(fileList, new Comparator() { @Override @@ -241,7 +241,7 @@ public int compare (String file1, String file2) { } } }); - } + // } return fileList.stream(); } @@ -267,8 +267,20 @@ public static void setup() throws IOException { // close connections that are not null after every test @AfterEach - public void closeConnections() throws SQLException { - if (connection_bbl != null) connection_bbl.close(); + public void closeConnections() throws SQLException, ClassNotFoundException, Throwable { + if (isUpgradeTestMode) { + if (connection_bbl != null) connection_bbl.close(); + connection_bbl = null; + return; + } + if (connection_bbl == null) + return; + try{ + connection_bbl.createStatement().execute("EXEC sys.sp_reset_connection"); + } + catch (Exception e) { + e.printStackTrace(); + } } // write summary log after all tests have been executed @@ -423,7 +435,8 @@ public void TestQueryBatch(String inputFileName) throws SQLException, ClassNotFo return; } else { selectDriver(); - connection_bbl = DriverManager.getConnection(connectionString); + if (connection_bbl == null) + connection_bbl = DriverManager.getConnection(connectionString); } summaryLogger.info("RUNNING " + inputFileName); diff --git a/test/JDBC/target/JDBC-testsuite-1.0.0.jar b/test/JDBC/target/JDBC-testsuite-1.0.0.jar deleted file mode 100644 index 80377cab5f..0000000000 Binary files a/test/JDBC/target/JDBC-testsuite-1.0.0.jar and /dev/null differ diff --git a/test/JDBC/upgrade/13_4/schedule b/test/JDBC/upgrade/13_4/schedule index c7c6a1d6d6..28be24e611 100644 --- a/test/JDBC/upgrade/13_4/schedule +++ b/test/JDBC/upgrade/13_4/schedule @@ -26,7 +26,6 @@ BABEL-1683 BABEL-1963 BABEL-1994-CHAR BABEL-1994-VARCHAR -restricted_procedures BABEL-2086 BABEL-2170 BABEL-2203 diff --git a/test/JDBC/upgrade/13_5/schedule b/test/JDBC/upgrade/13_5/schedule index 95cae4d586..5acee2a549 100644 --- a/test/JDBC/upgrade/13_5/schedule +++ b/test/JDBC/upgrade/13_5/schedule @@ -22,7 +22,6 @@ BABEL-1466 BABEL-1475 BABEL-1493 BABEL-1510 -restricted_procedures BABEL-1625 BABEL-1683 BABEL-1715 diff --git a/test/JDBC/upgrade/13_6/schedule b/test/JDBC/upgrade/13_6/schedule index 940f5d23c7..4ff704ba42 100644 --- a/test/JDBC/upgrade/13_6/schedule +++ b/test/JDBC/upgrade/13_6/schedule @@ -25,7 +25,6 @@ BABEL-1475 BABEL-1493 BABEL-1510 BABEL-1566 -restricted_procedures BABEL-1625 BABEL-1654 BABEL-1683 diff --git a/test/JDBC/upgrade/13_7/schedule b/test/JDBC/upgrade/13_7/schedule index acf56e6285..f0278d816e 100644 --- a/test/JDBC/upgrade/13_7/schedule +++ b/test/JDBC/upgrade/13_7/schedule @@ -29,7 +29,6 @@ BABEL-1683 BABEL-1715 BABEL-1756 BABEL-1756-dep -restricted_procedures BABEL-1963 BABEL-1994-CHAR BABEL-1994-VARCHAR diff --git a/test/JDBC/upgrade/13_8/schedule b/test/JDBC/upgrade/13_8/schedule index 91322543fa..f0278d816e 100644 --- a/test/JDBC/upgrade/13_8/schedule +++ b/test/JDBC/upgrade/13_8/schedule @@ -30,7 +30,6 @@ BABEL-1715 BABEL-1756 BABEL-1756-dep BABEL-1963 -restricted_procedures BABEL-1994-CHAR BABEL-1994-VARCHAR BABEL-2086 diff --git a/test/JDBC/upgrade/13_9/schedule b/test/JDBC/upgrade/13_9/schedule index e85d9b1d9f..1cc5cb05a0 100644 --- a/test/JDBC/upgrade/13_9/schedule +++ b/test/JDBC/upgrade/13_9/schedule @@ -29,7 +29,6 @@ BABEL-1625 BABEL-1654 BABEL-1683 BABEL-1715 -restricted_procedures BABEL-1963 BABEL-1994-CHAR BABEL-1994-VARCHAR diff --git a/test/JDBC/upgrade/14_10/schedule b/test/JDBC/upgrade/14_10/schedule index 26c50f5339..37c135f2b3 100644 --- a/test/JDBC/upgrade/14_10/schedule +++ b/test/JDBC/upgrade/14_10/schedule @@ -35,7 +35,6 @@ TestTinyInt TestUDD-before-15_7-or-16_3 TestUniqueIdentifier TestVarChar -restricted_procedures TestXML sys-assembly_types sys-database_mirroring diff --git a/test/JDBC/upgrade/14_11/schedule b/test/JDBC/upgrade/14_11/schedule index dcba1afbd9..3c1042f26c 100644 --- a/test/JDBC/upgrade/14_11/schedule +++ b/test/JDBC/upgrade/14_11/schedule @@ -40,7 +40,6 @@ sys-assembly_types sys-database_mirroring sys-databases sys-numbered_procedures -restricted_procedures BABEL-3121 sys-events sys-suser_sid diff --git a/test/JDBC/upgrade/14_12/schedule b/test/JDBC/upgrade/14_12/schedule index e2bf1b4515..db76784604 100644 --- a/test/JDBC/upgrade/14_12/schedule +++ b/test/JDBC/upgrade/14_12/schedule @@ -41,7 +41,6 @@ sys-database_mirroring sys-databases sys-numbered_procedures BABEL-3121 -restricted_procedures sys-events sys-suser_sid sys-trigger_events diff --git a/test/JDBC/upgrade/14_13/schedule b/test/JDBC/upgrade/14_13/schedule index afc6c837a5..d8301d95f0 100644 --- a/test/JDBC/upgrade/14_13/schedule +++ b/test/JDBC/upgrade/14_13/schedule @@ -44,7 +44,6 @@ BABEL-3121 sys-events sys-suser_sid sys-trigger_events -restricted_procedures BABEL-2688 BABEL-328 BABEL-3166-before-16_5-or-15_9 diff --git a/test/JDBC/upgrade/14_15/schedule b/test/JDBC/upgrade/14_15/schedule index 45d3f7aeac..c2f052fd6f 100644 --- a/test/JDBC/upgrade/14_15/schedule +++ b/test/JDBC/upgrade/14_15/schedule @@ -44,7 +44,6 @@ BABEL-3121 sys-events sys-suser_sid sys-trigger_events -restricted_procedures BABEL-2688 BABEL-328 BABEL-3166-before-16_5-or-15_9 diff --git a/test/JDBC/upgrade/14_16/schedule b/test/JDBC/upgrade/14_16/schedule index a791387369..1b97ac7a1f 100644 --- a/test/JDBC/upgrade/14_16/schedule +++ b/test/JDBC/upgrade/14_16/schedule @@ -44,7 +44,6 @@ BABEL-3121 sys-events sys-suser_sid sys-trigger_events -restricted_procedures BABEL-2688 BABEL-328 BABEL-3166-before-16_5-or-15_9 diff --git a/test/JDBC/upgrade/14_3/schedule b/test/JDBC/upgrade/14_3/schedule index 0ed6c0608b..f4c209a8b9 100644 --- a/test/JDBC/upgrade/14_3/schedule +++ b/test/JDBC/upgrade/14_3/schedule @@ -32,7 +32,6 @@ BABEL-1715 BABEL-1756 BABEL-1756-dep BABEL-1963 -restricted_procedures BABEL-1994-CHAR BABEL-1994-VARCHAR BABEL-2086 diff --git a/test/JDBC/upgrade/14_5/schedule b/test/JDBC/upgrade/14_5/schedule index 283b379431..88ab9ca47d 100644 --- a/test/JDBC/upgrade/14_5/schedule +++ b/test/JDBC/upgrade/14_5/schedule @@ -32,7 +32,6 @@ BABEL-1756 BABEL-1756-dep BABEL-1963 BABEL-1994-CHAR -restricted_procedures BABEL-1994-VARCHAR BABEL-2086 BABEL-2170 diff --git a/test/JDBC/upgrade/14_6/schedule b/test/JDBC/upgrade/14_6/schedule index c4c6cdda4a..5e4c018db9 100644 --- a/test/JDBC/upgrade/14_6/schedule +++ b/test/JDBC/upgrade/14_6/schedule @@ -32,7 +32,6 @@ BABEL-1683 BABEL-1715 BABEL-1953 BABEL-1963 -restricted_procedures BABEL-1994-CHAR BABEL-1994-VARCHAR BABEL-2086 diff --git a/test/JDBC/upgrade/14_7/schedule b/test/JDBC/upgrade/14_7/schedule index 751ea855ab..a491439b90 100644 --- a/test/JDBC/upgrade/14_7/schedule +++ b/test/JDBC/upgrade/14_7/schedule @@ -34,7 +34,6 @@ BABEL-1683 BABEL-1715 BABEL-1953 BABEL-1963 -restricted_procedures BABEL-1994-CHAR BABEL-1994-VARCHAR BABEL-2086 diff --git a/test/JDBC/upgrade/14_8/schedule b/test/JDBC/upgrade/14_8/schedule index 5f59900e39..62ebc35d70 100644 --- a/test/JDBC/upgrade/14_8/schedule +++ b/test/JDBC/upgrade/14_8/schedule @@ -37,7 +37,6 @@ BABEL-1963 BABEL-1994-CHAR BABEL-1994-VARCHAR BABEL-2086 -restricted_procedures BABEL-2170 BABEL-2203 BABEL-2208 diff --git a/test/JDBC/upgrade/14_9/schedule b/test/JDBC/upgrade/14_9/schedule index df8306e077..0fabe83c90 100644 --- a/test/JDBC/upgrade/14_9/schedule +++ b/test/JDBC/upgrade/14_9/schedule @@ -41,7 +41,6 @@ sys-database_mirroring sys-databases sys-numbered_procedures BABEL-3121 -restricted_procedures sys-events sys-suser_sid sys-trigger_events diff --git a/test/JDBC/upgrade/15_1/schedule b/test/JDBC/upgrade/15_1/schedule index d87500f6eb..f26a07e637 100644 --- a/test/JDBC/upgrade/15_1/schedule +++ b/test/JDBC/upgrade/15_1/schedule @@ -38,7 +38,6 @@ BABEL-2086 BABEL-2170 BABEL-2203 BABEL-2208 -restricted_procedures BABEL-2257 BABEL-2449 BABEL-2535 diff --git a/test/JDBC/upgrade/15_10/schedule b/test/JDBC/upgrade/15_10/schedule index 31dad01e01..111b1abe45 100644 --- a/test/JDBC/upgrade/15_10/schedule +++ b/test/JDBC/upgrade/15_10/schedule @@ -40,7 +40,6 @@ BABEL-1994-VARCHAR BABEL-2086 BABEL-2170 BABEL-2203 -restricted_procedures BABEL-2208 BABEL-2257 BABEL-2449 diff --git a/test/JDBC/upgrade/15_11/schedule b/test/JDBC/upgrade/15_11/schedule index 05f1028e6e..d12f63299a 100644 --- a/test/JDBC/upgrade/15_11/schedule +++ b/test/JDBC/upgrade/15_11/schedule @@ -40,7 +40,6 @@ BABEL-1994-VARCHAR BABEL-2086 BABEL-2170 BABEL-2203 -restricted_procedures BABEL-2208 BABEL-2257 BABEL-2449 diff --git a/test/JDBC/upgrade/15_2/schedule b/test/JDBC/upgrade/15_2/schedule index c11cb2edc2..6dbf65eaf2 100644 --- a/test/JDBC/upgrade/15_2/schedule +++ b/test/JDBC/upgrade/15_2/schedule @@ -38,7 +38,6 @@ BABEL-1994-CHAR BABEL-1994-VARCHAR BABEL-2086 BABEL-2170 -restricted_procedures BABEL-2203 BABEL-2208 BABEL-2257 diff --git a/test/JDBC/upgrade/15_3/schedule b/test/JDBC/upgrade/15_3/schedule index 1e02734d67..c1d37bb6a2 100644 --- a/test/JDBC/upgrade/15_3/schedule +++ b/test/JDBC/upgrade/15_3/schedule @@ -39,7 +39,6 @@ BABEL-1994-VARCHAR BABEL-2086 BABEL-2170 BABEL-2203 -restricted_procedures BABEL-2208 BABEL-2257 BABEL-2449 diff --git a/test/JDBC/upgrade/15_4/schedule b/test/JDBC/upgrade/15_4/schedule index de9a537545..c30db810dc 100644 --- a/test/JDBC/upgrade/15_4/schedule +++ b/test/JDBC/upgrade/15_4/schedule @@ -41,7 +41,6 @@ BABEL-2170 BABEL-2203 BABEL-2208 BABEL-2257 -restricted_procedures BABEL-2449 BABEL-2535 BABEL-2688 diff --git a/test/JDBC/upgrade/15_5/schedule b/test/JDBC/upgrade/15_5/schedule index 70fe8e90cd..c9c8e505e7 100644 --- a/test/JDBC/upgrade/15_5/schedule +++ b/test/JDBC/upgrade/15_5/schedule @@ -40,7 +40,6 @@ BABEL-1994-VARCHAR BABEL-2086 BABEL-2170 BABEL-2203 -restricted_procedures BABEL-2208 BABEL-2257 BABEL-2449 diff --git a/test/JDBC/upgrade/15_6/schedule b/test/JDBC/upgrade/15_6/schedule index 58d8225118..70cab1e70c 100644 --- a/test/JDBC/upgrade/15_6/schedule +++ b/test/JDBC/upgrade/15_6/schedule @@ -41,7 +41,6 @@ BABEL-2086 BABEL-2170 BABEL-2203 BABEL-2208 -restricted_procedures BABEL-2257 BABEL-2449 BABEL-2535 diff --git a/test/JDBC/upgrade/15_7/schedule b/test/JDBC/upgrade/15_7/schedule index 02c7059e1b..a2df0dae73 100644 --- a/test/JDBC/upgrade/15_7/schedule +++ b/test/JDBC/upgrade/15_7/schedule @@ -39,7 +39,6 @@ BABEL-1994-CHAR BABEL-1994-VARCHAR BABEL-2086 BABEL-2170 -restricted_procedures BABEL-2203 BABEL-2208 BABEL-2257 diff --git a/test/JDBC/upgrade/15_8/schedule b/test/JDBC/upgrade/15_8/schedule index 9dfb34c9cf..ff0de7da33 100644 --- a/test/JDBC/upgrade/15_8/schedule +++ b/test/JDBC/upgrade/15_8/schedule @@ -40,7 +40,6 @@ BABEL-1994-VARCHAR BABEL-2086 BABEL-2170 BABEL-2203 -restricted_procedures BABEL-2208 BABEL-2257 BABEL-2449 diff --git a/test/JDBC/upgrade/16_1/schedule b/test/JDBC/upgrade/16_1/schedule index 3f966e185a..619eeb10f5 100644 --- a/test/JDBC/upgrade/16_1/schedule +++ b/test/JDBC/upgrade/16_1/schedule @@ -42,7 +42,6 @@ BABEL-2170 BABEL-2203 BABEL-2208 BABEL-2257 -restricted_procedures BABEL-2449 BABEL-2535 BABEL-2688 diff --git a/test/JDBC/upgrade/16_2/schedule b/test/JDBC/upgrade/16_2/schedule index d12c08ac07..1cdb53bf26 100644 --- a/test/JDBC/upgrade/16_2/schedule +++ b/test/JDBC/upgrade/16_2/schedule @@ -46,7 +46,6 @@ BABEL-2449 BABEL-2535 BABEL-2688 BABEL-2765 -restricted_procedures BABEL-2787 BABEL-2787-2 BABEL-2795 diff --git a/test/JDBC/upgrade/16_3/schedule b/test/JDBC/upgrade/16_3/schedule index ae3f36e0aa..e399d98911 100644 --- a/test/JDBC/upgrade/16_3/schedule +++ b/test/JDBC/upgrade/16_3/schedule @@ -45,7 +45,6 @@ BABEL-2257 BABEL-2449 BABEL-2535 BABEL-2688 -restricted_procedures BABEL-2765 BABEL-2787 BABEL-2787-2 diff --git a/test/JDBC/upgrade/16_4/schedule b/test/JDBC/upgrade/16_4/schedule index 780c99088b..47ff20eae6 100644 --- a/test/JDBC/upgrade/16_4/schedule +++ b/test/JDBC/upgrade/16_4/schedule @@ -230,7 +230,6 @@ FULLTEXT_INDEX fts-contains fts-contains-utils BABEL-4785 -restricted_procedures get_tds_id HAS_DBACCESS identity_function diff --git a/test/JDBC/upgrade/16_6/schedule b/test/JDBC/upgrade/16_6/schedule index ef6af6493c..55ab206982 100644 --- a/test/JDBC/upgrade/16_6/schedule +++ b/test/JDBC/upgrade/16_6/schedule @@ -231,7 +231,6 @@ FULLTEXT_INDEX fts-contains fts-contains-utils BABEL-4785 -restricted_procedures get_tds_id HAS_DBACCESS identity_function diff --git a/test/JDBC/upgrade/16_7/schedule b/test/JDBC/upgrade/16_7/schedule index 84b9ab7118..565f51aafb 100644 --- a/test/JDBC/upgrade/16_7/schedule +++ b/test/JDBC/upgrade/16_7/schedule @@ -230,7 +230,6 @@ FULLTEXT_INDEX fts-contains fts-contains-utils BABEL-4785 -restricted_procedures get_tds_id HAS_DBACCESS identity_function diff --git a/test/JDBC/upgrade/17_2/schedule b/test/JDBC/upgrade/17_2/schedule index 5b2b05d0d9..a8acf2a3b7 100644 --- a/test/JDBC/upgrade/17_2/schedule +++ b/test/JDBC/upgrade/17_2/schedule @@ -228,7 +228,6 @@ FULLTEXT_INDEX fts-contains fts-contains-utils BABEL-4785 -restricted_procedures get_tds_id HAS_DBACCESS identity_function diff --git a/test/JDBC/upgrade/latest/schedule b/test/JDBC/upgrade/latest/schedule index a80c24b1bf..0534700c09 100644 --- a/test/JDBC/upgrade/latest/schedule +++ b/test/JDBC/upgrade/latest/schedule @@ -57,7 +57,6 @@ babelfish_function_ext BABEL-2884 BABEL-2917 BABEL-2944 -BABEL-2955 BABEL-3000 BABEL-3000-dep BABEL-3010 @@ -229,7 +228,6 @@ FULLTEXT_INDEX fts-contains fts-contains-utils BABEL-4785 -restricted_procedures get_tds_id HAS_DBACCESS identity_function @@ -246,7 +244,6 @@ ISC-Views is_srvrolemember jira-BABEL-3504-upgrade key_column_usage -linked_servers msdb-dbo-fn_syspolicy_is_automation_enabled msdb-dbo-syspolicy_configuration msdb-dbo-syspolicy_system_health_state @@ -255,7 +252,6 @@ nested_trigger_with_dml newid objectpropertyex openjson -openquery_upgrd_before_15_4 orderby routines_definition rowcount @@ -487,7 +483,6 @@ datetimeoffset-timezone BABEL-4046 host_id drop_index -linked_srv_4229 BABEL-4175 sp_who BABEL_4330 @@ -516,7 +511,6 @@ pivot #AUTO_ANALYZE #uncomment this test when preparing for new minor version cast_eliminate TestDatatypeAggSort -babel_index_nulls_order BABEL-2999 BABEL-4606 BABEL-4672 diff --git a/test/python/expected/upgrade_validation/expected_dependency.out b/test/python/expected/upgrade_validation/expected_dependency.out index 57ca5abc74..acc487ddcf 100644 --- a/test/python/expected/upgrade_validation/expected_dependency.out +++ b/test/python/expected/upgrade_validation/expected_dependency.out @@ -767,6 +767,7 @@ Function sys.version() Function sys.xact_state() Function sys.xid8rowversion(xid8,integer,boolean) Function sys.year(anyelement) +Operator <=(sys."varchar",sys."varchar") Operator <=(sys.bpchar,sys.bpchar) Operator <>(sys.bpchar,sys.bpchar) Operator <>(sys.bpchar,text) @@ -988,10 +989,12 @@ View sys.fulltext_catalogs View sys.fulltext_index_columns View sys.fulltext_languages View sys.fulltext_stoplists +View sys.linked_logins View sys.master_files View sys.pg_namespace_ext View sys.registered_search_property_lists View sys.selective_xml_index_paths +View sys.servers View sys.shipped_objects_not_in_sys View sys.sp_column_privileges_view View sys.sp_columns_100_view