summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/suite/innodb/r/dropdb.result10
-rw-r--r--mysql-test/suite/innodb/t/dropdb.test11
2 files changed, 21 insertions, 0 deletions
diff --git a/mysql-test/suite/innodb/r/dropdb.result b/mysql-test/suite/innodb/r/dropdb.result
index e612b02b4c8..e1ff475b304 100644
--- a/mysql-test/suite/innodb/r/dropdb.result
+++ b/mysql-test/suite/innodb/r/dropdb.result
@@ -10,3 +10,13 @@ create table `#mysql50#q.q` select 1;
ERROR 42000: Incorrect table name '#mysql50#q.q'
create table `#mysql50#q·q` select 1;
drop database `b`;
+#
+# MDEV-27336 Crash on DROP DATABASE due to out-of-bounds result
+# from InnoDB SUBSTR() function
+#
+USE test;
+CREATE TABLE t1(a INT PRIMARY KEY) ENGINE=InnoDB;
+CREATE TABLE t2(a INT PRIMARY KEY REFERENCES t1(a)) ENGINE=InnoDB;
+CREATE DATABASE somewhat_longer_name_to_cause_trouble;
+DROP DATABASE somewhat_longer_name_to_cause_trouble;
+DROP TABLE t2,t1;
diff --git a/mysql-test/suite/innodb/t/dropdb.test b/mysql-test/suite/innodb/t/dropdb.test
index 5e45e8608c2..f27aede78ec 100644
--- a/mysql-test/suite/innodb/t/dropdb.test
+++ b/mysql-test/suite/innodb/t/dropdb.test
@@ -14,3 +14,14 @@ use `b`;
create table `#mysql50#q.q` select 1;
create table `#mysql50#q·q` select 1;
drop database `b`;
+
+--echo #
+--echo # MDEV-27336 Crash on DROP DATABASE due to out-of-bounds result
+--echo # from InnoDB SUBSTR() function
+--echo #
+USE test;
+CREATE TABLE t1(a INT PRIMARY KEY) ENGINE=InnoDB;
+CREATE TABLE t2(a INT PRIMARY KEY REFERENCES t1(a)) ENGINE=InnoDB;
+CREATE DATABASE somewhat_longer_name_to_cause_trouble;
+DROP DATABASE somewhat_longer_name_to_cause_trouble;
+DROP TABLE t2,t1;