From 204a7e85bc392e7eaad3519ec206343c02c40326 Mon Sep 17 00:00:00 2001 From: Bo Date: Tue, 14 Jan 2025 21:21:21 -0800 Subject: [PATCH] Implement modulo operator for MONEY/SMALLMONEY types (#3401) Description ----------- Due to the missing modulo operator for MONEY/SMALLMONEY types, it will choose the other Postgres internal alternatives like int4mod and numeric_mod, which will involve additional implicit CASTing between MONEY/SMALLMONEY types and other types. These CASTings could cause loss of precision and wrong results. What's more, the result of calculation won't be MONEY/SMALLMONEY types any more. Fix --- Implement the modulo function and operator for MONEY/SMALLMONEY types. The reason why we don't need to implement the functions between MONEY/SMALLMONEY types and interger types is that it will choose the MONEY-MONEY/SMALLMONEY-SMALLMONEY functions to calculate. And the result type is expected. Task: BABEL-5480 Signed-off-by: Bo Li --- .../fixeddecimal--1.1.0_base_parallel.sql | 25 ++ .../babelfish_common_helper--3.7.0--3.8.0.sql | 32 ++ contrib/babelfishpg_money/fixeddecimal.c | 27 ++ test/JDBC/expected/babel_money.out | 289 ++++++++++++++++++ .../fixeddecimal_modulo-vu-cleanup.out | 2 + .../fixeddecimal_modulo-vu-prepare.out | 5 + .../fixeddecimal_modulo-vu-verify.out | 281 +++++++++++++++++ test/JDBC/input/babel_money.sql | 94 ++++++ .../input/fixeddecimal_modulo-vu-cleanup.sql | 2 + .../input/fixeddecimal_modulo-vu-prepare.sql | 3 + .../input/fixeddecimal_modulo-vu-verify.sql | 88 ++++++ test/JDBC/jdbc_schedule | 3 + test/JDBC/upgrade/13_4/schedule | 2 +- test/JDBC/upgrade/13_5/schedule | 2 +- test/JDBC/upgrade/13_6/schedule | 1 + test/JDBC/upgrade/13_7/schedule | 2 +- test/JDBC/upgrade/13_8/schedule | 2 +- test/JDBC/upgrade/13_9/schedule | 2 +- test/JDBC/upgrade/14_10/schedule | 2 +- test/JDBC/upgrade/14_11/schedule | 2 +- test/JDBC/upgrade/14_12/schedule | 2 +- test/JDBC/upgrade/14_13/schedule | 2 +- test/JDBC/upgrade/14_15/schedule | 1 + test/JDBC/upgrade/14_16/schedule | 1 + test/JDBC/upgrade/14_3/schedule | 2 +- test/JDBC/upgrade/14_5/schedule | 2 +- test/JDBC/upgrade/14_6/schedule | 2 +- test/JDBC/upgrade/14_7/schedule | 2 +- test/JDBC/upgrade/14_8/schedule | 2 +- test/JDBC/upgrade/14_9/schedule | 2 +- test/JDBC/upgrade/15_1/schedule | 2 +- test/JDBC/upgrade/15_10/schedule | 1 + test/JDBC/upgrade/15_2/schedule | 2 +- test/JDBC/upgrade/15_3/schedule | 2 +- test/JDBC/upgrade/15_4/schedule | 2 +- test/JDBC/upgrade/15_5/schedule | 2 +- test/JDBC/upgrade/15_6/schedule | 2 +- test/JDBC/upgrade/15_7/schedule | 2 +- test/JDBC/upgrade/15_8/schedule | 2 +- test/JDBC/upgrade/latest/schedule | 1 + .../expected_dependency.out | 2 + 41 files changed, 881 insertions(+), 23 deletions(-) create mode 100644 test/JDBC/expected/fixeddecimal_modulo-vu-cleanup.out create mode 100644 test/JDBC/expected/fixeddecimal_modulo-vu-prepare.out create mode 100644 test/JDBC/expected/fixeddecimal_modulo-vu-verify.out create mode 100644 test/JDBC/input/fixeddecimal_modulo-vu-cleanup.sql create mode 100644 test/JDBC/input/fixeddecimal_modulo-vu-prepare.sql create mode 100644 test/JDBC/input/fixeddecimal_modulo-vu-verify.sql diff --git a/contrib/babelfishpg_common/sql/money/fixeddecimal--1.1.0_base_parallel.sql b/contrib/babelfishpg_common/sql/money/fixeddecimal--1.1.0_base_parallel.sql index 93a9974d6a..6d45a56a3c 100755 --- a/contrib/babelfishpg_common/sql/money/fixeddecimal--1.1.0_base_parallel.sql +++ b/contrib/babelfishpg_common/sql/money/fixeddecimal--1.1.0_base_parallel.sql @@ -466,6 +466,20 @@ ALTER OPERATOR FAMILY fixeddecimal_ops USING hash ADD CREATE DOMAIN sys.MONEY as sys.FIXEDDECIMAL CHECK (VALUE >= -922337203685477.5808 AND VALUE <= 922337203685477.5807); CREATE DOMAIN sys.SMALLMONEY as sys.FIXEDDECIMAL CHECK (VALUE >= -214748.3648 AND VALUE <= 214748.3647); +-- Define modulo operator directly on MONEY type. +-- Otherwise the operator between Integer and SMALLMONEY will tend to choose the fixeddecimal version, +-- which will return the result in MONEY type. +CREATE FUNCTION sys.fixeddecimalmod(sys.MONEY, sys.MONEY) +RETURNS sys.MONEY +AS 'babelfishpg_money', 'fixeddecimalmod' +LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE; + +CREATE OPERATOR sys.% ( + LEFTARG = sys.MONEY, + RIGHTARG = sys.MONEY, + PROCEDURE = fixeddecimalmod +); + -- -- Cross type operators with int8 -- @@ -1645,6 +1659,11 @@ RETURNS sys.SMALLMONEY AS 'babelfishpg_money', 'fixeddecimaldiv' LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE; +CREATE FUNCTION sys.fixeddecimalmod(sys.SMALLMONEY, sys.SMALLMONEY) +RETURNS sys.SMALLMONEY +AS 'babelfishpg_money', 'fixeddecimalmod' +LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE; + CREATE OPERATOR sys.+ ( LEFTARG = sys.SMALLMONEY, RIGHTARG = sys.SMALLMONEY, @@ -1676,6 +1695,12 @@ CREATE OPERATOR sys./ ( PROCEDURE = fixeddecimaldiv ); +CREATE OPERATOR sys.% ( + LEFTARG = sys.SMALLMONEY, + RIGHTARG = sys.SMALLMONEY, + PROCEDURE = fixeddecimalmod +); + CREATE FUNCTION sys.fixeddecimalint8pl(sys.SMALLMONEY, INT8) RETURNS sys.SMALLMONEY AS 'babelfishpg_money', 'fixeddecimalint8pl' diff --git a/contrib/babelfishpg_common/sql/upgrades/babelfish_common_helper--3.7.0--3.8.0.sql b/contrib/babelfishpg_common/sql/upgrades/babelfish_common_helper--3.7.0--3.8.0.sql index d8cd9b86fc..aba3c5d4a6 100644 --- a/contrib/babelfishpg_common/sql/upgrades/babelfish_common_helper--3.7.0--3.8.0.sql +++ b/contrib/babelfishpg_common/sql/upgrades/babelfish_common_helper--3.7.0--3.8.0.sql @@ -74,5 +74,37 @@ WITH FUNCTION sys.fixeddecimal2bpchar(sys.FIXEDDECIMAL, integer, BOOLEAN) AS IMP CREATE CAST (sys.FIXEDDECIMAL AS pg_catalog.BPCHAR) WITH FUNCTION sys.fixeddecimal2bpchar(sys.FIXEDDECIMAL, integer, BOOLEAN) AS IMPLICIT; +CREATE OR REPLACE FUNCTION sys.fixeddecimalmod(sys.MONEY, sys.MONEY) +RETURNS sys.MONEY +AS 'babelfishpg_money', 'fixeddecimalmod' +LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE; + +DO $$ +BEGIN +IF NOT EXISTS (SELECT 1 FROM pg_catalog.pg_operator WHERE oprleft = 'sys.money'::pg_catalog.regtype and oprright = 'sys.money'::pg_catalog.regtype and oprnamespace = 'sys'::regnamespace and oprname = '%' and oprresult != 0) THEN +CREATE OPERATOR sys.% ( + LEFTARG = sys.MONEY, + RIGHTARG = sys.MONEY, + PROCEDURE = fixeddecimalmod +); +END IF; +END $$; + +CREATE OR REPLACE FUNCTION sys.fixeddecimalmod(sys.SMALLMONEY, sys.SMALLMONEY) +RETURNS sys.SMALLMONEY +AS 'babelfishpg_money', 'fixeddecimalmod' +LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE; + +DO $$ +BEGIN +IF NOT EXISTS (SELECT 1 FROM pg_catalog.pg_operator WHERE oprleft = 'sys.smallmoney'::pg_catalog.regtype and oprright = 'sys.smallmoney'::pg_catalog.regtype and oprnamespace = 'sys'::regnamespace and oprname = '%' and oprresult != 0) THEN +CREATE OPERATOR sys.% ( + LEFTARG = sys.SMALLMONEY, + RIGHTARG = sys.SMALLMONEY, + PROCEDURE = fixeddecimalmod +); +END IF; +END $$; + -- 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_money/fixeddecimal.c b/contrib/babelfishpg_money/fixeddecimal.c index f7abd93f9e..634b836ce5 100755 --- a/contrib/babelfishpg_money/fixeddecimal.c +++ b/contrib/babelfishpg_money/fixeddecimal.c @@ -160,6 +160,7 @@ PG_FUNCTION_INFO_V1(fixeddecimalpl); PG_FUNCTION_INFO_V1(fixeddecimalmi); PG_FUNCTION_INFO_V1(fixeddecimalmul); PG_FUNCTION_INFO_V1(fixeddecimaldiv); +PG_FUNCTION_INFO_V1(fixeddecimalmod); PG_FUNCTION_INFO_V1(fixeddecimalabs); PG_FUNCTION_INFO_V1(fixeddecimallarger); PG_FUNCTION_INFO_V1(fixeddecimalsmaller); @@ -1771,6 +1772,32 @@ fixeddecimaldiv(PG_FUNCTION_ARGS) PG_RETURN_INT64((int64) result); } +Datum +fixeddecimalmod(PG_FUNCTION_ARGS) +{ + int64 dividend = PG_GETARG_INT64(0); + int64 divisor = PG_GETARG_INT64(1); + + if (divisor == 0) + { + ereport(ERROR, + (errcode(ERRCODE_DIVISION_BY_ZERO), + errmsg("division by zero"))); + /* ensure compiler realizes we mustn't reach the division (gcc bug) */ + PG_RETURN_NULL(); + } + + /* +» * Some machines throw a floating-point exception for INT_MIN % -1, which +» * is a bit silly since the correct answer is perfectly well-defined, +» * namely zero. Refer to function int4mod in Postgres. +» */ + if (divisor == -1) + PG_RETURN_INT64(0); + + PG_RETURN_INT64(dividend % divisor); +} + /* fixeddecimalabs() * Absolute value */ diff --git a/test/JDBC/expected/babel_money.out b/test/JDBC/expected/babel_money.out index 5a243ec7cc..680110cf42 100644 --- a/test/JDBC/expected/babel_money.out +++ b/test/JDBC/expected/babel_money.out @@ -542,3 +542,292 @@ smallmoney 1.8000 ~~END~~ + +-- Test modulo operator for fixeddecimal type +-- modulo operator between MONEY/SMALLMONEY and MONEY/SMALLMONEY +-- SMALLMONEY is between -214748.3648 to 214748.3647 +-- MONEY is between -922337203685477.5808 to 922337203685477.5807 +SELECT CAST(-15.5 AS MONEY) % CAST(24.0 AS MONEY); +GO +~~START~~ +money +-15.5000 +~~END~~ + +SELECT CAST(-273434.2737 AS MONEY) % CAST(283.2245 AS MONEY); +GO +~~START~~ +money +-122.6312 +~~END~~ + +SELECT CAST(-27328391434.2737 AS MONEY) % CAST(283828323.2273 AS MONEY); +GO +~~START~~ +money +-80872404.4529 +~~END~~ + +SELECT CAST(-27328391434.2737 AS MONEY) % CAST(-283828323.2273 AS MONEY); +GO +~~START~~ +money +-80872404.4529 +~~END~~ + +SELECT CAST(922337203685477.5807 AS MONEY) % CAST(283.2245 AS MONEY); +GO +~~START~~ +money +249.0157 +~~END~~ + +SELECT CAST(922337203685477.5807 AS MONEY) % CAST(-922337203685477.5808 AS MONEY); +GO +~~START~~ +money +922337203685477.5807 +~~END~~ + +SELECT CAST(922337203685477.5807 AS MONEY) % CAST(1 AS MONEY); +GO +~~START~~ +money +0.5807 +~~END~~ + +SELECT CAST(922337203685477.5807 AS MONEY) % CAST(0.0001 AS MONEY); +GO +~~START~~ +money +0.0000 +~~END~~ + +SELECT CAST(922337203685477.5807 AS MONEY) % CAST(-283828323.2273 AS MONEY); +GO +~~START~~ +money +169676346.6817 +~~END~~ + +SELECT CAST(-922337203685477.5808 AS MONEY) % CAST(922337203685477.5807 AS MONEY); +GO +~~START~~ +money +-0.0001 +~~END~~ + +SELECT CAST(-922337203685477.5808 AS MONEY) % CAST(283.2245 AS MONEY); +GO +~~START~~ +money +-249.0158 +~~END~~ + +SELECT CAST(-922337203685477.5808 AS MONEY) % CAST(1 AS MONEY); +GO +~~START~~ +money +-0.5808 +~~END~~ + +SELECT CAST(-922337203685477.5808 AS MONEY) % CAST(0.0001 AS MONEY); +GO +~~START~~ +money +0.0000 +~~END~~ + +SELECT CAST(-922337203685477.5808 AS MONEY) % CAST(-283828323.2273 AS MONEY); +GO +~~START~~ +money +-169676346.6818 +~~END~~ + +SELECT CAST(0.00 AS MONEY) % CAST(-922337203685477.5808 AS MONEY); +GO +~~START~~ +money +0.0000 +~~END~~ + +SELECT CAST(922337203685477.5807 AS MONEY) % CAST(0.00 AS MONEY); +GO +~~START~~ +money +~~ERROR (Code: 8134)~~ + +~~ERROR (Message: division by zero)~~ + + +SELECT CAST(-214748.3648 AS SMALLMONEY) % CAST(283.2245 AS SMALLMONEY); +GO +~~START~~ +smallmoney +-64.1938 +~~END~~ + +SELECT CAST(214748.3647 AS SMALLMONEY) % CAST(283.2245 AS SMALLMONEY); +GO +~~START~~ +smallmoney +64.1937 +~~END~~ + +SELECT CAST(214748.3647 AS SMALLMONEY) % CAST(0.0001 AS SMALLMONEY); +GO +~~START~~ +smallmoney +0.0000 +~~END~~ + +SELECT CAST(-214748.3648 AS SMALLMONEY) % CAST(0.0001 AS SMALLMONEY); +GO +~~START~~ +smallmoney +0.0000 +~~END~~ + + +SELECT CAST(-922337203685477.5808 AS MONEY) % CAST(-214748.3648 AS SMALLMONEY); +GO +~~START~~ +money +0.0000 +~~END~~ + +SELECT CAST(5477.5808 AS MONEY) % CAST(-214748.3648 AS SMALLMONEY); +GO +~~START~~ +money +5477.5808 +~~END~~ + +SELECT CAST(-214748.3648 AS SMALLMONEY) % CAST(5477.5808 AS MONEY); +GO +~~START~~ +money +-1122.7136 +~~END~~ + + +-- modulo operator between MONEY/SMALLMONEY and Integer +SELECT CAST(922337203685477.5807 AS MONEY) % CAST(2833 AS SMALLINT); +GO +~~START~~ +money +149.5807 +~~END~~ + +SELECT CAST(922337203685477.5807 AS MONEY) % CAST(228325833 AS INT); +GO +~~START~~ +money +160102832.5807 +~~END~~ + +SELECT CAST(922337203685477.5807 AS MONEY) % CAST(293228325827 AS BIGINT); +GO +~~START~~ +money +134118959562.5807 +~~END~~ + +SELECT CAST(922337203685477.5807 AS MONEY) % CAST(7 AS TINYINT); +GO +~~START~~ +money +6.5807 +~~END~~ + +SELECT CAST(2833 AS SMALLINT) % CAST(283.2128 AS SMALLMONEY); +GO +~~START~~ +smallmoney +0.8720 +~~END~~ + +SELECT CAST(125833 AS INT) % CAST(-28322.8217 AS SMALLMONEY); +GO +~~START~~ +smallmoney +12541.7132 +~~END~~ + +SELECT CAST(-20827 AS BIGINT) % CAST(-98272.1123 AS SMALLMONEY); +GO +~~START~~ +smallmoney +-20827.0000 +~~END~~ + +SELECT CAST(228325833 AS INT) % CAST(-28322.8217 AS SMALLMONEY); +GO +~~START~~ +smallmoney +~~ERROR (Code: 220)~~ + +~~ERROR (Message: value for domain smallmoney violates check constraint "smallmoney_check")~~ + +SELECT CAST(293228325827 AS BIGINT) % CAST(-98272.1123 AS SMALLMONEY); +GO +~~START~~ +smallmoney +~~ERROR (Code: 220)~~ + +~~ERROR (Message: value for domain smallmoney violates check constraint "smallmoney_check")~~ + +SELECT CAST(-98272.1123 AS SMALLMONEY) % CAST(7 AS TINYINT); +GO +~~START~~ +smallmoney +-6.1123 +~~END~~ + + +-- modulo operator between MONEY/SMALLMONEY and DECIMAL +-- use the postgres internal numeric_mod +SELECT CAST(922337203685477.5807 AS MONEY) % CAST(2833.292334 AS NUMERIC(12, 7)); +GO +~~START~~ +numeric +2144.3324440 +~~END~~ + +SELECT CAST(289383292919292.238382 AS NUMERIC(30, 5)) % CAST(-922337203685477.5808 AS MONEY); +GO +~~START~~ +numeric +289383292919292.23838 +~~END~~ + +SELECT CAST(-98272.1123 AS SMALLMONEY) % CAST(7.2 AS NUMERIC(5, 4)); +GO +~~START~~ +numeric +-6.5123 +~~END~~ + +SELECT CAST(289383292919292.238382 AS NUMERIC(30, 5)) % CAST(-98272.1123 AS SMALLMONEY); +GO +~~START~~ +numeric +12358.03288 +~~END~~ + + +CREATE TABLE t1 (a MONEY); +INSERT INTO t1 VALUES (5.5); +GO +~~ROW COUNT: 1~~ + +SELECT a, a % 1 AS MOD_INT, a % CAST(1 AS MONEY) AS MOD_MONEY, a % CAST(1 AS DECIMAL(10, 5)) AS MOD_DECIMAL FROM t1; +GO +~~START~~ +money#!#money#!#money#!#numeric +5.5000#!#0.5000#!#0.5000#!#0.50000 +~~END~~ + +DROP TABLE t1; +GO diff --git a/test/JDBC/expected/fixeddecimal_modulo-vu-cleanup.out b/test/JDBC/expected/fixeddecimal_modulo-vu-cleanup.out new file mode 100644 index 0000000000..c915f06b94 --- /dev/null +++ b/test/JDBC/expected/fixeddecimal_modulo-vu-cleanup.out @@ -0,0 +1,2 @@ +DROP TABLE fixeddecimal_modulo_t1; +GO diff --git a/test/JDBC/expected/fixeddecimal_modulo-vu-prepare.out b/test/JDBC/expected/fixeddecimal_modulo-vu-prepare.out new file mode 100644 index 0000000000..0a865fd913 --- /dev/null +++ b/test/JDBC/expected/fixeddecimal_modulo-vu-prepare.out @@ -0,0 +1,5 @@ +CREATE TABLE fixeddecimal_modulo_t1 (a MONEY); +INSERT INTO fixeddecimal_modulo_t1 VALUES (5.5); +GO +~~ROW COUNT: 1~~ + diff --git a/test/JDBC/expected/fixeddecimal_modulo-vu-verify.out b/test/JDBC/expected/fixeddecimal_modulo-vu-verify.out new file mode 100644 index 0000000000..69eecbde40 --- /dev/null +++ b/test/JDBC/expected/fixeddecimal_modulo-vu-verify.out @@ -0,0 +1,281 @@ +-- Test modulo operator for fixeddecimal type +-- modulo operator between MONEY/SMALLMONEY and MONEY/SMALLMONEY +-- SMALLMONEY is between -214748.3648 to 214748.3647 +-- MONEY is between -922337203685477.5808 to 922337203685477.5807 +SELECT CAST(-15.5 AS MONEY) % CAST(24.0 AS MONEY); +GO +~~START~~ +money +-15.5000 +~~END~~ + +SELECT CAST(-273434.2737 AS MONEY) % CAST(283.2245 AS MONEY); +GO +~~START~~ +money +-122.6312 +~~END~~ + +SELECT CAST(-27328391434.2737 AS MONEY) % CAST(283828323.2273 AS MONEY); +GO +~~START~~ +money +-80872404.4529 +~~END~~ + +SELECT CAST(-27328391434.2737 AS MONEY) % CAST(-283828323.2273 AS MONEY); +GO +~~START~~ +money +-80872404.4529 +~~END~~ + +SELECT CAST(922337203685477.5807 AS MONEY) % CAST(283.2245 AS MONEY); +GO +~~START~~ +money +249.0157 +~~END~~ + +SELECT CAST(922337203685477.5807 AS MONEY) % CAST(-922337203685477.5808 AS MONEY); +GO +~~START~~ +money +922337203685477.5807 +~~END~~ + +SELECT CAST(922337203685477.5807 AS MONEY) % CAST(1 AS MONEY); +GO +~~START~~ +money +0.5807 +~~END~~ + +SELECT CAST(922337203685477.5807 AS MONEY) % CAST(0.0001 AS MONEY); +GO +~~START~~ +money +0.0000 +~~END~~ + +SELECT CAST(922337203685477.5807 AS MONEY) % CAST(-283828323.2273 AS MONEY); +GO +~~START~~ +money +169676346.6817 +~~END~~ + +SELECT CAST(-922337203685477.5808 AS MONEY) % CAST(922337203685477.5807 AS MONEY); +GO +~~START~~ +money +-0.0001 +~~END~~ + +SELECT CAST(-922337203685477.5808 AS MONEY) % CAST(283.2245 AS MONEY); +GO +~~START~~ +money +-249.0158 +~~END~~ + +SELECT CAST(-922337203685477.5808 AS MONEY) % CAST(1 AS MONEY); +GO +~~START~~ +money +-0.5808 +~~END~~ + +SELECT CAST(-922337203685477.5808 AS MONEY) % CAST(0.0001 AS MONEY); +GO +~~START~~ +money +0.0000 +~~END~~ + +SELECT CAST(-922337203685477.5808 AS MONEY) % CAST(-283828323.2273 AS MONEY); +GO +~~START~~ +money +-169676346.6818 +~~END~~ + +SELECT CAST(0.00 AS MONEY) % CAST(-922337203685477.5808 AS MONEY); +GO +~~START~~ +money +0.0000 +~~END~~ + +SELECT CAST(922337203685477.5807 AS MONEY) % CAST(0.00 AS MONEY); +GO +~~START~~ +money +~~ERROR (Code: 8134)~~ + +~~ERROR (Message: division by zero)~~ + + +SELECT CAST(-214748.3648 AS SMALLMONEY) % CAST(283.2245 AS SMALLMONEY); +GO +~~START~~ +smallmoney +-64.1938 +~~END~~ + +SELECT CAST(214748.3647 AS SMALLMONEY) % CAST(283.2245 AS SMALLMONEY); +GO +~~START~~ +smallmoney +64.1937 +~~END~~ + +SELECT CAST(214748.3647 AS SMALLMONEY) % CAST(0.0001 AS SMALLMONEY); +GO +~~START~~ +smallmoney +0.0000 +~~END~~ + +SELECT CAST(-214748.3648 AS SMALLMONEY) % CAST(0.0001 AS SMALLMONEY); +GO +~~START~~ +smallmoney +0.0000 +~~END~~ + + +SELECT CAST(-922337203685477.5808 AS MONEY) % CAST(-214748.3648 AS SMALLMONEY); +GO +~~START~~ +money +0.0000 +~~END~~ + +SELECT CAST(5477.5808 AS MONEY) % CAST(-214748.3648 AS SMALLMONEY); +GO +~~START~~ +money +5477.5808 +~~END~~ + +SELECT CAST(-214748.3648 AS SMALLMONEY) % CAST(5477.5808 AS MONEY); +GO +~~START~~ +money +-1122.7136 +~~END~~ + + +-- modulo operator between MONEY/SMALLMONEY and Integer +SELECT CAST(922337203685477.5807 AS MONEY) % CAST(2833 AS SMALLINT); +GO +~~START~~ +money +149.5807 +~~END~~ + +SELECT CAST(922337203685477.5807 AS MONEY) % CAST(228325833 AS INT); +GO +~~START~~ +money +160102832.5807 +~~END~~ + +SELECT CAST(922337203685477.5807 AS MONEY) % CAST(293228325827 AS BIGINT); +GO +~~START~~ +money +134118959562.5807 +~~END~~ + +SELECT CAST(922337203685477.5807 AS MONEY) % CAST(7 AS TINYINT); +GO +~~START~~ +money +6.5807 +~~END~~ + +SELECT CAST(2833 AS SMALLINT) % CAST(283.2128 AS SMALLMONEY); +GO +~~START~~ +smallmoney +0.8720 +~~END~~ + +SELECT CAST(125833 AS INT) % CAST(-28322.8217 AS SMALLMONEY); +GO +~~START~~ +smallmoney +12541.7132 +~~END~~ + +SELECT CAST(-20827 AS BIGINT) % CAST(-98272.1123 AS SMALLMONEY); +GO +~~START~~ +smallmoney +-20827.0000 +~~END~~ + +SELECT CAST(228325833 AS INT) % CAST(-28322.8217 AS SMALLMONEY); +GO +~~START~~ +smallmoney +~~ERROR (Code: 220)~~ + +~~ERROR (Message: value for domain smallmoney violates check constraint "smallmoney_check")~~ + +SELECT CAST(293228325827 AS BIGINT) % CAST(-98272.1123 AS SMALLMONEY); +GO +~~START~~ +smallmoney +~~ERROR (Code: 220)~~ + +~~ERROR (Message: value for domain smallmoney violates check constraint "smallmoney_check")~~ + +SELECT CAST(-98272.1123 AS SMALLMONEY) % CAST(7 AS TINYINT); +GO +~~START~~ +smallmoney +-6.1123 +~~END~~ + + +-- modulo operator between MONEY/SMALLMONEY and DECIMAL +-- use the postgres internal numeric_mod +SELECT CAST(922337203685477.5807 AS MONEY) % CAST(2833.292334 AS NUMERIC(12, 7)); +GO +~~START~~ +numeric +2144.3324440 +~~END~~ + +SELECT CAST(289383292919292.238382 AS NUMERIC(30, 5)) % CAST(-922337203685477.5808 AS MONEY); +GO +~~START~~ +numeric +289383292919292.23838 +~~END~~ + +SELECT CAST(-98272.1123 AS SMALLMONEY) % CAST(7.2 AS NUMERIC(5, 4)); +GO +~~START~~ +numeric +-6.5123 +~~END~~ + +SELECT CAST(289383292919292.238382 AS NUMERIC(30, 5)) % CAST(-98272.1123 AS SMALLMONEY); +GO +~~START~~ +numeric +12358.03288 +~~END~~ + + +SELECT a, a % 1 AS MOD_INT, a % CAST(1 AS MONEY) AS MOD_MONEY, a % CAST(1 AS DECIMAL(10, 5)) AS MOD_DECIMAL FROM fixeddecimal_modulo_t1; +GO +~~START~~ +money#!#money#!#money#!#numeric +5.5000#!#0.5000#!#0.5000#!#0.50000 +~~END~~ + diff --git a/test/JDBC/input/babel_money.sql b/test/JDBC/input/babel_money.sql index 661c16587c..6a4f6b1aa6 100644 --- a/test/JDBC/input/babel_money.sql +++ b/test/JDBC/input/babel_money.sql @@ -197,3 +197,97 @@ go -- go select CAST(3.60 as smallmoney) / CAST(2.56 as smallint); go + +-- Test modulo operator for fixeddecimal type +-- modulo operator between MONEY/SMALLMONEY and MONEY/SMALLMONEY +-- SMALLMONEY is between -214748.3648 to 214748.3647 +-- MONEY is between -922337203685477.5808 to 922337203685477.5807 +SELECT CAST(-15.5 AS MONEY) % CAST(24.0 AS MONEY); +GO +SELECT CAST(-273434.2737 AS MONEY) % CAST(283.2245 AS MONEY); +GO +SELECT CAST(-27328391434.2737 AS MONEY) % CAST(283828323.2273 AS MONEY); +GO +SELECT CAST(-27328391434.2737 AS MONEY) % CAST(-283828323.2273 AS MONEY); +GO +SELECT CAST(922337203685477.5807 AS MONEY) % CAST(283.2245 AS MONEY); +GO +SELECT CAST(922337203685477.5807 AS MONEY) % CAST(-922337203685477.5808 AS MONEY); +GO +SELECT CAST(922337203685477.5807 AS MONEY) % CAST(1 AS MONEY); +GO +SELECT CAST(922337203685477.5807 AS MONEY) % CAST(0.0001 AS MONEY); +GO +SELECT CAST(922337203685477.5807 AS MONEY) % CAST(-283828323.2273 AS MONEY); +GO +SELECT CAST(-922337203685477.5808 AS MONEY) % CAST(922337203685477.5807 AS MONEY); +GO +SELECT CAST(-922337203685477.5808 AS MONEY) % CAST(283.2245 AS MONEY); +GO +SELECT CAST(-922337203685477.5808 AS MONEY) % CAST(1 AS MONEY); +GO +SELECT CAST(-922337203685477.5808 AS MONEY) % CAST(0.0001 AS MONEY); +GO +SELECT CAST(-922337203685477.5808 AS MONEY) % CAST(-283828323.2273 AS MONEY); +GO +SELECT CAST(0.00 AS MONEY) % CAST(-922337203685477.5808 AS MONEY); +GO +SELECT CAST(922337203685477.5807 AS MONEY) % CAST(0.00 AS MONEY); +GO + +SELECT CAST(-214748.3648 AS SMALLMONEY) % CAST(283.2245 AS SMALLMONEY); +GO +SELECT CAST(214748.3647 AS SMALLMONEY) % CAST(283.2245 AS SMALLMONEY); +GO +SELECT CAST(214748.3647 AS SMALLMONEY) % CAST(0.0001 AS SMALLMONEY); +GO +SELECT CAST(-214748.3648 AS SMALLMONEY) % CAST(0.0001 AS SMALLMONEY); +GO + +SELECT CAST(-922337203685477.5808 AS MONEY) % CAST(-214748.3648 AS SMALLMONEY); +GO +SELECT CAST(5477.5808 AS MONEY) % CAST(-214748.3648 AS SMALLMONEY); +GO +SELECT CAST(-214748.3648 AS SMALLMONEY) % CAST(5477.5808 AS MONEY); +GO + +-- modulo operator between MONEY/SMALLMONEY and Integer +SELECT CAST(922337203685477.5807 AS MONEY) % CAST(2833 AS SMALLINT); +GO +SELECT CAST(922337203685477.5807 AS MONEY) % CAST(228325833 AS INT); +GO +SELECT CAST(922337203685477.5807 AS MONEY) % CAST(293228325827 AS BIGINT); +GO +SELECT CAST(922337203685477.5807 AS MONEY) % CAST(7 AS TINYINT); +GO +SELECT CAST(2833 AS SMALLINT) % CAST(283.2128 AS SMALLMONEY); +GO +SELECT CAST(125833 AS INT) % CAST(-28322.8217 AS SMALLMONEY); +GO +SELECT CAST(-20827 AS BIGINT) % CAST(-98272.1123 AS SMALLMONEY); +GO +SELECT CAST(228325833 AS INT) % CAST(-28322.8217 AS SMALLMONEY); +GO +SELECT CAST(293228325827 AS BIGINT) % CAST(-98272.1123 AS SMALLMONEY); +GO +SELECT CAST(-98272.1123 AS SMALLMONEY) % CAST(7 AS TINYINT); +GO + +-- modulo operator between MONEY/SMALLMONEY and DECIMAL +-- use the postgres internal numeric_mod +SELECT CAST(922337203685477.5807 AS MONEY) % CAST(2833.292334 AS NUMERIC(12, 7)); +GO +SELECT CAST(289383292919292.238382 AS NUMERIC(30, 5)) % CAST(-922337203685477.5808 AS MONEY); +GO +SELECT CAST(-98272.1123 AS SMALLMONEY) % CAST(7.2 AS NUMERIC(5, 4)); +GO +SELECT CAST(289383292919292.238382 AS NUMERIC(30, 5)) % CAST(-98272.1123 AS SMALLMONEY); +GO + +CREATE TABLE t1 (a MONEY); +INSERT INTO t1 VALUES (5.5); +GO +SELECT a, a % 1 AS MOD_INT, a % CAST(1 AS MONEY) AS MOD_MONEY, a % CAST(1 AS DECIMAL(10, 5)) AS MOD_DECIMAL FROM t1; +GO +DROP TABLE t1; +GO diff --git a/test/JDBC/input/fixeddecimal_modulo-vu-cleanup.sql b/test/JDBC/input/fixeddecimal_modulo-vu-cleanup.sql new file mode 100644 index 0000000000..c915f06b94 --- /dev/null +++ b/test/JDBC/input/fixeddecimal_modulo-vu-cleanup.sql @@ -0,0 +1,2 @@ +DROP TABLE fixeddecimal_modulo_t1; +GO diff --git a/test/JDBC/input/fixeddecimal_modulo-vu-prepare.sql b/test/JDBC/input/fixeddecimal_modulo-vu-prepare.sql new file mode 100644 index 0000000000..c9fbee5c14 --- /dev/null +++ b/test/JDBC/input/fixeddecimal_modulo-vu-prepare.sql @@ -0,0 +1,3 @@ +CREATE TABLE fixeddecimal_modulo_t1 (a MONEY); +INSERT INTO fixeddecimal_modulo_t1 VALUES (5.5); +GO diff --git a/test/JDBC/input/fixeddecimal_modulo-vu-verify.sql b/test/JDBC/input/fixeddecimal_modulo-vu-verify.sql new file mode 100644 index 0000000000..968b7e27c4 --- /dev/null +++ b/test/JDBC/input/fixeddecimal_modulo-vu-verify.sql @@ -0,0 +1,88 @@ +-- Test modulo operator for fixeddecimal type +-- modulo operator between MONEY/SMALLMONEY and MONEY/SMALLMONEY +-- SMALLMONEY is between -214748.3648 to 214748.3647 +-- MONEY is between -922337203685477.5808 to 922337203685477.5807 +SELECT CAST(-15.5 AS MONEY) % CAST(24.0 AS MONEY); +GO +SELECT CAST(-273434.2737 AS MONEY) % CAST(283.2245 AS MONEY); +GO +SELECT CAST(-27328391434.2737 AS MONEY) % CAST(283828323.2273 AS MONEY); +GO +SELECT CAST(-27328391434.2737 AS MONEY) % CAST(-283828323.2273 AS MONEY); +GO +SELECT CAST(922337203685477.5807 AS MONEY) % CAST(283.2245 AS MONEY); +GO +SELECT CAST(922337203685477.5807 AS MONEY) % CAST(-922337203685477.5808 AS MONEY); +GO +SELECT CAST(922337203685477.5807 AS MONEY) % CAST(1 AS MONEY); +GO +SELECT CAST(922337203685477.5807 AS MONEY) % CAST(0.0001 AS MONEY); +GO +SELECT CAST(922337203685477.5807 AS MONEY) % CAST(-283828323.2273 AS MONEY); +GO +SELECT CAST(-922337203685477.5808 AS MONEY) % CAST(922337203685477.5807 AS MONEY); +GO +SELECT CAST(-922337203685477.5808 AS MONEY) % CAST(283.2245 AS MONEY); +GO +SELECT CAST(-922337203685477.5808 AS MONEY) % CAST(1 AS MONEY); +GO +SELECT CAST(-922337203685477.5808 AS MONEY) % CAST(0.0001 AS MONEY); +GO +SELECT CAST(-922337203685477.5808 AS MONEY) % CAST(-283828323.2273 AS MONEY); +GO +SELECT CAST(0.00 AS MONEY) % CAST(-922337203685477.5808 AS MONEY); +GO +SELECT CAST(922337203685477.5807 AS MONEY) % CAST(0.00 AS MONEY); +GO + +SELECT CAST(-214748.3648 AS SMALLMONEY) % CAST(283.2245 AS SMALLMONEY); +GO +SELECT CAST(214748.3647 AS SMALLMONEY) % CAST(283.2245 AS SMALLMONEY); +GO +SELECT CAST(214748.3647 AS SMALLMONEY) % CAST(0.0001 AS SMALLMONEY); +GO +SELECT CAST(-214748.3648 AS SMALLMONEY) % CAST(0.0001 AS SMALLMONEY); +GO + +SELECT CAST(-922337203685477.5808 AS MONEY) % CAST(-214748.3648 AS SMALLMONEY); +GO +SELECT CAST(5477.5808 AS MONEY) % CAST(-214748.3648 AS SMALLMONEY); +GO +SELECT CAST(-214748.3648 AS SMALLMONEY) % CAST(5477.5808 AS MONEY); +GO + +-- modulo operator between MONEY/SMALLMONEY and Integer +SELECT CAST(922337203685477.5807 AS MONEY) % CAST(2833 AS SMALLINT); +GO +SELECT CAST(922337203685477.5807 AS MONEY) % CAST(228325833 AS INT); +GO +SELECT CAST(922337203685477.5807 AS MONEY) % CAST(293228325827 AS BIGINT); +GO +SELECT CAST(922337203685477.5807 AS MONEY) % CAST(7 AS TINYINT); +GO +SELECT CAST(2833 AS SMALLINT) % CAST(283.2128 AS SMALLMONEY); +GO +SELECT CAST(125833 AS INT) % CAST(-28322.8217 AS SMALLMONEY); +GO +SELECT CAST(-20827 AS BIGINT) % CAST(-98272.1123 AS SMALLMONEY); +GO +SELECT CAST(228325833 AS INT) % CAST(-28322.8217 AS SMALLMONEY); +GO +SELECT CAST(293228325827 AS BIGINT) % CAST(-98272.1123 AS SMALLMONEY); +GO +SELECT CAST(-98272.1123 AS SMALLMONEY) % CAST(7 AS TINYINT); +GO + +-- modulo operator between MONEY/SMALLMONEY and DECIMAL +-- use the postgres internal numeric_mod +SELECT CAST(922337203685477.5807 AS MONEY) % CAST(2833.292334 AS NUMERIC(12, 7)); +GO +SELECT CAST(289383292919292.238382 AS NUMERIC(30, 5)) % CAST(-922337203685477.5808 AS MONEY); +GO +SELECT CAST(-98272.1123 AS SMALLMONEY) % CAST(7.2 AS NUMERIC(5, 4)); +GO +SELECT CAST(289383292919292.238382 AS NUMERIC(30, 5)) % CAST(-98272.1123 AS SMALLMONEY); +GO + +SELECT a, a % 1 AS MOD_INT, a % CAST(1 AS MONEY) AS MOD_MONEY, a % CAST(1 AS DECIMAL(10, 5)) AS MOD_DECIMAL FROM fixeddecimal_modulo_t1; +GO diff --git a/test/JDBC/jdbc_schedule b/test/JDBC/jdbc_schedule index 1b81b17e90..4c0895b177 100644 --- a/test/JDBC/jdbc_schedule +++ b/test/JDBC/jdbc_schedule @@ -89,6 +89,9 @@ ignore#!#smalldatetime_date_cmp-before-15_5-16_1-vu-cleanup ignore#!#restricted_procedures-vu-prepare ignore#!#restricted_procedures-vu-verify ignore#!#restricted_procedures-vu-cleanup +ignore#!#fixeddecimal_modulo-vu-prepare +ignore#!#fixeddecimal_modulo-vu-verify +ignore#!#fixeddecimal_modulo-vu-cleanup # These tests are meant for upgrade scenario prior to (potential) 14_5 release ignore#!#BABEL-3147-before-14_5-vu-prepare diff --git a/test/JDBC/upgrade/13_4/schedule b/test/JDBC/upgrade/13_4/schedule index d281b7f350..3fe1ca1b6b 100644 --- a/test/JDBC/upgrade/13_4/schedule +++ b/test/JDBC/upgrade/13_4/schedule @@ -257,4 +257,4 @@ BABEL-CASE_EXPR-before-16_5-or-15_9 BABEL-5059-before-14_7-or-15_2 smalldatetime_date_cmp-before-15_5-16_1 test_conv_money_to_varchar - +fixeddecimal_modulo diff --git a/test/JDBC/upgrade/13_5/schedule b/test/JDBC/upgrade/13_5/schedule index 00f2e77ef1..353629787a 100644 --- a/test/JDBC/upgrade/13_5/schedule +++ b/test/JDBC/upgrade/13_5/schedule @@ -309,4 +309,4 @@ binary-datatype-operators BABEL-CASE_EXPR-before-16_5-or-15_9 smalldatetime_date_cmp-before-15_5-16_1 test_conv_money_to_varchar - +fixeddecimal_modulo diff --git a/test/JDBC/upgrade/13_6/schedule b/test/JDBC/upgrade/13_6/schedule index 5665b23cab..a39d8d3d42 100644 --- a/test/JDBC/upgrade/13_6/schedule +++ b/test/JDBC/upgrade/13_6/schedule @@ -365,3 +365,4 @@ binary-datatype-operators BABEL-CASE_EXPR-before-16_5-or-15_9 smalldatetime_date_cmp-before-15_5-16_1 test_conv_money_to_varchar +fixeddecimal_modulo diff --git a/test/JDBC/upgrade/13_7/schedule b/test/JDBC/upgrade/13_7/schedule index 42e6efab42..821d83d2a4 100644 --- a/test/JDBC/upgrade/13_7/schedule +++ b/test/JDBC/upgrade/13_7/schedule @@ -358,4 +358,4 @@ binary-datatype-operators BABEL-CASE_EXPR-before-16_5-or-15_9 smalldatetime_date_cmp-before-15_5-16_1 test_conv_money_to_varchar - +fixeddecimal_modulo diff --git a/test/JDBC/upgrade/13_8/schedule b/test/JDBC/upgrade/13_8/schedule index 42e6efab42..821d83d2a4 100644 --- a/test/JDBC/upgrade/13_8/schedule +++ b/test/JDBC/upgrade/13_8/schedule @@ -358,4 +358,4 @@ binary-datatype-operators BABEL-CASE_EXPR-before-16_5-or-15_9 smalldatetime_date_cmp-before-15_5-16_1 test_conv_money_to_varchar - +fixeddecimal_modulo diff --git a/test/JDBC/upgrade/13_9/schedule b/test/JDBC/upgrade/13_9/schedule index bd266e949c..b2053df41d 100644 --- a/test/JDBC/upgrade/13_9/schedule +++ b/test/JDBC/upgrade/13_9/schedule @@ -363,4 +363,4 @@ binary-datatype-operators BABEL-CASE_EXPR-before-16_5-or-15_9 smalldatetime_date_cmp-before-15_5-16_1 test_conv_money_to_varchar - +fixeddecimal_modulo diff --git a/test/JDBC/upgrade/14_10/schedule b/test/JDBC/upgrade/14_10/schedule index 5caf6f4b21..d651e005c5 100644 --- a/test/JDBC/upgrade/14_10/schedule +++ b/test/JDBC/upgrade/14_10/schedule @@ -467,4 +467,4 @@ BABEL-CASE_EXPR-before-16_5-or-15_9 BABEL-5186 smalldatetime_date_cmp-before-15_5-16_1 test_conv_money_to_varchar - +fixeddecimal_modulo diff --git a/test/JDBC/upgrade/14_11/schedule b/test/JDBC/upgrade/14_11/schedule index 1c04d719be..6bd49040a5 100644 --- a/test/JDBC/upgrade/14_11/schedule +++ b/test/JDBC/upgrade/14_11/schedule @@ -466,4 +466,4 @@ BABEL-CASE_EXPR-before-16_5-or-15_9 BABEL-5186 smalldatetime_date_cmp-before-15_5-16_1 test_conv_money_to_varchar - +fixeddecimal_modulo diff --git a/test/JDBC/upgrade/14_12/schedule b/test/JDBC/upgrade/14_12/schedule index 4f5fae39c0..b0636e33f3 100644 --- a/test/JDBC/upgrade/14_12/schedule +++ b/test/JDBC/upgrade/14_12/schedule @@ -468,4 +468,4 @@ BABEL-CASE_EXPR-before-16_5-or-15_9 BABEL-5186 smalldatetime_date_cmp-before-15_5-16_1 test_conv_money_to_varchar - +fixeddecimal_modulo diff --git a/test/JDBC/upgrade/14_13/schedule b/test/JDBC/upgrade/14_13/schedule index d8c8d2684c..496f23e960 100644 --- a/test/JDBC/upgrade/14_13/schedule +++ b/test/JDBC/upgrade/14_13/schedule @@ -468,4 +468,4 @@ BABEL-CASE_EXPR-before-16_5-or-15_9 BABEL-5186 smalldatetime_date_cmp-before-15_5-16_1 test_conv_money_to_varchar - +fixeddecimal_modulo diff --git a/test/JDBC/upgrade/14_15/schedule b/test/JDBC/upgrade/14_15/schedule index 4a48668826..496f23e960 100644 --- a/test/JDBC/upgrade/14_15/schedule +++ b/test/JDBC/upgrade/14_15/schedule @@ -468,3 +468,4 @@ BABEL-CASE_EXPR-before-16_5-or-15_9 BABEL-5186 smalldatetime_date_cmp-before-15_5-16_1 test_conv_money_to_varchar +fixeddecimal_modulo diff --git a/test/JDBC/upgrade/14_16/schedule b/test/JDBC/upgrade/14_16/schedule index 029c1ad9e4..d5602a5eee 100644 --- a/test/JDBC/upgrade/14_16/schedule +++ b/test/JDBC/upgrade/14_16/schedule @@ -467,3 +467,4 @@ BABEL-CASE_EXPR-before-16_5-or-15_9 BABEL-5186 smalldatetime_date_cmp-before-15_5-16_1 test_conv_money_to_varchar +fixeddecimal_modulo diff --git a/test/JDBC/upgrade/14_3/schedule b/test/JDBC/upgrade/14_3/schedule index ebb8ec96df..a8ce829680 100644 --- a/test/JDBC/upgrade/14_3/schedule +++ b/test/JDBC/upgrade/14_3/schedule @@ -388,4 +388,4 @@ BABEL-CASE_EXPR-before-16_5-or-15_9 BABEL-5186 smalldatetime_date_cmp-before-15_5-16_1 test_conv_money_to_varchar - +fixeddecimal_modulo diff --git a/test/JDBC/upgrade/14_5/schedule b/test/JDBC/upgrade/14_5/schedule index 6ce353c868..68973dd52b 100644 --- a/test/JDBC/upgrade/14_5/schedule +++ b/test/JDBC/upgrade/14_5/schedule @@ -399,4 +399,4 @@ BABEL-CASE_EXPR-before-16_5-or-15_9 BABEL-5186 smalldatetime_date_cmp-before-15_5-16_1 test_conv_money_to_varchar - +fixeddecimal_modulo diff --git a/test/JDBC/upgrade/14_6/schedule b/test/JDBC/upgrade/14_6/schedule index 40245a9b3d..9ad6c3cbef 100644 --- a/test/JDBC/upgrade/14_6/schedule +++ b/test/JDBC/upgrade/14_6/schedule @@ -436,4 +436,4 @@ BABEL-CASE_EXPR-before-16_5-or-15_9 BABEL-5186 smalldatetime_date_cmp-before-15_5-16_1 test_conv_money_to_varchar - +fixeddecimal_modulo diff --git a/test/JDBC/upgrade/14_7/schedule b/test/JDBC/upgrade/14_7/schedule index 9cb05822ba..1597b12db3 100644 --- a/test/JDBC/upgrade/14_7/schedule +++ b/test/JDBC/upgrade/14_7/schedule @@ -457,4 +457,4 @@ BABEL-CASE_EXPR-before-16_5-or-15_9 BABEL-5186 smalldatetime_date_cmp-before-15_5-16_1 test_conv_money_to_varchar - +fixeddecimal_modulo diff --git a/test/JDBC/upgrade/14_8/schedule b/test/JDBC/upgrade/14_8/schedule index d3cee54aad..6174ebb962 100644 --- a/test/JDBC/upgrade/14_8/schedule +++ b/test/JDBC/upgrade/14_8/schedule @@ -458,4 +458,4 @@ BABEL-CASE_EXPR-before-16_5-or-15_9 BABEL-5186 smalldatetime_date_cmp-before-15_5-16_1 test_conv_money_to_varchar - +fixeddecimal_modulo diff --git a/test/JDBC/upgrade/14_9/schedule b/test/JDBC/upgrade/14_9/schedule index ab8d0a9039..eee5d8b663 100644 --- a/test/JDBC/upgrade/14_9/schedule +++ b/test/JDBC/upgrade/14_9/schedule @@ -462,4 +462,4 @@ BABEL-CASE_EXPR-before-16_5-or-15_9 BABEL-5186 smalldatetime_date_cmp-before-15_5-16_1 test_conv_money_to_varchar - +fixeddecimal_modulo diff --git a/test/JDBC/upgrade/15_1/schedule b/test/JDBC/upgrade/15_1/schedule index b8ade34f56..700edfb03a 100644 --- a/test/JDBC/upgrade/15_1/schedule +++ b/test/JDBC/upgrade/15_1/schedule @@ -437,4 +437,4 @@ BABEL-5186 BABEL-2736-before-15_3 smalldatetime_date_cmp-before-15_5-16_1 test_conv_money_to_varchar - +fixeddecimal_modulo diff --git a/test/JDBC/upgrade/15_10/schedule b/test/JDBC/upgrade/15_10/schedule index 3b3f6a2964..db8aa1ebf0 100644 --- a/test/JDBC/upgrade/15_10/schedule +++ b/test/JDBC/upgrade/15_10/schedule @@ -573,3 +573,4 @@ BABEL-5186 BABEL-2736 smalldatetime_date_cmp test_conv_money_to_varchar +fixeddecimal_modulo diff --git a/test/JDBC/upgrade/15_2/schedule b/test/JDBC/upgrade/15_2/schedule index 3b63143f05..962aad6e13 100644 --- a/test/JDBC/upgrade/15_2/schedule +++ b/test/JDBC/upgrade/15_2/schedule @@ -473,4 +473,4 @@ BABEL-5186 BABEL-2736-before-15_3 smalldatetime_date_cmp-before-15_5-16_1 test_conv_money_to_varchar - +fixeddecimal_modulo diff --git a/test/JDBC/upgrade/15_3/schedule b/test/JDBC/upgrade/15_3/schedule index 493e7ed3bf..7822cfbd3f 100644 --- a/test/JDBC/upgrade/15_3/schedule +++ b/test/JDBC/upgrade/15_3/schedule @@ -491,4 +491,4 @@ BABEL-5186 BABEL-2736-before-16_5 smalldatetime_date_cmp-before-15_5-16_1 test_conv_money_to_varchar - +fixeddecimal_modulo diff --git a/test/JDBC/upgrade/15_4/schedule b/test/JDBC/upgrade/15_4/schedule index 06f77b5bc2..4ac8c447db 100644 --- a/test/JDBC/upgrade/15_4/schedule +++ b/test/JDBC/upgrade/15_4/schedule @@ -505,4 +505,4 @@ BABEL-5186 BABEL-2736-before-16_5 smalldatetime_date_cmp-before-15_5-16_1 test_conv_money_to_varchar - +fixeddecimal_modulo diff --git a/test/JDBC/upgrade/15_5/schedule b/test/JDBC/upgrade/15_5/schedule index 6a3c0bd994..4c999b43a7 100644 --- a/test/JDBC/upgrade/15_5/schedule +++ b/test/JDBC/upgrade/15_5/schedule @@ -537,4 +537,4 @@ BABEL-5186 BABEL-2736-before-16_5 smalldatetime_date_cmp test_conv_money_to_varchar - +fixeddecimal_modulo diff --git a/test/JDBC/upgrade/15_6/schedule b/test/JDBC/upgrade/15_6/schedule index 86ea4ed19c..7899984313 100644 --- a/test/JDBC/upgrade/15_6/schedule +++ b/test/JDBC/upgrade/15_6/schedule @@ -553,4 +553,4 @@ BABEL-5186 BABEL-2736-before-16_5 smalldatetime_date_cmp test_conv_money_to_varchar - +fixeddecimal_modulo diff --git a/test/JDBC/upgrade/15_7/schedule b/test/JDBC/upgrade/15_7/schedule index 82f4ca93ba..f5457c6cca 100644 --- a/test/JDBC/upgrade/15_7/schedule +++ b/test/JDBC/upgrade/15_7/schedule @@ -562,4 +562,4 @@ BABEL-5186 BABEL-2736-before-16_5 smalldatetime_date_cmp test_conv_money_to_varchar - +fixeddecimal_modulo diff --git a/test/JDBC/upgrade/15_8/schedule b/test/JDBC/upgrade/15_8/schedule index 42731c3ce2..5e20d51519 100644 --- a/test/JDBC/upgrade/15_8/schedule +++ b/test/JDBC/upgrade/15_8/schedule @@ -569,4 +569,4 @@ BABEL-5186 BABEL-2736-before-16_5 smalldatetime_date_cmp test_conv_money_to_varchar - +fixeddecimal_modulo diff --git a/test/JDBC/upgrade/latest/schedule b/test/JDBC/upgrade/latest/schedule index f1371d86ab..705fe3c015 100644 --- a/test/JDBC/upgrade/latest/schedule +++ b/test/JDBC/upgrade/latest/schedule @@ -572,3 +572,4 @@ BABEL-5186 BABEL-2736 smalldatetime_date_cmp test_conv_money_to_varchar +fixeddecimal_modulo diff --git a/test/python/expected/upgrade_validation/expected_dependency.out b/test/python/expected/upgrade_validation/expected_dependency.out index fdebf94017..407ba91d8d 100644 --- a/test/python/expected/upgrade_validation/expected_dependency.out +++ b/test/python/expected/upgrade_validation/expected_dependency.out @@ -777,6 +777,8 @@ Operator =(text,sys.bpchar) Operator >(sys.bpchar,sys.bpchar) Operator >=(sys."varchar",sys."varchar") Operator >=(sys.bpchar,sys.bpchar) +Operator sys.%(sys.money,sys.money) +Operator sys.%(sys.smallmoney,sys.smallmoney) Operator sys.*(bigint,sys.fixeddecimal) Operator sys.*(bigint,sys.smallmoney) Operator sys.*(integer,sys.fixeddecimal)