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