diff options
Diffstat (limited to 'mysql-test/suite/innodb')
-rw-r--r-- | mysql-test/suite/innodb/r/foreign_key.result | 14 | ||||
-rw-r--r-- | mysql-test/suite/innodb/r/foreign_key_not_windows.result | 16 | ||||
-rw-r--r-- | mysql-test/suite/innodb/r/instant_alter_bugs.result | 7 | ||||
-rw-r--r-- | mysql-test/suite/innodb/t/foreign_key.test | 29 | ||||
-rw-r--r-- | mysql-test/suite/innodb/t/foreign_key_not_windows.test | 45 | ||||
-rw-r--r-- | mysql-test/suite/innodb/t/instant_alter_bugs.test | 9 |
6 files changed, 120 insertions, 0 deletions
diff --git a/mysql-test/suite/innodb/r/foreign_key.result b/mysql-test/suite/innodb/r/foreign_key.result index ac1c5c1763b..189fed1d48e 100644 --- a/mysql-test/suite/innodb/r/foreign_key.result +++ b/mysql-test/suite/innodb/r/foreign_key.result @@ -855,6 +855,20 @@ Error 1296 Got error 193 '`test`.`t1`, CONSTRAINT `t1_ibfk_1` FOREIGN KEY (`a`) DROP TABLE t1; FOUND 1 /InnoDB: Cannot delete/update rows with cascading foreign key constraints that exceed max depth of 15.*/ in mysqld.1.err # End of 10.2 tests +# +# MDEV-28980 InnoDB: Failing assertion: len <= MAX_TABLE_NAME_LEN +# +SET NAMES utf8; +CREATE TABLE t (a INT PRIMARY KEY) ENGINE=InnoDB; +CREATE DATABASE `db`; +CREATE TABLE `db`.u ( +a INT PRIMARY KEY, +CONSTRAINT `††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††` + FOREIGN KEY (a) REFERENCES test.t (a)) ENGINE=InnoDB; +DROP TABLE `db`.u; +DROP DATABASE `db`; +DROP TABLE t; +# End of 10.3 tests CREATE TABLE t1 (a GEOMETRY, INDEX(a(8)), FOREIGN KEY (a) REFERENCES x (xx)) ENGINE=InnoDB; ERROR HY000: Can't create table `test`.`t1` (errno: 150 "Foreign key constraint is incorrectly formed") diff --git a/mysql-test/suite/innodb/r/foreign_key_not_windows.result b/mysql-test/suite/innodb/r/foreign_key_not_windows.result new file mode 100644 index 00000000000..764ba911214 --- /dev/null +++ b/mysql-test/suite/innodb/r/foreign_key_not_windows.result @@ -0,0 +1,16 @@ +# +# MDEV-28980 InnoDB: Failing assertion: len <= MAX_TABLE_NAME_LEN +# +CREATE TABLE t (a INT PRIMARY KEY) ENGINE=InnoDB; +CREATE DATABASE `d255`; +CREATE TABLE `d255`.`d255` +(a INT PRIMARY KEY, FOREIGN KEY(a) REFERENCES test.t(a)) ENGINE=InnoDB; +ERROR HY000: Long database name and identifier for object resulted in path length exceeding 512 characters. Path: './@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023/@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@ +CREATE TABLE `d255`.`_##################################################` +(a INT PRIMARY KEY, FOREIGN KEY(a) REFERENCES test.t(a)) ENGINE=InnoDB; +ERROR HY000: Long database name and identifier for object resulted in path length exceeding 512 characters. Path: './@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023/_@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023 +CREATE TABLE `d255`.`##################################################` +(a INT PRIMARY KEY, FOREIGN KEY(a) REFERENCES test.t(a)) ENGINE=InnoDB; +DROP DATABASE `d255`; +DROP TABLE t; +# End of 10.3 tests diff --git a/mysql-test/suite/innodb/r/instant_alter_bugs.result b/mysql-test/suite/innodb/r/instant_alter_bugs.result index 1f8351b87f0..72d112deb87 100644 --- a/mysql-test/suite/innodb/r/instant_alter_bugs.result +++ b/mysql-test/suite/innodb/r/instant_alter_bugs.result @@ -461,3 +461,10 @@ f4 INT NOT NULL, f5 INT NOT NULL), CHANGE COLUMN f1 f1 CHAR(10) DEFAULT NULL; DROP TABLE t1; SET GLOBAL innodb_purge_rseg_truncate_frequency=@save_frequency; +# +# MDEV-26420 Buffer overflow on instant ADD/DROP of generated column +# +CREATE TABLE t1 (i int AS (0) STORED, j INT) ENGINE=InnoDB; +ALTER TABLE t1 ADD COLUMN i INT GENERATED ALWAYS AS (1), DROP COLUMN i; +DROP TABLE t1; +# End of 10.4 tests diff --git a/mysql-test/suite/innodb/t/foreign_key.test b/mysql-test/suite/innodb/t/foreign_key.test index f4ec45971fe..321c78a5598 100644 --- a/mysql-test/suite/innodb/t/foreign_key.test +++ b/mysql-test/suite/innodb/t/foreign_key.test @@ -881,6 +881,35 @@ let SEARCH_PATTERN= InnoDB: Cannot delete/update rows with cascading foreign key --echo # End of 10.2 tests +--echo # +--echo # MDEV-28980 InnoDB: Failing assertion: len <= MAX_TABLE_NAME_LEN +--echo # + +SET NAMES utf8; +CREATE TABLE t (a INT PRIMARY KEY) ENGINE=InnoDB; +# The maximum identifier length is 64 characters. +# my_charset_filename will expand some characters to 5 characters, +# e.g., # to @0023. +# Many operating systems (such as Linux) or file systems +# limit the path component length to 255 bytes, such as 51*5 characters. +# The bug was repeated with a shorter length, which we will use here, +# to avoid exceeding MAX_PATH on Microsoft Windows. +let $db=##########################; +--replace_result $db db +eval CREATE DATABASE `$db`; +--replace_result $db db +eval CREATE TABLE `$db`.u ( + a INT PRIMARY KEY, + CONSTRAINT `††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††` + FOREIGN KEY (a) REFERENCES test.t (a)) ENGINE=InnoDB; +--replace_result $db db +eval DROP TABLE `$db`.u; +--replace_result $db db +eval DROP DATABASE `$db`; +DROP TABLE t; + +--echo # End of 10.3 tests + # MDEV-21792 Server aborts upon attempt to create foreign key on spatial field # Fail to create foreign key for spatial fields --error ER_CANT_CREATE_TABLE diff --git a/mysql-test/suite/innodb/t/foreign_key_not_windows.test b/mysql-test/suite/innodb/t/foreign_key_not_windows.test new file mode 100644 index 00000000000..7ad3723d5de --- /dev/null +++ b/mysql-test/suite/innodb/t/foreign_key_not_windows.test @@ -0,0 +1,45 @@ +--source include/have_innodb.inc +# On Microsoft Windows, there is an additional limit of MAX_PATH +--source include/not_windows.inc +# The embedded server prepends --datadir or --innodb-data-home-dir +# to the path names, which reduces the maximum length of names further. +--source include/not_embedded.inc + +--echo # +--echo # MDEV-28980 InnoDB: Failing assertion: len <= MAX_TABLE_NAME_LEN +--echo # + +# The main test is innodb.foreign_key. This is an additional test that +# the maximum length cannot be exceeded for implicitly created +# constraint names. On Microsoft Windows, MAX_PATH is a much stricter +# limit than the 255-byte maximum path component length on many other systems, +# including Linux and IBM AIX. + +CREATE TABLE t (a INT PRIMARY KEY) ENGINE=InnoDB; + +# The maximum identifier length is 64 characters. +# my_charset_filename will expand some characters to 5 characters, +# e.g., # to @0023. +# Many operating systems (such as Linux) or file systems +# limit the path component length to 255 bytes, +# corresponding to the 51 characters below: 5*51=255. +let $d255=###################################################; +let $d250=##################################################; +--replace_result $d255 d255 +eval CREATE DATABASE `$d255`; +--replace_result $d255 d255 +--error ER_IDENT_CAUSES_TOO_LONG_PATH +eval CREATE TABLE `$d255`.`$d255` +(a INT PRIMARY KEY, FOREIGN KEY(a) REFERENCES test.t(a)) ENGINE=InnoDB; +--replace_result $d255 d255 +--error ER_IDENT_CAUSES_TOO_LONG_PATH +eval CREATE TABLE `$d255`.`_$d250` +(a INT PRIMARY KEY, FOREIGN KEY(a) REFERENCES test.t(a)) ENGINE=InnoDB; +--replace_result $d255 d255 +eval CREATE TABLE `$d255`.`$d250` +(a INT PRIMARY KEY, FOREIGN KEY(a) REFERENCES test.t(a)) ENGINE=InnoDB; +--replace_result $d255 d255 +eval DROP DATABASE `$d255`; +DROP TABLE t; + +--echo # End of 10.3 tests diff --git a/mysql-test/suite/innodb/t/instant_alter_bugs.test b/mysql-test/suite/innodb/t/instant_alter_bugs.test index ada7f9e2bfe..bf39baac12a 100644 --- a/mysql-test/suite/innodb/t/instant_alter_bugs.test +++ b/mysql-test/suite/innodb/t/instant_alter_bugs.test @@ -477,3 +477,12 @@ ALTER TABLE t1 ADD COLUMN(f2 INT NOT NULL, f3 INT NOT NULL, CHANGE COLUMN f1 f1 CHAR(10) DEFAULT NULL; DROP TABLE t1; SET GLOBAL innodb_purge_rseg_truncate_frequency=@save_frequency; + +--echo # +--echo # MDEV-26420 Buffer overflow on instant ADD/DROP of generated column +--echo # +CREATE TABLE t1 (i int AS (0) STORED, j INT) ENGINE=InnoDB; +ALTER TABLE t1 ADD COLUMN i INT GENERATED ALWAYS AS (1), DROP COLUMN i; +DROP TABLE t1; + +--echo # End of 10.4 tests |