summaryrefslogtreecommitdiff
path: root/mysql-test/main
diff options
context:
space:
mode:
authorAleksey Midenkov <midenok@gmail.com>2021-11-19 18:06:48 +0300
committerAleksey Midenkov <midenok@gmail.com>2021-11-19 18:06:48 +0300
commit32e8e8479507db6736a1983dbde5f0fcb64f80db (patch)
tree38251c865fb48da11676a10d90fc1aadec5fa226 /mysql-test/main
parentd9a5c5db072e58cc21d462d107f9e018329011a4 (diff)
downloadmariadb-git-32e8e8479507db6736a1983dbde5f0fcb64f80db.tar.gz
MDEV-27048 UBSAN: runtime error: shift exponent 32 is too large for 32-bit type 'unsigned int'bb-10.7-midenok2
32-bit variable must be expanded to 64-bit before shift left.
Diffstat (limited to 'mysql-test/main')
-rw-r--r--mysql-test/main/alter_table.result10
-rw-r--r--mysql-test/main/alter_table.test12
2 files changed, 22 insertions, 0 deletions
diff --git a/mysql-test/main/alter_table.result b/mysql-test/main/alter_table.result
index ceeebd52978..e9977bd0d5e 100644
--- a/mysql-test/main/alter_table.result
+++ b/mysql-test/main/alter_table.result
@@ -3422,3 +3422,13 @@ drop table t1;
#
alter table txxx engine=innodb, rename to tyyy;
ERROR 42S02: Table 'test.txxx' doesn't exist
+#
+# MDEV-27048 UBSAN: runtime error: shift exponent 32 is too large for 32-bit type 'unsigned int'
+#
+CREATE TABLE t (a INT,b INT,c INT,x TEXT,y TEXT,z TEXT,id INT UNSIGNED AUTO_INCREMENT,i INT,KEY(id),UNIQUE KEY a (a,b,c));
+ALTER TABLE t ADD CONSTRAINT test UNIQUE (id) USING HASH;
+ERROR HY000: Function or expression 'AUTO_INCREMENT' cannot be used in the USING HASH clause of `id`
+DROP TABLE t;
+#
+# End of 10.7 tests
+#
diff --git a/mysql-test/main/alter_table.test b/mysql-test/main/alter_table.test
index 6dcb77c650e..31c69783248 100644
--- a/mysql-test/main/alter_table.test
+++ b/mysql-test/main/alter_table.test
@@ -2670,3 +2670,15 @@ drop table t1;
--echo #
--error ER_NO_SUCH_TABLE
alter table txxx engine=innodb, rename to tyyy;
+
+--echo #
+--echo # MDEV-27048 UBSAN: runtime error: shift exponent 32 is too large for 32-bit type 'unsigned int'
+--echo #
+CREATE TABLE t (a INT,b INT,c INT,x TEXT,y TEXT,z TEXT,id INT UNSIGNED AUTO_INCREMENT,i INT,KEY(id),UNIQUE KEY a (a,b,c));
+--error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED
+ALTER TABLE t ADD CONSTRAINT test UNIQUE (id) USING HASH;
+DROP TABLE t;
+
+--echo #
+--echo # End of 10.7 tests
+--echo #