Skip to content

Commit e1cbca1

Browse files
author
Alexander Barkov
committed
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.
1 parent b50c607 commit e1cbca1

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

mysql-test/r/func_hybrid_type.result

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2307,5 +2307,15 @@ t1 CREATE TABLE `t1` (
23072307
) ENGINE=MyISAM DEFAULT CHARSET=latin1
23082308
DROP TABLE t1;
23092309
#
2310+
# MDEV-657 LP:873142 - GREATEST() does not always return same signness of argument types
2311+
#
2312+
CREATE TABLE t1 (a BIGINT(20) UNSIGNED NOT NULL PRIMARY KEY);
2313+
INSERT INTO t1 (a) VALUES (13836376518955650385) ON DUPLICATE KEY UPDATE a=GREATEST(a,VALUES(a));
2314+
INSERT INTO t1 (a) VALUES (13836376518955650385) ON DUPLICATE KEY UPDATE a=GREATEST(a,VALUES(a));
2315+
SELECT * FROM t1;
2316+
a
2317+
13836376518955650385
2318+
DROP TABLE t1;
2319+
#
23102320
# End of 10.1 tests
23112321
#

mysql-test/t/func_hybrid_type.test

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,15 @@ CREATE TABLE t1 AS SELECT LEAST(1.0,'10');
102102
SHOW CREATE TABLE t1;
103103
DROP TABLE t1;
104104

105+
--echo #
106+
--echo # MDEV-657 LP:873142 - GREATEST() does not always return same signness of argument types
107+
--echo #
108+
CREATE TABLE t1 (a BIGINT(20) UNSIGNED NOT NULL PRIMARY KEY);
109+
INSERT INTO t1 (a) VALUES (13836376518955650385) ON DUPLICATE KEY UPDATE a=GREATEST(a,VALUES(a));
110+
INSERT INTO t1 (a) VALUES (13836376518955650385) ON DUPLICATE KEY UPDATE a=GREATEST(a,VALUES(a));
111+
SELECT * FROM t1;
112+
DROP TABLE t1;
113+
105114
--echo #
106115
--echo # End of 10.1 tests
107116
--echo #

0 commit comments

Comments
 (0)