diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2022-07-25 10:28:45 +0300 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2022-07-25 10:28:45 +0300 |
commit | 8aa37c264f1c67beb9dc5cd4127379f0e596e3f5 (patch) | |
tree | 57ed292d226028d9819bb9af2c5b527f5d2752db /mysql-test/suite/innodb/t/foreign_key.test | |
parent | e55c3dc33fb010cbc190002349e79a70d02db9a0 (diff) | |
download | mariadb-git-8aa37c264f1c67beb9dc5cd4127379f0e596e3f5.tar.gz |
MDEV-28980 InnoDB: Failing assertion: len <= MAX_TABLE_NAME_LEN
dict_load_foreigns(): Use a correctly sized buffer for the maximum-length
SYS_FOREIGN.ID. In case of overflow, do not crash the server but instead
return DB_CORRUPTION.
Diffstat (limited to 'mysql-test/suite/innodb/t/foreign_key.test')
-rw-r--r-- | mysql-test/suite/innodb/t/foreign_key.test | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/mysql-test/suite/innodb/t/foreign_key.test b/mysql-test/suite/innodb/t/foreign_key.test index af23dbdbb28..3fdaccbc42a 100644 --- a/mysql-test/suite/innodb/t/foreign_key.test +++ b/mysql-test/suite/innodb/t/foreign_key.test @@ -881,4 +881,33 @@ 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 + --source include/wait_until_count_sessions.inc |