| 1 |
--source include/have_ndb.inc |
| 2 |
|
| 3 |
--echo # |
| 4 |
--echo # Bug#27769521 CREATE TABLE WITH MORE THAN 128 BYTES NAME IN NDB |
| 5 |
--echo # |
| 6 |
--echo # Preconditions: |
| 7 |
--echo # 1) Max length of a table name in NDB is currently 128 bytes. |
| 8 |
--echo # 2) The MySQL Server creates tables in NDB using name on the form |
| 9 |
--echo # <db_name>/<catalog_name>/<table_name> where <catalog_name> is |
| 10 |
--echo # always hardcoded to "def". |
| 11 |
--echo # 3) The current limit of identifier names in MySQL is 64 characters, |
| 12 |
--echo # but for NDB tables the limit is currently only 63 bytes |
| 13 |
--echo # due to a legacy bug. |
| 14 |
--echo # |
| 15 |
--echo # |
| 16 |
--echo # Using two maximum length identifiers(i.e 63 bytes) it's possible to |
| 17 |
--echo # hit the 128 bytes limit in NDB. Unfortunately the ndbcluster plugin |
| 18 |
--echo # does not detect this error correctly and returns the error: |
| 19 |
--echo # "Table '<long identifier>' doesn't exist" |
| 20 |
--echo # |
| 21 |
|
| 22 |
let $max_identifier = |
| 23 |
abcdefghijklmnopqrstuvxyzabcdefghijklmnopqrstuvxyzabcdefghijklm; |
| 24 |
eval select LENGTH('$max_identifier'); |
| 25 |
|
| 26 |
eval CREATE DATABASE $max_identifier; |
| 27 |
eval use $max_identifier; |
| 28 |
--error ER_CANT_CREATE_TABLE |
| 29 |
eval CREATE TABLE $max_identifier ( |
| 30 |
a int primary key |
| 31 |
) engine = NDB; |
| 32 |
SHOW WARNINGS; |
| 33 |
|
| 34 |
eval DROP DATABASE $max_identifier; |
| 35 |
|