Commit e1cbca18 authored by Alexander Barkov's avatar Alexander Barkov

MDEV-657 LP:873142 - GREATEST() does not always return same signness of argument types.

The patch for MDEV-8871 also fixed the problem reported in MDEV-657.
Adding the test case from the bug report.
parent b50c6070
......@@ -2307,5 +2307,15 @@ t1 CREATE TABLE `t1` (
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1;
#
# MDEV-657 LP:873142 - GREATEST() does not always return same signness of argument types
#
CREATE TABLE t1 (a BIGINT(20) UNSIGNED NOT NULL PRIMARY KEY);
INSERT INTO t1 (a) VALUES (13836376518955650385) ON DUPLICATE KEY UPDATE a=GREATEST(a,VALUES(a));
INSERT INTO t1 (a) VALUES (13836376518955650385) ON DUPLICATE KEY UPDATE a=GREATEST(a,VALUES(a));
SELECT * FROM t1;
a
13836376518955650385
DROP TABLE t1;
#
# End of 10.1 tests
#
......@@ -102,6 +102,15 @@ CREATE TABLE t1 AS SELECT LEAST(1.0,'10');
SHOW CREATE TABLE t1;
DROP TABLE t1;
--echo #
--echo # MDEV-657 LP:873142 - GREATEST() does not always return same signness of argument types
--echo #
CREATE TABLE t1 (a BIGINT(20) UNSIGNED NOT NULL PRIMARY KEY);
INSERT INTO t1 (a) VALUES (13836376518955650385) ON DUPLICATE KEY UPDATE a=GREATEST(a,VALUES(a));
INSERT INTO t1 (a) VALUES (13836376518955650385) ON DUPLICATE KEY UPDATE a=GREATEST(a,VALUES(a));
SELECT * FROM t1;
DROP TABLE t1;
--echo #
--echo # End of 10.1 tests
--echo #
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment