Commit 42738f5f authored by Alexander Barkov's avatar Alexander Barkov

MDEV-30681 SIGFPE / UBSAN runtime error: division by zero in String::needs_conversion on ALTER

The problem was earlier fixed by MDEV-30805. Adding an MTR test only.
parent b27167c6
......@@ -39,5 +39,17 @@ t1 CREATE TABLE `t1` (
(PARTITION `p0` VALUES LESS THAN ('a') ENGINE = MyISAM)
DROP TABLE t1;
#
# MDEV-30681 SIGFPE / UBSAN runtime error: division by zero in String::needs_conversion on ALTER
#
CREATE TABLE t1 (a BINARY (10)) PARTITION BY LIST COLUMNS (a) (PARTITION p VALUES IN (0xFF));
SELECT COLUMN_TYPE, COLLATION_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME='t1';
COLUMN_TYPE COLLATION_NAME
binary(10) NULL
ALTER TABLE t1 CHANGE COLUMN a a CHAR(10) BINARY;
SELECT COLUMN_TYPE, COLLATION_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME='t1';
COLUMN_TYPE COLLATION_NAME
char(10) latin1_bin
DROP TABLE t1;
#
# End of 10.9 tests
#
......@@ -43,6 +43,17 @@ ALTER TABLE t1 CHANGE COLUMN a a CHAR BINARY;
SHOW CREATE TABLE t1;
DROP TABLE t1;
--echo #
--echo # MDEV-30681 SIGFPE / UBSAN runtime error: division by zero in String::needs_conversion on ALTER
--echo #
CREATE TABLE t1 (a BINARY (10)) PARTITION BY LIST COLUMNS (a) (PARTITION p VALUES IN (0xFF));
SELECT COLUMN_TYPE, COLLATION_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME='t1';
ALTER TABLE t1 CHANGE COLUMN a a CHAR(10) BINARY;
SELECT COLUMN_TYPE, COLLATION_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME='t1';
DROP TABLE t1;
--echo #
--echo # End of 10.9 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