Commit f76a1df0 authored by Aleksey Midenkov's avatar Aleksey Midenkov

MDEV-21127 Assertion failed in key_text::key_text

Wrong condition for corner values.
parent cdc2508e
...@@ -199,3 +199,10 @@ b char(255), ...@@ -199,3 +199,10 @@ b char(255),
FOREIGN KEY ( a012345678901234567890123456789012345678901, b ) REFERENCES tx (ax, bx) FOREIGN KEY ( a012345678901234567890123456789012345678901, b ) REFERENCES tx (ax, bx)
) ENGINE=InnoDB; ) ENGINE=InnoDB;
ERROR HY000: Can't create table `test`.`t1` (errno: 150 "Foreign key constraint is incorrectly formed") ERROR HY000: Can't create table `test`.`t1` (errno: 150 "Foreign key constraint is incorrectly formed")
CREATE TABLE t1 (
a012345678901234567 int,
b int,
c0123456789012345678 int,
FOREIGN KEY (a012345678901234567,c0123456789012345678,b) REFERENCES tx (x1,x2,x3)
) ENGINE=InnoDB;
ERROR HY000: Can't create table `test`.`t1` (errno: 150 "Foreign key constraint is incorrectly formed")
...@@ -236,3 +236,11 @@ CREATE TABLE t1 ( ...@@ -236,3 +236,11 @@ CREATE TABLE t1 (
b char(255), b char(255),
FOREIGN KEY ( a012345678901234567890123456789012345678901, b ) REFERENCES tx (ax, bx) FOREIGN KEY ( a012345678901234567890123456789012345678901, b ) REFERENCES tx (ax, bx)
) ENGINE=InnoDB; ) ENGINE=InnoDB;
--error ER_CANT_CREATE_TABLE
CREATE TABLE t1 (
a012345678901234567 int,
b int,
c0123456789012345678 int,
FOREIGN KEY (a012345678901234567,c0123456789012345678,b) REFERENCES tx (x1,x2,x3)
) ENGINE=InnoDB;
...@@ -12118,7 +12118,7 @@ class key_text ...@@ -12118,7 +12118,7 @@ class key_text
*(ptr++) = ' '; *(ptr++) = ' ';
} }
} else { } else {
ut_ad((size_t)(ptr - buf) < MAX_TEXT - 4); ut_ad((size_t)(ptr - buf) <= MAX_TEXT - 4);
memcpy(ptr, "...", 3); memcpy(ptr, "...", 3);
ptr += 3; ptr += 3;
break; break;
......
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