From cee66bee3ca848382a0422898c853aa5bdd99c18 Mon Sep 17 00:00:00 2001 From: Xiaohui F Date: Tue, 7 Nov 2023 09:39:42 -0800 Subject: [PATCH] Add sort operators for MAX/MIN of Babelfish datatypes (#1989) Previously, the MAX/MIN aggregation with index cannot be correctly optimized into LIMIT 1 + index scan. This affects most of existing Babelfish-defined datatypes. This commit fixes this issue by adding corresponding sort operators to the MAX/MIN aggregation functions. Task: BABEL-4311 Signed-off-by: Xiaohui Fanhe --- contrib/babelfishpg_common/sql/bpchar.sql | 2 + contrib/babelfishpg_common/sql/datetime.sql | 4 +- contrib/babelfishpg_common/sql/datetime2.sql | 2 + .../babelfishpg_common/sql/datetimeoffset.sql | 2 + .../babelfishpg_common/sql/smalldatetime.sql | 4 +- .../babelfish_common_helper--3.2.0--3.3.0.sql | 123 +++++++++ contrib/babelfishpg_common/sql/varchar.sql | 2 + .../TestDatatypeAggSort-vu-cleanup.out | 33 +++ .../TestDatatypeAggSort-vu-prepare.out | 165 +++++++++++ .../TestDatatypeAggSort-vu-verify.out | 192 +++++++++++++ test/JDBC/expected/TestDatatypeAggSort.out | 259 ++++++++++++++++++ .../TestDatatypeAggSort-vu-cleanup.sql | 33 +++ .../TestDatatypeAggSort-vu-prepare.sql | 163 +++++++++++ .../TestDatatypeAggSort-vu-verify.sql | 66 +++++ .../input/datatypes/TestDatatypeAggSort.sql | 125 +++++++++ test/JDBC/upgrade/13_4/schedule | 3 +- test/JDBC/upgrade/13_5/schedule | 3 +- test/JDBC/upgrade/13_6/schedule | 3 +- test/JDBC/upgrade/13_7/schedule | 3 +- test/JDBC/upgrade/13_8/schedule | 3 +- test/JDBC/upgrade/13_9/schedule | 3 +- test/JDBC/upgrade/14_10/schedule | 1 + test/JDBC/upgrade/14_3/schedule | 3 +- test/JDBC/upgrade/14_5/schedule | 3 +- test/JDBC/upgrade/14_6/schedule | 3 +- test/JDBC/upgrade/14_7/schedule | 3 +- test/JDBC/upgrade/14_8/schedule | 3 +- test/JDBC/upgrade/14_9/schedule | 3 +- test/JDBC/upgrade/15_1/schedule | 3 +- test/JDBC/upgrade/15_2/schedule | 1 + test/JDBC/upgrade/15_3/schedule | 3 +- test/JDBC/upgrade/15_4/schedule | 3 +- test/JDBC/upgrade/latest/schedule | 1 + test/JDBC/upgrade/master/schedule | 1 + 34 files changed, 1207 insertions(+), 17 deletions(-) create mode 100644 test/JDBC/expected/TestDatatypeAggSort-vu-cleanup.out create mode 100644 test/JDBC/expected/TestDatatypeAggSort-vu-prepare.out create mode 100644 test/JDBC/expected/TestDatatypeAggSort-vu-verify.out create mode 100644 test/JDBC/expected/TestDatatypeAggSort.out create mode 100644 test/JDBC/input/datatypes/TestDatatypeAggSort-vu-cleanup.sql create mode 100644 test/JDBC/input/datatypes/TestDatatypeAggSort-vu-prepare.sql create mode 100644 test/JDBC/input/datatypes/TestDatatypeAggSort-vu-verify.sql create mode 100644 test/JDBC/input/datatypes/TestDatatypeAggSort.sql diff --git a/contrib/babelfishpg_common/sql/bpchar.sql b/contrib/babelfishpg_common/sql/bpchar.sql index e8c3226004..8398a7fca8 100644 --- a/contrib/babelfishpg_common/sql/bpchar.sql +++ b/contrib/babelfishpg_common/sql/bpchar.sql @@ -294,6 +294,7 @@ CREATE OR REPLACE AGGREGATE sys.max(sys.BPCHAR) sfunc = sys.bpchar_larger, stype = sys.bpchar, combinefunc = sys.bpchar_larger, + sortop = >, parallel = safe ); @@ -302,6 +303,7 @@ CREATE OR REPLACE AGGREGATE sys.min(sys.BPCHAR) sfunc = sys.bpchar_smaller, stype = sys.bpchar, combinefunc = sys.bpchar_smaller, + sortop = <, parallel = safe ); diff --git a/contrib/babelfishpg_common/sql/datetime.sql b/contrib/babelfishpg_common/sql/datetime.sql index cd0db391bb..99598da055 100644 --- a/contrib/babelfishpg_common/sql/datetime.sql +++ b/contrib/babelfishpg_common/sql/datetime.sql @@ -152,6 +152,7 @@ CREATE OR REPLACE AGGREGATE sys.max(sys.DATETIME) sfunc = sys.datetime_larger, stype = sys.datetime, combinefunc = sys.datetime_larger, + sortop = >, parallel = safe ); @@ -160,6 +161,7 @@ CREATE OR REPLACE AGGREGATE sys.min(sys.DATETIME) sfunc = sys.datetime_smaller, stype = sys.datetime, combinefunc = sys.datetime_smaller, + sortop = <, parallel = safe ); @@ -564,4 +566,4 @@ LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE; CREATE OR REPLACE FUNCTION sys.datetime_to_numeric(IN arg sys.DATETIME) RETURNS NUMERIC AS 'babelfishpg_common', 'datetime_to_numeric' -LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE; \ No newline at end of file +LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE; diff --git a/contrib/babelfishpg_common/sql/datetime2.sql b/contrib/babelfishpg_common/sql/datetime2.sql index 01e554d0b7..a007f09ee4 100644 --- a/contrib/babelfishpg_common/sql/datetime2.sql +++ b/contrib/babelfishpg_common/sql/datetime2.sql @@ -176,6 +176,7 @@ CREATE OR REPLACE AGGREGATE sys.max(sys.DATETIME2) sfunc = sys.datetime2_larger, stype = sys.datetime2, combinefunc = sys.datetime2_larger, + sortop = >, parallel = safe ); @@ -184,6 +185,7 @@ CREATE OR REPLACE AGGREGATE sys.min(sys.DATETIME2) sfunc = sys.datetime2_smaller, stype = sys.datetime2, combinefunc = sys.datetime2_smaller, + sortop = <, parallel = safe ); diff --git a/contrib/babelfishpg_common/sql/datetimeoffset.sql b/contrib/babelfishpg_common/sql/datetimeoffset.sql index 616b1b53c1..213916480c 100644 --- a/contrib/babelfishpg_common/sql/datetimeoffset.sql +++ b/contrib/babelfishpg_common/sql/datetimeoffset.sql @@ -218,6 +218,7 @@ CREATE OR REPLACE AGGREGATE sys.max(sys.DATETIMEOFFSET) sfunc = sys.datetimeoffset_larger, stype = sys.datetimeoffset, combinefunc = sys.datetimeoffset_larger, + sortop = >, parallel = safe ); @@ -226,6 +227,7 @@ CREATE OR REPLACE AGGREGATE sys.min(sys.DATETIMEOFFSET) sfunc = sys.datetimeoffset_smaller, stype = sys.datetimeoffset, combinefunc = sys.datetimeoffset_smaller, + sortop = <, parallel = safe ); diff --git a/contrib/babelfishpg_common/sql/smalldatetime.sql b/contrib/babelfishpg_common/sql/smalldatetime.sql index fd5a381810..5143f46aa0 100644 --- a/contrib/babelfishpg_common/sql/smalldatetime.sql +++ b/contrib/babelfishpg_common/sql/smalldatetime.sql @@ -152,6 +152,7 @@ CREATE OR REPLACE AGGREGATE sys.max(sys.SMALLDATETIME) sfunc = sys.smalldatetime_larger, stype = sys.smalldatetime, combinefunc = sys.smalldatetime_larger, + sortop = >, parallel = safe ); @@ -160,6 +161,7 @@ CREATE OR REPLACE AGGREGATE sys.min(sys.SMALLDATETIME) sfunc = sys.smalldatetime_smaller, stype = sys.smalldatetime, combinefunc = sys.smalldatetime_smaller, + sortop = <, parallel = safe ); @@ -762,4 +764,4 @@ LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE; CREATE OR REPLACE FUNCTION sys.smalldatetime_to_numeric(IN arg sys.SMALLDATETIME) RETURNS NUMERIC AS 'babelfishpg_common', 'smalldatetime_to_numeric' -LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE; \ No newline at end of file +LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE; diff --git a/contrib/babelfishpg_common/sql/upgrades/babelfish_common_helper--3.2.0--3.3.0.sql b/contrib/babelfishpg_common/sql/upgrades/babelfish_common_helper--3.2.0--3.3.0.sql index 0b8b686a26..8ade088b86 100644 --- a/contrib/babelfishpg_common/sql/upgrades/babelfish_common_helper--3.2.0--3.3.0.sql +++ b/contrib/babelfishpg_common/sql/upgrades/babelfish_common_helper--3.2.0--3.3.0.sql @@ -1,3 +1,126 @@ ------------------------------------------------------------------------------ ---- Include changes related to other datatypes except spatial types here ---- ------------------------------------------------------------------------------ + +-- complain if script is sourced in psql, rather than via ALTER EXTENSION +\echo Use "ALTER EXTENSION ""babelfishpg_common"" UPDATE TO "3.3.0"" to load this file. \quit + +SELECT set_config('search_path', 'sys, '||current_setting('search_path'), false); + +-- Add SORTOP for aggregations +-- bpchar +CREATE OR REPLACE AGGREGATE sys.max(sys.BPCHAR) +( + sfunc = sys.bpchar_larger, + stype = sys.bpchar, + combinefunc = sys.bpchar_larger, + sortop = >, + parallel = safe +); + +CREATE OR REPLACE AGGREGATE sys.min(sys.BPCHAR) +( + sfunc = sys.bpchar_smaller, + stype = sys.bpchar, + combinefunc = sys.bpchar_smaller, + sortop = <, + parallel = safe +); + +-- varchar +CREATE OR REPLACE AGGREGATE sys.max(sys.VARCHAR) +( + sfunc = sys.varchar_larger, + stype = sys.varchar, + combinefunc = sys.varchar_larger, + sortop = >, + parallel = safe +); + +CREATE OR REPLACE AGGREGATE sys.min(sys.VARCHAR) +( + sfunc = sys.varchar_smaller, + stype = sys.varchar, + combinefunc = sys.varchar_smaller, + sortop = <, + parallel = safe +); + +-- datetime +CREATE OR REPLACE AGGREGATE sys.max(sys.DATETIME) +( + sfunc = sys.datetime_larger, + stype = sys.datetime, + combinefunc = sys.datetime_larger, + sortop = >, + parallel = safe +); + +CREATE OR REPLACE AGGREGATE sys.min(sys.DATETIME) +( + sfunc = sys.datetime_smaller, + stype = sys.datetime, + combinefunc = sys.datetime_smaller, + sortop = <, + parallel = safe +); + +-- datetime2 +CREATE OR REPLACE AGGREGATE sys.max(sys.DATETIME2) +( + sfunc = sys.datetime2_larger, + stype = sys.datetime2, + combinefunc = sys.datetime2_larger, + sortop = >, + parallel = safe +); + +CREATE OR REPLACE AGGREGATE sys.min(sys.DATETIME2) +( + sfunc = sys.datetime2_smaller, + stype = sys.datetime2, + combinefunc = sys.datetime2_smaller, + sortop = <, + parallel = safe +); + +-- datetimeoffset +CREATE OR REPLACE AGGREGATE sys.max(sys.DATETIMEOFFSET) +( + sfunc = sys.datetimeoffset_larger, + stype = sys.datetimeoffset, + combinefunc = sys.datetimeoffset_larger, + sortop = >, + parallel = safe +); + +CREATE OR REPLACE AGGREGATE sys.min(sys.DATETIMEOFFSET) +( + sfunc = sys.datetimeoffset_smaller, + stype = sys.datetimeoffset, + combinefunc = sys.datetimeoffset_smaller, + sortop = <, + parallel = safe +); + +-- smalldatetime +CREATE OR REPLACE AGGREGATE sys.max(sys.SMALLDATETIME) +( + sfunc = sys.smalldatetime_larger, + stype = sys.smalldatetime, + combinefunc = sys.smalldatetime_larger, + sortop = >, + parallel = safe +); + +CREATE OR REPLACE AGGREGATE sys.min(sys.SMALLDATETIME) +( + sfunc = sys.smalldatetime_smaller, + stype = sys.smalldatetime, + combinefunc = sys.smalldatetime_smaller, + sortop = <, + parallel = safe +); + +-- Reset search_path to not affect any subsequent scripts +SELECT set_config('search_path', trim(leading 'sys, ' from current_setting('search_path')), false); diff --git a/contrib/babelfishpg_common/sql/varchar.sql b/contrib/babelfishpg_common/sql/varchar.sql index 9058330f2b..7319ec8427 100644 --- a/contrib/babelfishpg_common/sql/varchar.sql +++ b/contrib/babelfishpg_common/sql/varchar.sql @@ -240,6 +240,7 @@ CREATE OR REPLACE AGGREGATE sys.max(sys.VARCHAR) sfunc = sys.varchar_larger, stype = sys.varchar, combinefunc = sys.varchar_larger, + sortop = >, parallel = safe ); @@ -248,6 +249,7 @@ CREATE OR REPLACE AGGREGATE sys.min(sys.VARCHAR) sfunc = sys.varchar_smaller, stype = sys.varchar, combinefunc = sys.varchar_smaller, + sortop = <, parallel = safe ); diff --git a/test/JDBC/expected/TestDatatypeAggSort-vu-cleanup.out b/test/JDBC/expected/TestDatatypeAggSort-vu-cleanup.out new file mode 100644 index 0000000000..41de6d5c51 --- /dev/null +++ b/test/JDBC/expected/TestDatatypeAggSort-vu-cleanup.out @@ -0,0 +1,33 @@ +DROP VIEW TestDatatypeAggSort_vu_prepare_char_view_max +go +DROP VIEW TestDatatypeAggSort_vu_prepare_char_view_min +go +DROP VIEW TestDatatypeAggSort_vu_prepare_varchar_view_max +go +DROP VIEW TestDatatypeAggSort_vu_prepare_varchar_view_min +go +DROP VIEW TestDatatypeAggSort_vu_prepare_datetime_view_max +go +DROP VIEW TestDatatypeAggSort_vu_prepare_datetime_view_min +go +DROP VIEW TestDatatypeAggSort_vu_prepare_datetime2_view_max +go +DROP VIEW TestDatatypeAggSort_vu_prepare_datetime2_view_min +go +DROP VIEW TestDatatypeAggSort_vu_prepare_datetimeoffset_view_max +go +DROP VIEW TestDatatypeAggSort_vu_prepare_datetimeoffset_view_min +go +DROP VIEW TestDatatypeAggSort_vu_prepare_smalldatetime_view_max +go +DROP VIEW TestDatatypeAggSort_vu_prepare_smalldatetime_view_min +go + +DROP PROCEDURE TestDatatypeAggSort_vu_prepare_proc +go + +DROP TABLE TestDatatypeAggSort_vu_prepare_tbl +go + +DROP TABLE TestDatatypeAggSort_vu_prepare_tbl2 +go diff --git a/test/JDBC/expected/TestDatatypeAggSort-vu-prepare.out b/test/JDBC/expected/TestDatatypeAggSort-vu-prepare.out new file mode 100644 index 0000000000..e1c6d2c43b --- /dev/null +++ b/test/JDBC/expected/TestDatatypeAggSort-vu-prepare.out @@ -0,0 +1,165 @@ +CREATE TABLE TestDatatypeAggSort_vu_prepare_tbl ( + char_col CHAR(10), + varchar_col VARCHAR(10), + datetime_col DATETIME, + datetime2_col DATETIME2, + datetimeoffset_col DATETIMEOFFSET, + smalldatetime_col SMALLDATETIME, +); +go + +INSERT INTO TestDatatypeAggSort_vu_prepare_tbl VALUES ( + 'abc', 'abc', + '1900-01-01 00:00:00.000', + '1900-01-01 00:00:00.000', + '1900-01-01 00:00:00.000 +0:00', + '1900-01-01 00:00:00.000' +), ( + 'def', 'def', + '1950-01-01 00:00:00.000', + '1950-01-01 00:00:00.000', + '1950-01-01 00:00:00.000 +0:00', + '1950-01-01 00:00:00.000' +), ( + 'ghi', 'ghi', + '2000-01-01 00:00:00.000', + '2000-01-01 00:00:00.000', + '2000-01-01 00:00:00.000 +0:00', + '2000-01-01 00:00:00.000' +), ( + 'jkl', 'jkl', + '2005-01-01 00:00:00.000', + '2005-01-01 00:00:00.000', + '2005-01-01 00:00:00.000 +0:00', + '2005-01-01 00:00:00.000' +), ( + 'mno', 'mno', + '2010-01-01 00:00:00.000', + '2010-01-01 00:00:00.000', + '2010-01-01 00:00:00.000 +0:00', + '2010-01-01 00:00:00.000' +), ( + 'pqr', 'pqr', + '2015-01-01 00:00:00.000', + '2015-01-01 00:00:00.000', + '2015-01-01 00:00:00.000 +0:00', + '2015-01-01 00:00:00.000' +), ( + 'stu', 'stu', + '2020-01-01 00:00:00.000', + '2020-01-01 00:00:00.000', + '2020-01-01 00:00:00.000 +0:00', + '2020-01-01 00:00:00.000' +), ( + 'xyz', 'xyz', + '2023-11-06 00:00:00.000', + '2023-11-06 00:00:00.000', + '2023-11-06 00:00:00.000 +0:00', + '2023-11-06 00:00:00.000' +), ( + NULL, NULL, NULL, NULL, NULL, NULL +); +go +~~ROW COUNT: 9~~ + + +CREATE INDEX TestDatatypeAggSort_vu_prepare_char_idx ON TestDatatypeAggSort_vu_prepare_tbl (char_col) +go +CREATE INDEX TestDatatypeAggSort_vu_prepare_varchar_idx ON TestDatatypeAggSort_vu_prepare_tbl (varchar_col) +go +CREATE INDEX TestDatatypeAggSort_vu_prepare_datetime_idx ON TestDatatypeAggSort_vu_prepare_tbl (datetime_col) +go +CREATE INDEX TestDatatypeAggSort_vu_prepare_datetime2_idx ON TestDatatypeAggSort_vu_prepare_tbl (datetime2_col) +go +CREATE INDEX TestDatatypeAggSort_vu_prepare_datetimeoffset_idx ON TestDatatypeAggSort_vu_prepare_tbl (datetimeoffset_col) +go +CREATE INDEX TestDatatypeAggSort_vu_prepare_smalldatetime_idx ON TestDatatypeAggSort_vu_prepare_tbl (smalldatetime_col) +go + +CREATE VIEW TestDatatypeAggSort_vu_prepare_char_view_max AS +SELECT MAX(char_col) FROM TestDatatypeAggSort_vu_prepare_tbl +go +CREATE VIEW TestDatatypeAggSort_vu_prepare_char_view_min AS +SELECT MIN(char_col) FROM TestDatatypeAggSort_vu_prepare_tbl +go + +CREATE VIEW TestDatatypeAggSort_vu_prepare_varchar_view_max AS +SELECT MAX(varchar_col) FROM TestDatatypeAggSort_vu_prepare_tbl +go +CREATE VIEW TestDatatypeAggSort_vu_prepare_varchar_view_min AS +SELECT MIN(varchar_col) FROM TestDatatypeAggSort_vu_prepare_tbl +go + +CREATE VIEW TestDatatypeAggSort_vu_prepare_datetime_view_max AS +SELECT MAX(datetime_col) FROM TestDatatypeAggSort_vu_prepare_tbl +go +CREATE VIEW TestDatatypeAggSort_vu_prepare_datetime_view_min AS +SELECT MIN(datetime_col) FROM TestDatatypeAggSort_vu_prepare_tbl +go + +CREATE VIEW TestDatatypeAggSort_vu_prepare_datetime2_view_max AS +SELECT MAX(datetime2_col) FROM TestDatatypeAggSort_vu_prepare_tbl +go +CREATE VIEW TestDatatypeAggSort_vu_prepare_datetime2_view_min AS +SELECT MIN(datetime2_col) FROM TestDatatypeAggSort_vu_prepare_tbl +go + +CREATE VIEW TestDatatypeAggSort_vu_prepare_datetimeoffset_view_max AS +SELECT MAX(datetimeoffset_col) FROM TestDatatypeAggSort_vu_prepare_tbl +go +CREATE VIEW TestDatatypeAggSort_vu_prepare_datetimeoffset_view_min AS +SELECT MIN(datetimeoffset_col) FROM TestDatatypeAggSort_vu_prepare_tbl +go + +CREATE VIEW TestDatatypeAggSort_vu_prepare_smalldatetime_view_max AS +SELECT MAX(smalldatetime_col) FROM TestDatatypeAggSort_vu_prepare_tbl +go +CREATE VIEW TestDatatypeAggSort_vu_prepare_smalldatetime_view_min AS +SELECT MIN(smalldatetime_col) FROM TestDatatypeAggSort_vu_prepare_tbl +go + +CREATE TABLE TestDatatypeAggSort_vu_prepare_tbl2 ( + max_min VARCHAR(3), + char_col CHAR(10), + varchar_col VARCHAR(10), + datetime_col DATETIME, + datetime2_col DATETIME2(6), + datetimeoffset_col DATETIMEOFFSET, + smalldatetime_col SMALLDATETIME, +); +go + + + + + +CREATE PROCEDURE TestDatatypeAggSort_vu_prepare_proc AS +BEGIN + DECLARE @char_val CHAR(10) + DECLARE @varchar_val VARCHAR(10) + DECLARE @datetime_val DATETIME + DECLARE @datetime2_val DATETIME2 + DECLARE @datetimeoffset_val DATETIMEOFFSET + DECLARE @smalldatetime_val SMALLDATETIME + SET @char_val = (SELECT MAX(char_col) FROM TestDatatypeAggSort_vu_prepare_tbl) + SET @varchar_val = (SELECT MAX(varchar_col) FROM TestDatatypeAggSort_vu_prepare_tbl) + SET @datetime_val = (SELECT MAX(datetime_col) FROM TestDatatypeAggSort_vu_prepare_tbl) + SET @datetime2_val = (SELECT MAX(datetime2_col) FROM TestDatatypeAggSort_vu_prepare_tbl) + SET @datetimeoffset_val = (SELECT MAX(datetimeoffset_col) FROM TestDatatypeAggSort_vu_prepare_tbl) + SET @smalldatetime_val = (SELECT MAX(smalldatetime_col) FROM TestDatatypeAggSort_vu_prepare_tbl) + INSERT INTO TestDatatypeAggSort_vu_prepare_tbl2 VALUES ( + 'max', @char_val, @varchar_val, @datetime_val, @datetime2_val, + @datetimeoffset_val, @smalldatetime_val + ) + SET @char_val = (SELECT MIN(char_col) FROM TestDatatypeAggSort_vu_prepare_tbl) + SET @varchar_val = (SELECT MIN(varchar_col) FROM TestDatatypeAggSort_vu_prepare_tbl) + SET @datetime_val = (SELECT MIN(datetime_col) FROM TestDatatypeAggSort_vu_prepare_tbl) + SET @datetime2_val = (SELECT MIN(datetime2_col) FROM TestDatatypeAggSort_vu_prepare_tbl) + SET @datetimeoffset_val = (SELECT MIN(datetimeoffset_col) FROM TestDatatypeAggSort_vu_prepare_tbl) + SET @smalldatetime_val = (SELECT MIN(smalldatetime_col) FROM TestDatatypeAggSort_vu_prepare_tbl) + INSERT INTO TestDatatypeAggSort_vu_prepare_tbl2 VALUES ( + 'min', @char_val, @varchar_val, @datetime_val, @datetime2_val, + @datetimeoffset_val, @smalldatetime_val + ) +END +go diff --git a/test/JDBC/expected/TestDatatypeAggSort-vu-verify.out b/test/JDBC/expected/TestDatatypeAggSort-vu-verify.out new file mode 100644 index 0000000000..c171e22f8a --- /dev/null +++ b/test/JDBC/expected/TestDatatypeAggSort-vu-verify.out @@ -0,0 +1,192 @@ +SELECT * FROM TestDatatypeAggSort_vu_prepare_char_view_max +go +~~ERROR (Code: 33557097)~~ + +~~ERROR (Message: The string size for the given CHAR/NCHAR data is not defined. Please use an explicit CAST or CONVERT to CHAR(n)/NCHAR(n))~~ + +SELECT * FROM TestDatatypeAggSort_vu_prepare_char_view_min +go +~~ERROR (Code: 33557097)~~ + +~~ERROR (Message: The string size for the given CHAR/NCHAR data is not defined. Please use an explicit CAST or CONVERT to CHAR(n)/NCHAR(n))~~ + + +SELECT * FROM TestDatatypeAggSort_vu_prepare_varchar_view_max +go +~~START~~ +varchar +xyz +~~END~~ + +SELECT * FROM TestDatatypeAggSort_vu_prepare_varchar_view_min +go +~~START~~ +varchar +abc +~~END~~ + + +SELECT * FROM TestDatatypeAggSort_vu_prepare_datetime_view_max +go +~~START~~ +datetime +2023-11-06 00:00:00.0 +~~END~~ + +SELECT * FROM TestDatatypeAggSort_vu_prepare_datetime_view_min +go +~~START~~ +datetime +1900-01-01 00:00:00.0 +~~END~~ + + +SELECT * FROM TestDatatypeAggSort_vu_prepare_datetime2_view_max +go +~~START~~ +datetime2 +2023-11-06 00:00:00.0000000 +~~END~~ + +SELECT * FROM TestDatatypeAggSort_vu_prepare_datetime2_view_min +go +~~START~~ +datetime2 +1900-01-01 00:00:00.0000000 +~~END~~ + + +SELECT * FROM TestDatatypeAggSort_vu_prepare_datetimeoffset_view_max +go +~~START~~ +datetimeoffset +2023-11-06 00:00:00.0000000 +00:00 +~~END~~ + +SELECT * FROM TestDatatypeAggSort_vu_prepare_datetimeoffset_view_min +go +~~START~~ +datetimeoffset +1900-01-01 00:00:00.0000000 +00:00 +~~END~~ + + +SELECT * FROM TestDatatypeAggSort_vu_prepare_smalldatetime_view_max +go +~~START~~ +smalldatetime +2023-11-06 00:00:00.0 +~~END~~ + +SELECT * FROM TestDatatypeAggSort_vu_prepare_smalldatetime_view_min +go +~~START~~ +smalldatetime +1900-01-01 00:00:00.0 +~~END~~ + + +EXEC TestDatatypeAggSort_vu_prepare_proc +go +~~ROW COUNT: 1~~ + +~~ROW COUNT: 1~~ + + +SELECT * FROM TestDatatypeAggSort_vu_prepare_tbl2 ORDER BY max_min +go +~~START~~ +varchar#!#char#!#varchar#!#datetime#!#datetime2#!#datetimeoffset#!#smalldatetime +max#!#xyz #!#xyz#!#2023-11-06 00:00:00.0#!#2023-11-06 00:00:00.000000#!#2023-11-06 00:00:00.0000000 +00:00#!#2023-11-06 00:00:00.0 +min#!#abc #!#abc#!#1900-01-01 00:00:00.0#!#1900-01-01 00:00:00.000000#!#1900-01-01 00:00:00.0000000 +00:00#!#1900-01-01 00:00:00.0 +~~END~~ + + +-- This is failing because of BABEL-4332 +SELECT MAX(char_col) FROM TestDatatypeAggSort_vu_prepare_tbl WHERE varchar_col <= 'xxx' +go +~~ERROR (Code: 33557097)~~ + +~~ERROR (Message: The string size for the given CHAR/NCHAR data is not defined. Please use an explicit CAST or CONVERT to CHAR(n)/NCHAR(n))~~ + +SELECT MIN(char_col) FROM TestDatatypeAggSort_vu_prepare_tbl WHERE varchar_col <= 'xxx' +go +~~ERROR (Code: 33557097)~~ + +~~ERROR (Message: The string size for the given CHAR/NCHAR data is not defined. Please use an explicit CAST or CONVERT to CHAR(n)/NCHAR(n))~~ + + +SELECT MAX(varchar_col) FROM TestDatatypeAggSort_vu_prepare_tbl WHERE varchar_col <= 'xxx' +go +~~START~~ +varchar +stu +~~END~~ + +SELECT MIN(varchar_col) FROM TestDatatypeAggSort_vu_prepare_tbl WHERE varchar_col > 'xxx' +go +~~START~~ +varchar +xyz +~~END~~ + + +SELECT MAX(datetime_col) FROM TestDatatypeAggSort_vu_prepare_tbl WHERE datetime_col <= '2020-12-31 23:59:59' +go +~~START~~ +datetime +2020-01-01 00:00:00.0 +~~END~~ + +SELECT MIN(datetime_col) FROM TestDatatypeAggSort_vu_prepare_tbl WHERE datetime_col > '2020-12-31 23:59:59' +go +~~START~~ +datetime +2023-11-06 00:00:00.0 +~~END~~ + + +SELECT MAX(datetime2_col) FROM TestDatatypeAggSort_vu_prepare_tbl WHERE datetime2_col <= '2020-12-31 23:59:59' +go +~~START~~ +datetime2 +2020-01-01 00:00:00.0000000 +~~END~~ + +SELECT MIN(datetime2_col) FROM TestDatatypeAggSort_vu_prepare_tbl WHERE datetime2_col > '2020-12-31 23:59:59' +go +~~START~~ +datetime2 +2023-11-06 00:00:00.0000000 +~~END~~ + + +SELECT MAX(datetimeoffset_col) FROM TestDatatypeAggSort_vu_prepare_tbl WHERE datetimeoffset_col <= '2020-12-31 23:59:59' +go +~~START~~ +datetimeoffset +2020-01-01 00:00:00.0000000 +00:00 +~~END~~ + +SELECT MIN(datetimeoffset_col) FROM TestDatatypeAggSort_vu_prepare_tbl WHERE datetimeoffset_col > '2020-12-31 23:59:59' +go +~~START~~ +datetimeoffset +2023-11-06 00:00:00.0000000 +00:00 +~~END~~ + + +SELECT MAX(smalldatetime_col) FROM TestDatatypeAggSort_vu_prepare_tbl WHERE smalldatetime_col <= '2020-12-31 23:59:59' +go +~~START~~ +smalldatetime +2020-01-01 00:00:00.0 +~~END~~ + +SELECT MIN(smalldatetime_col) FROM TestDatatypeAggSort_vu_prepare_tbl WHERE smalldatetime_col > '2020-12-31 23:59:59' +go +~~START~~ +smalldatetime +2023-11-06 00:00:00.0 +~~END~~ + diff --git a/test/JDBC/expected/TestDatatypeAggSort.out b/test/JDBC/expected/TestDatatypeAggSort.out new file mode 100644 index 0000000000..1b59b13a47 --- /dev/null +++ b/test/JDBC/expected/TestDatatypeAggSort.out @@ -0,0 +1,259 @@ +-- MAX/MIN functionality already verified in upgrade scripts. +-- This test mainly focuses on query plans. +CREATE TABLE TestDatatypeAggSort_tbl ( + char_col CHAR(10), + varchar_col VARCHAR(10), + datetime_col DATETIME, + datetime2_col DATETIME2, + datetimeoffset_col DATETIMEOFFSET, + smalldatetime_col SMALLDATETIME, +); +go + +INSERT INTO TestDatatypeAggSort_tbl VALUES ( + 'abc', 'abc', + '1900-01-01 00:00:00.000', + '1900-01-01 00:00:00.000', + '1900-01-01 00:00:00.000 +0:00', + '1900-01-01 00:00:00.000' +), ( + 'def', 'def', + '1950-01-01 00:00:00.000', + '1950-01-01 00:00:00.000', + '1950-01-01 00:00:00.000 +0:00', + '1950-01-01 00:00:00.000' +), ( + 'ghi', 'ghi', + '2000-01-01 00:00:00.000', + '2000-01-01 00:00:00.000', + '2000-01-01 00:00:00.000 +0:00', + '2000-01-01 00:00:00.000' +), ( + 'jkl', 'jkl', + '2005-01-01 00:00:00.000', + '2005-01-01 00:00:00.000', + '2005-01-01 00:00:00.000 +0:00', + '2005-01-01 00:00:00.000' +), ( + 'mno', 'mno', + '2010-01-01 00:00:00.000', + '2010-01-01 00:00:00.000', + '2010-01-01 00:00:00.000 +0:00', + '2010-01-01 00:00:00.000' +), ( + 'pqr', 'pqr', + '2015-01-01 00:00:00.000', + '2015-01-01 00:00:00.000', + '2015-01-01 00:00:00.000 +0:00', + '2015-01-01 00:00:00.000' +), ( + 'stu', 'stu', + '2020-01-01 00:00:00.000', + '2020-01-01 00:00:00.000', + '2020-01-01 00:00:00.000 +0:00', + '2020-01-01 00:00:00.000' +), ( + 'xyz', 'xyz', + '2023-11-06 00:00:00.000', + '2023-11-06 00:00:00.000', + '2023-11-06 00:00:00.000 +0:00', + '2023-11-06 00:00:00.000' +), ( + NULL, NULL, NULL, NULL, NULL, NULL +); +go +~~ROW COUNT: 9~~ + + +CREATE INDEX TestDatatypeAggSort_vu_prepare_char_idx ON TestDatatypeAggSort_tbl (char_col) +go +CREATE INDEX TestDatatypeAggSort_vu_prepare_varchar_idx ON TestDatatypeAggSort_tbl (varchar_col) +go +CREATE INDEX TestDatatypeAggSort_vu_prepare_datetime_idx ON TestDatatypeAggSort_tbl (datetime_col) +go +CREATE INDEX TestDatatypeAggSort_vu_prepare_datetime2_idx ON TestDatatypeAggSort_tbl (datetime2_col) +go +CREATE INDEX TestDatatypeAggSort_vu_prepare_datetimeoffset_idx ON TestDatatypeAggSort_tbl (datetimeoffset_col) +go +CREATE INDEX TestDatatypeAggSort_vu_prepare_smalldatetime_idx ON TestDatatypeAggSort_tbl (smalldatetime_col) +go + + +-- Check query plans, all aggregations should be optimized +-- into LIMIT + index scan. +SELECT set_config('enable_seqscan', 'off', false) +go +~~START~~ +text +off +~~END~~ + +SET babelfish_showplan_all ON +go + +-- This is failing because of BABEL-4332 +SELECT MAX(char_col) FROM TestDatatypeAggSort_tbl WHERE varchar_col <= 'xxx' +go +~~START~~ +text +Query Text: SELECT MAX(char_col) FROM TestDatatypeAggSort_tbl WHERE varchar_col <= 'xxx' +Result (cost=4.20..4.21 rows=1 width=32) + InitPlan 1 (returns $0) + -> Limit (cost=0.14..4.20 rows=1 width=32) + -> Index Scan Backward using testdatatypeaggsort_vu_prepare_9f6822e2eb25acd99239dfd749f4cfac on testdatatypeaggsort_tbl (cost=0.14..12.32 rows=3 width=32) + Index Cond: (char_col IS NOT NULL) + Filter: (varchar_col <= 'xxx'::"varchar") +~~END~~ + +SELECT MIN(char_col) FROM TestDatatypeAggSort_tbl WHERE varchar_col <= 'xxx' +go +~~START~~ +text +Query Text: SELECT MIN(char_col) FROM TestDatatypeAggSort_tbl WHERE varchar_col <= 'xxx' +Result (cost=4.20..4.21 rows=1 width=32) + InitPlan 1 (returns $0) + -> Limit (cost=0.14..4.20 rows=1 width=32) + -> Index Scan using testdatatypeaggsort_vu_prepare_9f6822e2eb25acd99239dfd749f4cfac on testdatatypeaggsort_tbl (cost=0.14..12.32 rows=3 width=32) + Index Cond: (char_col IS NOT NULL) + Filter: (varchar_col <= 'xxx'::"varchar") +~~END~~ + + +SELECT MAX(varchar_col) FROM TestDatatypeAggSort_tbl WHERE varchar_col <= 'xxx' +go +~~START~~ +text +Query Text: SELECT MAX(varchar_col) FROM TestDatatypeAggSort_tbl WHERE varchar_col <= 'xxx' +Result (cost=2.82..2.83 rows=1 width=32) + InitPlan 1 (returns $0) + -> Limit (cost=0.14..2.82 rows=1 width=32) + -> Index Only Scan Backward using testdatatypeaggsort_vu_prepare_dff2a180daa5e768372a6667d7a1d8ce on testdatatypeaggsort_tbl (cost=0.14..8.20 rows=3 width=32) + Index Cond: ((varchar_col IS NOT NULL) AND (varchar_col <= 'xxx'::"varchar")) +~~END~~ + +SELECT MIN(varchar_col) FROM TestDatatypeAggSort_tbl WHERE varchar_col > 'xxx' +go +~~START~~ +text +Query Text: SELECT MIN(varchar_col) FROM TestDatatypeAggSort_tbl WHERE varchar_col > 'xxx' +Result (cost=2.82..2.83 rows=1 width=32) + InitPlan 1 (returns $0) + -> Limit (cost=0.14..2.82 rows=1 width=32) + -> Index Only Scan using testdatatypeaggsort_vu_prepare_dff2a180daa5e768372a6667d7a1d8ce on testdatatypeaggsort_tbl (cost=0.14..8.20 rows=3 width=32) + Index Cond: ((varchar_col IS NOT NULL) AND (varchar_col > 'xxx'::"varchar")) +~~END~~ + + +SELECT MAX(datetime_col) FROM TestDatatypeAggSort_tbl WHERE datetime_col <= '2020-12-31 23:59:59' +go +~~START~~ +text +Query Text: SELECT MAX(datetime_col) FROM TestDatatypeAggSort_tbl WHERE datetime_col <= '2020-12-31 23:59:59' +Result (cost=2.82..2.83 rows=1 width=8) + InitPlan 1 (returns $0) + -> Limit (cost=0.14..2.82 rows=1 width=8) + -> Index Only Scan Backward using testdatatypeaggsort_vu_prepare_53652fadbb7f0d803cf631ae1666db91 on testdatatypeaggsort_tbl (cost=0.14..8.20 rows=3 width=8) + Index Cond: ((datetime_col IS NOT NULL) AND (datetime_col <= '2020-12-31 23:59:59'::datetime)) +~~END~~ + +SELECT MIN(datetime_col) FROM TestDatatypeAggSort_tbl WHERE datetime_col > '2020-12-31 23:59:59' +go +~~START~~ +text +Query Text: SELECT MIN(datetime_col) FROM TestDatatypeAggSort_tbl WHERE datetime_col > '2020-12-31 23:59:59' +Result (cost=2.82..2.83 rows=1 width=8) + InitPlan 1 (returns $0) + -> Limit (cost=0.14..2.82 rows=1 width=8) + -> Index Only Scan using testdatatypeaggsort_vu_prepare_53652fadbb7f0d803cf631ae1666db91 on testdatatypeaggsort_tbl (cost=0.14..8.20 rows=3 width=8) + Index Cond: ((datetime_col IS NOT NULL) AND (datetime_col > '2020-12-31 23:59:59'::datetime)) +~~END~~ + + +SELECT MAX(datetime2_col) FROM TestDatatypeAggSort_tbl WHERE datetime2_col <= '2020-12-31 23:59:59' +go +~~START~~ +text +Query Text: SELECT MAX(datetime2_col) FROM TestDatatypeAggSort_tbl WHERE datetime2_col <= '2020-12-31 23:59:59' +Result (cost=2.82..2.83 rows=1 width=8) + InitPlan 1 (returns $0) + -> Limit (cost=0.14..2.82 rows=1 width=8) + -> Index Only Scan Backward using testdatatypeaggsort_vu_prepare_d78d2b8ac3008da9348dd6b7d05cad53 on testdatatypeaggsort_tbl (cost=0.14..8.20 rows=3 width=8) + Index Cond: ((datetime2_col IS NOT NULL) AND (datetime2_col <= '2020-12-31 23:59:59'::datetime2)) +~~END~~ + +SELECT MIN(datetime2_col) FROM TestDatatypeAggSort_tbl WHERE datetime2_col > '2020-12-31 23:59:59' +go +~~START~~ +text +Query Text: SELECT MIN(datetime2_col) FROM TestDatatypeAggSort_tbl WHERE datetime2_col > '2020-12-31 23:59:59' +Result (cost=2.82..2.83 rows=1 width=8) + InitPlan 1 (returns $0) + -> Limit (cost=0.14..2.82 rows=1 width=8) + -> Index Only Scan using testdatatypeaggsort_vu_prepare_d78d2b8ac3008da9348dd6b7d05cad53 on testdatatypeaggsort_tbl (cost=0.14..8.20 rows=3 width=8) + Index Cond: ((datetime2_col IS NOT NULL) AND (datetime2_col > '2020-12-31 23:59:59'::datetime2)) +~~END~~ + + +SELECT MAX(datetimeoffset_col) FROM TestDatatypeAggSort_tbl WHERE datetimeoffset_col <= '2020-12-31 23:59:59' +go +~~START~~ +text +Query Text: SELECT MAX(datetimeoffset_col) FROM TestDatatypeAggSort_tbl WHERE datetimeoffset_col <= '2020-12-31 23:59:59' +Result (cost=2.82..2.83 rows=1 width=10) + InitPlan 1 (returns $0) + -> Limit (cost=0.14..2.82 rows=1 width=10) + -> Index Only Scan Backward using testdatatypeaggsort_vu_prepare_4cb646591fd4a379b5280bdf8de9c3fa on testdatatypeaggsort_tbl (cost=0.14..8.20 rows=3 width=10) + Index Cond: ((datetimeoffset_col IS NOT NULL) AND (datetimeoffset_col <= '2020-12-31 23:59:59 +00:00'::datetimeoffset)) +~~END~~ + +SELECT MIN(datetimeoffset_col) FROM TestDatatypeAggSort_tbl WHERE datetimeoffset_col > '2020-12-31 23:59:59' +go +~~START~~ +text +Query Text: SELECT MIN(datetimeoffset_col) FROM TestDatatypeAggSort_tbl WHERE datetimeoffset_col > '2020-12-31 23:59:59' +Result (cost=2.82..2.83 rows=1 width=10) + InitPlan 1 (returns $0) + -> Limit (cost=0.14..2.82 rows=1 width=10) + -> Index Only Scan using testdatatypeaggsort_vu_prepare_4cb646591fd4a379b5280bdf8de9c3fa on testdatatypeaggsort_tbl (cost=0.14..8.20 rows=3 width=10) + Index Cond: ((datetimeoffset_col IS NOT NULL) AND (datetimeoffset_col > '2020-12-31 23:59:59 +00:00'::datetimeoffset)) +~~END~~ + + +SELECT MAX(smalldatetime_col) FROM TestDatatypeAggSort_tbl WHERE smalldatetime_col <= '2020-12-31 23:59:59' +go +~~START~~ +text +Query Text: SELECT MAX(smalldatetime_col) FROM TestDatatypeAggSort_tbl WHERE smalldatetime_col <= '2020-12-31 23:59:59' +Result (cost=2.82..2.83 rows=1 width=8) + InitPlan 1 (returns $0) + -> Limit (cost=0.14..2.82 rows=1 width=8) + -> Index Only Scan Backward using testdatatypeaggsort_vu_prepare_51ce5acea8bb1074b24deac240b40a7f on testdatatypeaggsort_tbl (cost=0.14..8.20 rows=3 width=8) + Index Cond: ((smalldatetime_col IS NOT NULL) AND (smalldatetime_col <= '2021-01-01 00:00:00'::smalldatetime)) +~~END~~ + +SELECT MIN(smalldatetime_col) FROM TestDatatypeAggSort_tbl WHERE smalldatetime_col > '2020-12-31 23:59:59' +go +~~START~~ +text +Query Text: SELECT MIN(smalldatetime_col) FROM TestDatatypeAggSort_tbl WHERE smalldatetime_col > '2020-12-31 23:59:59' +Result (cost=2.82..2.83 rows=1 width=8) + InitPlan 1 (returns $0) + -> Limit (cost=0.14..2.82 rows=1 width=8) + -> Index Only Scan using testdatatypeaggsort_vu_prepare_51ce5acea8bb1074b24deac240b40a7f on testdatatypeaggsort_tbl (cost=0.14..8.20 rows=3 width=8) + Index Cond: ((smalldatetime_col IS NOT NULL) AND (smalldatetime_col > '2021-01-01 00:00:00'::smalldatetime)) +~~END~~ + + +-- Reset +SET babelfish_showplan_all OFF +go +SELECT set_config('enable_seqscan', 'on', false) +go +~~START~~ +text +on +~~END~~ + + +DROP TABLE TestDatatypeAggSort_tbl +go diff --git a/test/JDBC/input/datatypes/TestDatatypeAggSort-vu-cleanup.sql b/test/JDBC/input/datatypes/TestDatatypeAggSort-vu-cleanup.sql new file mode 100644 index 0000000000..41de6d5c51 --- /dev/null +++ b/test/JDBC/input/datatypes/TestDatatypeAggSort-vu-cleanup.sql @@ -0,0 +1,33 @@ +DROP VIEW TestDatatypeAggSort_vu_prepare_char_view_max +go +DROP VIEW TestDatatypeAggSort_vu_prepare_char_view_min +go +DROP VIEW TestDatatypeAggSort_vu_prepare_varchar_view_max +go +DROP VIEW TestDatatypeAggSort_vu_prepare_varchar_view_min +go +DROP VIEW TestDatatypeAggSort_vu_prepare_datetime_view_max +go +DROP VIEW TestDatatypeAggSort_vu_prepare_datetime_view_min +go +DROP VIEW TestDatatypeAggSort_vu_prepare_datetime2_view_max +go +DROP VIEW TestDatatypeAggSort_vu_prepare_datetime2_view_min +go +DROP VIEW TestDatatypeAggSort_vu_prepare_datetimeoffset_view_max +go +DROP VIEW TestDatatypeAggSort_vu_prepare_datetimeoffset_view_min +go +DROP VIEW TestDatatypeAggSort_vu_prepare_smalldatetime_view_max +go +DROP VIEW TestDatatypeAggSort_vu_prepare_smalldatetime_view_min +go + +DROP PROCEDURE TestDatatypeAggSort_vu_prepare_proc +go + +DROP TABLE TestDatatypeAggSort_vu_prepare_tbl +go + +DROP TABLE TestDatatypeAggSort_vu_prepare_tbl2 +go diff --git a/test/JDBC/input/datatypes/TestDatatypeAggSort-vu-prepare.sql b/test/JDBC/input/datatypes/TestDatatypeAggSort-vu-prepare.sql new file mode 100644 index 0000000000..ed65e5aaa1 --- /dev/null +++ b/test/JDBC/input/datatypes/TestDatatypeAggSort-vu-prepare.sql @@ -0,0 +1,163 @@ +CREATE TABLE TestDatatypeAggSort_vu_prepare_tbl ( + char_col CHAR(10), + varchar_col VARCHAR(10), + datetime_col DATETIME, + datetime2_col DATETIME2, + datetimeoffset_col DATETIMEOFFSET, + smalldatetime_col SMALLDATETIME, +); +go + +INSERT INTO TestDatatypeAggSort_vu_prepare_tbl VALUES ( + 'abc', 'abc', + '1900-01-01 00:00:00.000', + '1900-01-01 00:00:00.000', + '1900-01-01 00:00:00.000 +0:00', + '1900-01-01 00:00:00.000' +), ( + 'def', 'def', + '1950-01-01 00:00:00.000', + '1950-01-01 00:00:00.000', + '1950-01-01 00:00:00.000 +0:00', + '1950-01-01 00:00:00.000' +), ( + 'ghi', 'ghi', + '2000-01-01 00:00:00.000', + '2000-01-01 00:00:00.000', + '2000-01-01 00:00:00.000 +0:00', + '2000-01-01 00:00:00.000' +), ( + 'jkl', 'jkl', + '2005-01-01 00:00:00.000', + '2005-01-01 00:00:00.000', + '2005-01-01 00:00:00.000 +0:00', + '2005-01-01 00:00:00.000' +), ( + 'mno', 'mno', + '2010-01-01 00:00:00.000', + '2010-01-01 00:00:00.000', + '2010-01-01 00:00:00.000 +0:00', + '2010-01-01 00:00:00.000' +), ( + 'pqr', 'pqr', + '2015-01-01 00:00:00.000', + '2015-01-01 00:00:00.000', + '2015-01-01 00:00:00.000 +0:00', + '2015-01-01 00:00:00.000' +), ( + 'stu', 'stu', + '2020-01-01 00:00:00.000', + '2020-01-01 00:00:00.000', + '2020-01-01 00:00:00.000 +0:00', + '2020-01-01 00:00:00.000' +), ( + 'xyz', 'xyz', + '2023-11-06 00:00:00.000', + '2023-11-06 00:00:00.000', + '2023-11-06 00:00:00.000 +0:00', + '2023-11-06 00:00:00.000' +), ( + NULL, NULL, NULL, NULL, NULL, NULL +); +go + +CREATE INDEX TestDatatypeAggSort_vu_prepare_char_idx ON TestDatatypeAggSort_vu_prepare_tbl (char_col) +go +CREATE INDEX TestDatatypeAggSort_vu_prepare_varchar_idx ON TestDatatypeAggSort_vu_prepare_tbl (varchar_col) +go +CREATE INDEX TestDatatypeAggSort_vu_prepare_datetime_idx ON TestDatatypeAggSort_vu_prepare_tbl (datetime_col) +go +CREATE INDEX TestDatatypeAggSort_vu_prepare_datetime2_idx ON TestDatatypeAggSort_vu_prepare_tbl (datetime2_col) +go +CREATE INDEX TestDatatypeAggSort_vu_prepare_datetimeoffset_idx ON TestDatatypeAggSort_vu_prepare_tbl (datetimeoffset_col) +go +CREATE INDEX TestDatatypeAggSort_vu_prepare_smalldatetime_idx ON TestDatatypeAggSort_vu_prepare_tbl (smalldatetime_col) +go + +CREATE VIEW TestDatatypeAggSort_vu_prepare_char_view_max AS +SELECT MAX(char_col) FROM TestDatatypeAggSort_vu_prepare_tbl +go +CREATE VIEW TestDatatypeAggSort_vu_prepare_char_view_min AS +SELECT MIN(char_col) FROM TestDatatypeAggSort_vu_prepare_tbl +go + +CREATE VIEW TestDatatypeAggSort_vu_prepare_varchar_view_max AS +SELECT MAX(varchar_col) FROM TestDatatypeAggSort_vu_prepare_tbl +go +CREATE VIEW TestDatatypeAggSort_vu_prepare_varchar_view_min AS +SELECT MIN(varchar_col) FROM TestDatatypeAggSort_vu_prepare_tbl +go + +CREATE VIEW TestDatatypeAggSort_vu_prepare_datetime_view_max AS +SELECT MAX(datetime_col) FROM TestDatatypeAggSort_vu_prepare_tbl +go +CREATE VIEW TestDatatypeAggSort_vu_prepare_datetime_view_min AS +SELECT MIN(datetime_col) FROM TestDatatypeAggSort_vu_prepare_tbl +go + +CREATE VIEW TestDatatypeAggSort_vu_prepare_datetime2_view_max AS +SELECT MAX(datetime2_col) FROM TestDatatypeAggSort_vu_prepare_tbl +go +CREATE VIEW TestDatatypeAggSort_vu_prepare_datetime2_view_min AS +SELECT MIN(datetime2_col) FROM TestDatatypeAggSort_vu_prepare_tbl +go + +CREATE VIEW TestDatatypeAggSort_vu_prepare_datetimeoffset_view_max AS +SELECT MAX(datetimeoffset_col) FROM TestDatatypeAggSort_vu_prepare_tbl +go +CREATE VIEW TestDatatypeAggSort_vu_prepare_datetimeoffset_view_min AS +SELECT MIN(datetimeoffset_col) FROM TestDatatypeAggSort_vu_prepare_tbl +go + +CREATE VIEW TestDatatypeAggSort_vu_prepare_smalldatetime_view_max AS +SELECT MAX(smalldatetime_col) FROM TestDatatypeAggSort_vu_prepare_tbl +go +CREATE VIEW TestDatatypeAggSort_vu_prepare_smalldatetime_view_min AS +SELECT MIN(smalldatetime_col) FROM TestDatatypeAggSort_vu_prepare_tbl +go + +CREATE TABLE TestDatatypeAggSort_vu_prepare_tbl2 ( + max_min VARCHAR(3), + char_col CHAR(10), + varchar_col VARCHAR(10), + datetime_col DATETIME, + datetime2_col DATETIME2(6), + datetimeoffset_col DATETIMEOFFSET, + smalldatetime_col SMALLDATETIME, +); +go + +CREATE PROCEDURE TestDatatypeAggSort_vu_prepare_proc AS +BEGIN + DECLARE @char_val CHAR(10) + DECLARE @varchar_val VARCHAR(10) + DECLARE @datetime_val DATETIME + DECLARE @datetime2_val DATETIME2 + DECLARE @datetimeoffset_val DATETIMEOFFSET + DECLARE @smalldatetime_val SMALLDATETIME + + SET @char_val = (SELECT MAX(char_col) FROM TestDatatypeAggSort_vu_prepare_tbl) + SET @varchar_val = (SELECT MAX(varchar_col) FROM TestDatatypeAggSort_vu_prepare_tbl) + SET @datetime_val = (SELECT MAX(datetime_col) FROM TestDatatypeAggSort_vu_prepare_tbl) + SET @datetime2_val = (SELECT MAX(datetime2_col) FROM TestDatatypeAggSort_vu_prepare_tbl) + SET @datetimeoffset_val = (SELECT MAX(datetimeoffset_col) FROM TestDatatypeAggSort_vu_prepare_tbl) + SET @smalldatetime_val = (SELECT MAX(smalldatetime_col) FROM TestDatatypeAggSort_vu_prepare_tbl) + + INSERT INTO TestDatatypeAggSort_vu_prepare_tbl2 VALUES ( + 'max', @char_val, @varchar_val, @datetime_val, @datetime2_val, + @datetimeoffset_val, @smalldatetime_val + ) + + SET @char_val = (SELECT MIN(char_col) FROM TestDatatypeAggSort_vu_prepare_tbl) + SET @varchar_val = (SELECT MIN(varchar_col) FROM TestDatatypeAggSort_vu_prepare_tbl) + SET @datetime_val = (SELECT MIN(datetime_col) FROM TestDatatypeAggSort_vu_prepare_tbl) + SET @datetime2_val = (SELECT MIN(datetime2_col) FROM TestDatatypeAggSort_vu_prepare_tbl) + SET @datetimeoffset_val = (SELECT MIN(datetimeoffset_col) FROM TestDatatypeAggSort_vu_prepare_tbl) + SET @smalldatetime_val = (SELECT MIN(smalldatetime_col) FROM TestDatatypeAggSort_vu_prepare_tbl) + + INSERT INTO TestDatatypeAggSort_vu_prepare_tbl2 VALUES ( + 'min', @char_val, @varchar_val, @datetime_val, @datetime2_val, + @datetimeoffset_val, @smalldatetime_val + ) +END +go diff --git a/test/JDBC/input/datatypes/TestDatatypeAggSort-vu-verify.sql b/test/JDBC/input/datatypes/TestDatatypeAggSort-vu-verify.sql new file mode 100644 index 0000000000..984cef03f7 --- /dev/null +++ b/test/JDBC/input/datatypes/TestDatatypeAggSort-vu-verify.sql @@ -0,0 +1,66 @@ +SELECT * FROM TestDatatypeAggSort_vu_prepare_char_view_max +go +SELECT * FROM TestDatatypeAggSort_vu_prepare_char_view_min +go + +SELECT * FROM TestDatatypeAggSort_vu_prepare_varchar_view_max +go +SELECT * FROM TestDatatypeAggSort_vu_prepare_varchar_view_min +go + +SELECT * FROM TestDatatypeAggSort_vu_prepare_datetime_view_max +go +SELECT * FROM TestDatatypeAggSort_vu_prepare_datetime_view_min +go + +SELECT * FROM TestDatatypeAggSort_vu_prepare_datetime2_view_max +go +SELECT * FROM TestDatatypeAggSort_vu_prepare_datetime2_view_min +go + +SELECT * FROM TestDatatypeAggSort_vu_prepare_datetimeoffset_view_max +go +SELECT * FROM TestDatatypeAggSort_vu_prepare_datetimeoffset_view_min +go + +SELECT * FROM TestDatatypeAggSort_vu_prepare_smalldatetime_view_max +go +SELECT * FROM TestDatatypeAggSort_vu_prepare_smalldatetime_view_min +go + +EXEC TestDatatypeAggSort_vu_prepare_proc +go + +SELECT * FROM TestDatatypeAggSort_vu_prepare_tbl2 ORDER BY max_min +go + +-- This is failing because of BABEL-4332 +SELECT MAX(char_col) FROM TestDatatypeAggSort_vu_prepare_tbl WHERE varchar_col <= 'xxx' +go +SELECT MIN(char_col) FROM TestDatatypeAggSort_vu_prepare_tbl WHERE varchar_col <= 'xxx' +go + +SELECT MAX(varchar_col) FROM TestDatatypeAggSort_vu_prepare_tbl WHERE varchar_col <= 'xxx' +go +SELECT MIN(varchar_col) FROM TestDatatypeAggSort_vu_prepare_tbl WHERE varchar_col > 'xxx' +go + +SELECT MAX(datetime_col) FROM TestDatatypeAggSort_vu_prepare_tbl WHERE datetime_col <= '2020-12-31 23:59:59' +go +SELECT MIN(datetime_col) FROM TestDatatypeAggSort_vu_prepare_tbl WHERE datetime_col > '2020-12-31 23:59:59' +go + +SELECT MAX(datetime2_col) FROM TestDatatypeAggSort_vu_prepare_tbl WHERE datetime2_col <= '2020-12-31 23:59:59' +go +SELECT MIN(datetime2_col) FROM TestDatatypeAggSort_vu_prepare_tbl WHERE datetime2_col > '2020-12-31 23:59:59' +go + +SELECT MAX(datetimeoffset_col) FROM TestDatatypeAggSort_vu_prepare_tbl WHERE datetimeoffset_col <= '2020-12-31 23:59:59' +go +SELECT MIN(datetimeoffset_col) FROM TestDatatypeAggSort_vu_prepare_tbl WHERE datetimeoffset_col > '2020-12-31 23:59:59' +go + +SELECT MAX(smalldatetime_col) FROM TestDatatypeAggSort_vu_prepare_tbl WHERE smalldatetime_col <= '2020-12-31 23:59:59' +go +SELECT MIN(smalldatetime_col) FROM TestDatatypeAggSort_vu_prepare_tbl WHERE smalldatetime_col > '2020-12-31 23:59:59' +go diff --git a/test/JDBC/input/datatypes/TestDatatypeAggSort.sql b/test/JDBC/input/datatypes/TestDatatypeAggSort.sql new file mode 100644 index 0000000000..7a844d958f --- /dev/null +++ b/test/JDBC/input/datatypes/TestDatatypeAggSort.sql @@ -0,0 +1,125 @@ +-- MAX/MIN functionality already verified in upgrade scripts. +-- This test mainly focuses on query plans. +CREATE TABLE TestDatatypeAggSort_tbl ( + char_col CHAR(10), + varchar_col VARCHAR(10), + datetime_col DATETIME, + datetime2_col DATETIME2, + datetimeoffset_col DATETIMEOFFSET, + smalldatetime_col SMALLDATETIME, +); +go + +INSERT INTO TestDatatypeAggSort_tbl VALUES ( + 'abc', 'abc', + '1900-01-01 00:00:00.000', + '1900-01-01 00:00:00.000', + '1900-01-01 00:00:00.000 +0:00', + '1900-01-01 00:00:00.000' +), ( + 'def', 'def', + '1950-01-01 00:00:00.000', + '1950-01-01 00:00:00.000', + '1950-01-01 00:00:00.000 +0:00', + '1950-01-01 00:00:00.000' +), ( + 'ghi', 'ghi', + '2000-01-01 00:00:00.000', + '2000-01-01 00:00:00.000', + '2000-01-01 00:00:00.000 +0:00', + '2000-01-01 00:00:00.000' +), ( + 'jkl', 'jkl', + '2005-01-01 00:00:00.000', + '2005-01-01 00:00:00.000', + '2005-01-01 00:00:00.000 +0:00', + '2005-01-01 00:00:00.000' +), ( + 'mno', 'mno', + '2010-01-01 00:00:00.000', + '2010-01-01 00:00:00.000', + '2010-01-01 00:00:00.000 +0:00', + '2010-01-01 00:00:00.000' +), ( + 'pqr', 'pqr', + '2015-01-01 00:00:00.000', + '2015-01-01 00:00:00.000', + '2015-01-01 00:00:00.000 +0:00', + '2015-01-01 00:00:00.000' +), ( + 'stu', 'stu', + '2020-01-01 00:00:00.000', + '2020-01-01 00:00:00.000', + '2020-01-01 00:00:00.000 +0:00', + '2020-01-01 00:00:00.000' +), ( + 'xyz', 'xyz', + '2023-11-06 00:00:00.000', + '2023-11-06 00:00:00.000', + '2023-11-06 00:00:00.000 +0:00', + '2023-11-06 00:00:00.000' +), ( + NULL, NULL, NULL, NULL, NULL, NULL +); +go + +CREATE INDEX TestDatatypeAggSort_vu_prepare_char_idx ON TestDatatypeAggSort_tbl (char_col) +go +CREATE INDEX TestDatatypeAggSort_vu_prepare_varchar_idx ON TestDatatypeAggSort_tbl (varchar_col) +go +CREATE INDEX TestDatatypeAggSort_vu_prepare_datetime_idx ON TestDatatypeAggSort_tbl (datetime_col) +go +CREATE INDEX TestDatatypeAggSort_vu_prepare_datetime2_idx ON TestDatatypeAggSort_tbl (datetime2_col) +go +CREATE INDEX TestDatatypeAggSort_vu_prepare_datetimeoffset_idx ON TestDatatypeAggSort_tbl (datetimeoffset_col) +go +CREATE INDEX TestDatatypeAggSort_vu_prepare_smalldatetime_idx ON TestDatatypeAggSort_tbl (smalldatetime_col) +go + + +-- Check query plans, all aggregations should be optimized +-- into LIMIT + index scan. +SELECT set_config('enable_seqscan', 'off', false) +go +SET babelfish_showplan_all ON +go + +-- This is failing because of BABEL-4332 +SELECT MAX(char_col) FROM TestDatatypeAggSort_tbl WHERE varchar_col <= 'xxx' +go +SELECT MIN(char_col) FROM TestDatatypeAggSort_tbl WHERE varchar_col <= 'xxx' +go + +SELECT MAX(varchar_col) FROM TestDatatypeAggSort_tbl WHERE varchar_col <= 'xxx' +go +SELECT MIN(varchar_col) FROM TestDatatypeAggSort_tbl WHERE varchar_col > 'xxx' +go + +SELECT MAX(datetime_col) FROM TestDatatypeAggSort_tbl WHERE datetime_col <= '2020-12-31 23:59:59' +go +SELECT MIN(datetime_col) FROM TestDatatypeAggSort_tbl WHERE datetime_col > '2020-12-31 23:59:59' +go + +SELECT MAX(datetime2_col) FROM TestDatatypeAggSort_tbl WHERE datetime2_col <= '2020-12-31 23:59:59' +go +SELECT MIN(datetime2_col) FROM TestDatatypeAggSort_tbl WHERE datetime2_col > '2020-12-31 23:59:59' +go + +SELECT MAX(datetimeoffset_col) FROM TestDatatypeAggSort_tbl WHERE datetimeoffset_col <= '2020-12-31 23:59:59' +go +SELECT MIN(datetimeoffset_col) FROM TestDatatypeAggSort_tbl WHERE datetimeoffset_col > '2020-12-31 23:59:59' +go + +SELECT MAX(smalldatetime_col) FROM TestDatatypeAggSort_tbl WHERE smalldatetime_col <= '2020-12-31 23:59:59' +go +SELECT MIN(smalldatetime_col) FROM TestDatatypeAggSort_tbl WHERE smalldatetime_col > '2020-12-31 23:59:59' +go + +-- Reset +SET babelfish_showplan_all OFF +go +SELECT set_config('enable_seqscan', 'on', false) +go + +DROP TABLE TestDatatypeAggSort_tbl +go diff --git a/test/JDBC/upgrade/13_4/schedule b/test/JDBC/upgrade/13_4/schedule index e062ac3fcb..e273e912e0 100644 --- a/test/JDBC/upgrade/13_4/schedule +++ b/test/JDBC/upgrade/13_4/schedule @@ -217,4 +217,5 @@ triggers_with_transaction BABEL-4046 getdate AUTO_ANALYZE-before-15-5-or-14-10 -cast_eliminate \ No newline at end of file +cast_eliminate +TestDatatypeAggSort diff --git a/test/JDBC/upgrade/13_5/schedule b/test/JDBC/upgrade/13_5/schedule index 34e94f09bb..1999c4b4f8 100644 --- a/test/JDBC/upgrade/13_5/schedule +++ b/test/JDBC/upgrade/13_5/schedule @@ -270,4 +270,5 @@ triggers_with_transaction BABEL-4046 getdate AUTO_ANALYZE-before-15-5-or-14-10 -cast_eliminate \ No newline at end of file +cast_eliminate +TestDatatypeAggSort diff --git a/test/JDBC/upgrade/13_6/schedule b/test/JDBC/upgrade/13_6/schedule index dba828acf2..d11e36cee0 100644 --- a/test/JDBC/upgrade/13_6/schedule +++ b/test/JDBC/upgrade/13_6/schedule @@ -325,4 +325,5 @@ BABEL-4046 getdate BABEL-4410 GRANT_SCHEMA -AUTO_ANALYZE-before-15-5-or-14-10 \ No newline at end of file +AUTO_ANALYZE-before-15-5-or-14-10 +TestDatatypeAggSort diff --git a/test/JDBC/upgrade/13_7/schedule b/test/JDBC/upgrade/13_7/schedule index e28559c77a..01abb92a3c 100644 --- a/test/JDBC/upgrade/13_7/schedule +++ b/test/JDBC/upgrade/13_7/schedule @@ -318,4 +318,5 @@ triggers_with_transaction BABEL-4046 getdate AUTO_ANALYZE-before-15-5-or-14-10 -cast_eliminate \ No newline at end of file +cast_eliminate +TestDatatypeAggSort diff --git a/test/JDBC/upgrade/13_8/schedule b/test/JDBC/upgrade/13_8/schedule index e28559c77a..01abb92a3c 100644 --- a/test/JDBC/upgrade/13_8/schedule +++ b/test/JDBC/upgrade/13_8/schedule @@ -318,4 +318,5 @@ triggers_with_transaction BABEL-4046 getdate AUTO_ANALYZE-before-15-5-or-14-10 -cast_eliminate \ No newline at end of file +cast_eliminate +TestDatatypeAggSort diff --git a/test/JDBC/upgrade/13_9/schedule b/test/JDBC/upgrade/13_9/schedule index 0aef9f87a0..27768b2b3d 100644 --- a/test/JDBC/upgrade/13_9/schedule +++ b/test/JDBC/upgrade/13_9/schedule @@ -322,4 +322,5 @@ getdate BABEL-4410 GRANT_SCHEMA AUTO_ANALYZE-before-15-5-or-14-10 -cast_eliminate \ No newline at end of file +cast_eliminate +TestDatatypeAggSort diff --git a/test/JDBC/upgrade/14_10/schedule b/test/JDBC/upgrade/14_10/schedule index 257464f17d..037f60f29f 100644 --- a/test/JDBC/upgrade/14_10/schedule +++ b/test/JDBC/upgrade/14_10/schedule @@ -414,3 +414,4 @@ GRANT_SCHEMA default_params BABEL-3326 cast_eliminate +TestDatatypeAggSort diff --git a/test/JDBC/upgrade/14_3/schedule b/test/JDBC/upgrade/14_3/schedule index 44c9f1af17..6278d040bc 100644 --- a/test/JDBC/upgrade/14_3/schedule +++ b/test/JDBC/upgrade/14_3/schedule @@ -340,4 +340,5 @@ BABEL-2619 BABEL-4410 GRANT_SCHEMA AUTO_ANALYZE-before-15-5-or-14-10 -cast_eliminate \ No newline at end of file +cast_eliminate +TestDatatypeAggSort diff --git a/test/JDBC/upgrade/14_5/schedule b/test/JDBC/upgrade/14_5/schedule index 3adcf07f27..ada0b9c093 100644 --- a/test/JDBC/upgrade/14_5/schedule +++ b/test/JDBC/upgrade/14_5/schedule @@ -355,4 +355,5 @@ BABEL-2619 BABEL-4410 GRANT_SCHEMA AUTO_ANALYZE-before-15-5-or-14-10 -cast_eliminate \ No newline at end of file +cast_eliminate +TestDatatypeAggSort diff --git a/test/JDBC/upgrade/14_6/schedule b/test/JDBC/upgrade/14_6/schedule index a73a0b8193..7fe66e5e69 100644 --- a/test/JDBC/upgrade/14_6/schedule +++ b/test/JDBC/upgrade/14_6/schedule @@ -389,4 +389,5 @@ BABEL-2619 BABEL-4410 GRANT_SCHEMA AUTO_ANALYZE-before-15-5-or-14-10 -cast_eliminate \ No newline at end of file +cast_eliminate +TestDatatypeAggSort diff --git a/test/JDBC/upgrade/14_7/schedule b/test/JDBC/upgrade/14_7/schedule index a529a32193..10318dd681 100644 --- a/test/JDBC/upgrade/14_7/schedule +++ b/test/JDBC/upgrade/14_7/schedule @@ -409,4 +409,5 @@ getdate BABEL_4330 BABEL-2619 AUTO_ANALYZE-before-15-5-or-14-10 -cast_eliminate \ No newline at end of file +cast_eliminate +TestDatatypeAggSort diff --git a/test/JDBC/upgrade/14_8/schedule b/test/JDBC/upgrade/14_8/schedule index bf7a3d58f6..f081a2d7c1 100644 --- a/test/JDBC/upgrade/14_8/schedule +++ b/test/JDBC/upgrade/14_8/schedule @@ -408,4 +408,5 @@ BABEL_4330 BABEL-2619 AUTO_ANALYZE-before-15-5-or-14-10 default_params -cast_eliminate \ No newline at end of file +cast_eliminate +TestDatatypeAggSort diff --git a/test/JDBC/upgrade/14_9/schedule b/test/JDBC/upgrade/14_9/schedule index 506057b037..6a94f312cc 100644 --- a/test/JDBC/upgrade/14_9/schedule +++ b/test/JDBC/upgrade/14_9/schedule @@ -410,4 +410,5 @@ BABEL-2619 BABEL-4410 AUTO_ANALYZE-before-15-5-or-14-10 default_params -cast_eliminate \ No newline at end of file +cast_eliminate +TestDatatypeAggSort diff --git a/test/JDBC/upgrade/15_1/schedule b/test/JDBC/upgrade/15_1/schedule index 34c48c4096..570a76d822 100644 --- a/test/JDBC/upgrade/15_1/schedule +++ b/test/JDBC/upgrade/15_1/schedule @@ -387,4 +387,5 @@ getdate BABEL_4330 AUTO_ANALYZE-before-15-5-or-14-10 default_params -cast_eliminate \ No newline at end of file +cast_eliminate +TestDatatypeAggSort diff --git a/test/JDBC/upgrade/15_2/schedule b/test/JDBC/upgrade/15_2/schedule index 747b86c415..e2a7d657c9 100644 --- a/test/JDBC/upgrade/15_2/schedule +++ b/test/JDBC/upgrade/15_2/schedule @@ -419,3 +419,4 @@ GRANT_SCHEMA AUTO_ANALYZE-before-15-5-or-14-10 default_params cast_eliminate +TestDatatypeAggSort diff --git a/test/JDBC/upgrade/15_3/schedule b/test/JDBC/upgrade/15_3/schedule index 0de3bb3dd4..a8c77a6f07 100644 --- a/test/JDBC/upgrade/15_3/schedule +++ b/test/JDBC/upgrade/15_3/schedule @@ -439,4 +439,5 @@ getdate BABEL_4330 AUTO_ANALYZE-before-15-5-or-14-10 default_params -cast_eliminate \ No newline at end of file +cast_eliminate +TestDatatypeAggSort diff --git a/test/JDBC/upgrade/15_4/schedule b/test/JDBC/upgrade/15_4/schedule index 9b60c8c9cb..23f5187fd0 100644 --- a/test/JDBC/upgrade/15_4/schedule +++ b/test/JDBC/upgrade/15_4/schedule @@ -452,4 +452,5 @@ BABEL-4410 GRANT_SCHEMA AUTO_ANALYZE-before-15-5-or-14-10 default_params -cast_eliminate \ No newline at end of file +cast_eliminate +TestDatatypeAggSort diff --git a/test/JDBC/upgrade/latest/schedule b/test/JDBC/upgrade/latest/schedule index 6ed11249ef..913594fb0f 100644 --- a/test/JDBC/upgrade/latest/schedule +++ b/test/JDBC/upgrade/latest/schedule @@ -485,3 +485,4 @@ BABEL-4484 pivot #AUTO_ANALYZE #uncomment this test when preparing for new minor version cast_eliminate +TestDatatypeAggSort diff --git a/test/JDBC/upgrade/master/schedule b/test/JDBC/upgrade/master/schedule index 5579f1c23c..d34b35c881 100644 --- a/test/JDBC/upgrade/master/schedule +++ b/test/JDBC/upgrade/master/schedule @@ -340,3 +340,4 @@ BABEL-4046 host_id BABEL-4175 BABEL_4330 +TestDatatypeAggSort