36 lines
1.2 KiB
Plaintext
36 lines
1.2 KiB
Plaintext
--source include/have_ndb.inc
|
|
|
|
--echo #
|
|
--echo # Bug#27769521 CREATE TABLE WITH MORE THAN 128 BYTES NAME IN NDB
|
|
--echo #
|
|
--echo # Preconditions:
|
|
--echo # 1) Max length of a table name in NDB is currently 128 bytes.
|
|
--echo # 2) The MySQL Server creates tables in NDB using name on the form
|
|
--echo # <db_name>/<catalog_name>/<table_name> where <catalog_name> is
|
|
--echo # always hardcoded to "def".
|
|
--echo # 3) The current limit of identifier names in MySQL is 64 characters,
|
|
--echo # but for NDB tables the limit is currently only 63 bytes
|
|
--echo # due to a legacy bug.
|
|
--echo #
|
|
--echo #
|
|
--echo # Using two maximum length identifiers(i.e 63 bytes) it's possible to
|
|
--echo # hit the 128 bytes limit in NDB. Unfortunately the ndbcluster plugin
|
|
--echo # does not detect this error correctly and returns the error:
|
|
--echo # "Table '<long identifier>' doesn't exist"
|
|
--echo #
|
|
|
|
let $max_identifier =
|
|
abcdefghijklmnopqrstuvxyzabcdefghijklmnopqrstuvxyzabcdefghijklm;
|
|
eval select LENGTH('$max_identifier');
|
|
|
|
eval CREATE DATABASE $max_identifier;
|
|
eval use $max_identifier;
|
|
--error ER_CANT_CREATE_TABLE
|
|
eval CREATE TABLE $max_identifier (
|
|
a int primary key
|
|
) engine = NDB;
|
|
SHOW WARNINGS;
|
|
|
|
eval DROP DATABASE $max_identifier;
|
|
|