1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

MDEV-21278 Assertion is_unsigned() == attr.unsigned_flag' or Assertion field.is_sane()' failed

The type handler and unsigned_flag erroneously went out of sync in
Item_func_minus::fix_length_and_dec.
This commit is contained in:
Alexander Barkov
2019-12-12 17:06:42 +04:00
parent ce41a9075a
commit bbd2fa5c65
3 changed files with 73 additions and 3 deletions

View File

@ -1736,3 +1736,36 @@ DROP TABLE t1,t2;
--echo #
--echo # End of 10.4 tests
--echo #
--echo #
--echo # Start of 10.5 tests
--echo #
--echo #
--echo # MDEV-21278 Assertion `is_unsigned() == attr.unsigned_flag' or Assertion `field.is_sane()' failed
--echo #
CREATE TABLE t1 (a TIMESTAMP);
INSERT INTO t1 VALUES (NULL),(NULL);
SET SESSION SQL_MODE= 'NO_UNSIGNED_SUBTRACTION';
--replace_column 1 xxx
SELECT DISTINCT UUID_SHORT() - a FROM t1;
CREATE TABLE t2 AS SELECT DISTINCT UUID_SHORT() - a FROM t1;
SHOW CREATE TABLE t2;
DROP TABLE t2, t1;
SET sql_mode=DEFAULT;
CREATE TABLE t1 (a TIMESTAMP);
INSERT INTO t1 VALUES (NULL),(NULL);
SET SESSION SQL_MODE= 'NO_UNSIGNED_SUBTRACTION';
--replace_column 1 xxx
SELECT UUID_SHORT() - a FROM t1;
CREATE TABLE t2 AS SELECT UUID_SHORT() - a FROM t1;
SHOW CREATE TABLE t2;
DROP TABLE t2, t1;
--echo #
--echo # End of 10.5 tests
--echo #