| 1 |
#################################################### |
| 2 |
# Tests related to object identifier lengths |
| 3 |
#################################################### |
| 4 |
|
| 5 |
# Connect to all MySQL Servers |
| 6 |
--source connect.inc |
| 7 |
|
| 8 |
--echo # #################################################################### |
| 9 |
--echo # Bug11753491: MYSQLD CRASHES WHEN CREATING A CLUSTER TABLE WITH 64 |
| 10 |
--echo # CHARACTER TABLE NAME |
| 11 |
--echo # #################################################################### |
| 12 |
create table abcdefghijklmnopqrstuvwxyz1234567890bcdefghijklmnopqrstuvwxyz123( |
| 13 |
id int primary key |
| 14 |
) engine=ndb; |
| 15 |
drop table abcdefghijklmnopqrstuvwxyz1234567890bcdefghijklmnopqrstuvwxyz123; |
| 16 |
|
| 17 |
--echo # ############################################################ |
| 18 |
--echo # Bug19550973: CREATE/DROP DATABASE STATEMENT SEGFAULTS IF |
| 19 |
--echo # IDENTIFIER LENGTH IS >=64 |
| 20 |
--echo # ############################################################ |
| 21 |
|
| 22 |
# Suppress error log messages triggered by failure to distribute in |
| 23 |
# the below tests |
| 24 |
-- disable_query_log ONCE |
| 25 |
call mtr.add_suppression("Failed to distribute"); |
| 26 |
|
| 27 |
--echo # |
| 28 |
--echo # 1. Testing schema identifier with length 63 |
| 29 |
--echo # |
| 30 |
CREATE DATABASE |
| 31 |
abcdefghijklmnopqrstuvwxyz1234567890bcdefghijklmnopqrstuvwxyz12; |
| 32 |
|
| 33 |
--echo # Create and drop table to test the long database name |
| 34 |
CREATE TABLE |
| 35 |
abcdefghijklmnopqrstuvwxyz1234567890bcdefghijklmnopqrstuvwxyz12.t1 ( |
| 36 |
a int |
| 37 |
) ENGINE=NDB; |
| 38 |
DROP TABLE abcdefghijklmnopqrstuvwxyz1234567890bcdefghijklmnopqrstuvwxyz12.t1; |
| 39 |
DROP DATABASE abcdefghijklmnopqrstuvwxyz1234567890bcdefghijklmnopqrstuvwxyz12; |
| 40 |
|
| 41 |
--echo # |
| 42 |
--echo # 2. Testing schema identifier with length 64 |
| 43 |
--echo # |
| 44 |
CREATE DATABASE |
| 45 |
abcdefghijklmnopqrstuvwxyz1234567890bcdefghijklmnopqrstuvwxyz123; |
| 46 |
|
| 47 |
--echo # Verify database existence |
| 48 |
USE abcdefghijklmnopqrstuvwxyz1234567890bcdefghijklmnopqrstuvwxyz123; |
| 49 |
--echo # Create non NDB table |
| 50 |
CREATE TABLE t1 ( |
| 51 |
a int |
| 52 |
); |
| 53 |
--echo # Create NDB table |
| 54 |
CREATE TABLE t2 ( |
| 55 |
a int |
| 56 |
) ENGINE=NDB; |
| 57 |
|
| 58 |
--echo # |
| 59 |
--echo # 3. Databases with identifier length = 64 is synchronized to other |
| 60 |
--echo # MySQL Servers. Verify that the above created dabatase is present |
| 61 |
--echo # in the other Server |
| 62 |
--echo # NOTE! This testcase was fixed by BUG#27447958 which extended ndb_schema |
| 63 |
--echo # to support identifiers > 63 |
| 64 |
--echo # |
| 65 |
--connection mysqld2 |
| 66 |
USE abcdefghijklmnopqrstuvwxyz1234567890bcdefghijklmnopqrstuvwxyz123; |
| 67 |
--connection mysqld1 |
| 68 |
|
| 69 |
--echo # |
| 70 |
--echo # 4. Testing alter database |
| 71 |
--echo # |
| 72 |
ALTER DATABASE |
| 73 |
abcdefghijklmnopqrstuvwxyz1234567890bcdefghijklmnopqrstuvwxyz123 |
| 74 |
character set=utf8mb4; |
| 75 |
|
| 76 |
CREATE DATABASE db1; |
| 77 |
CREATE TABLE db1.t1 ( |
| 78 |
a int |
| 79 |
) ENGINE=NDB; |
| 80 |
CREATE TABLE db1.t2 ( |
| 81 |
a int |
| 82 |
) ENGINE=NDB; |
| 83 |
|
| 84 |
--echo # |
| 85 |
--echo # 4.1 Renaming table to long database name |
| 86 |
--echo # |
| 87 |
ALTER TABLE db1.t1 |
| 88 |
RENAME abcdefghijklmnopqrstuvwxyz1234567890bcdefghijklmnopqrstuvwxyz123.t3; |
| 89 |
|
| 90 |
--echo # |
| 91 |
--echo # 4.2 Renaming table to long table name |
| 92 |
--echo # |
| 93 |
ALTER TABLE db1.t2 |
| 94 |
RENAME db1.abcdefghijklmnopqrstuvwxyz1234567890bcdefghijklmnopqrstuvwxyz123; |
| 95 |
|
| 96 |
DROP DATABASE db1; |
| 97 |
DROP DATABASE abcdefghijklmnopqrstuvwxyz1234567890bcdefghijklmnopqrstuvwxyz123; |
| 98 |
|
| 99 |
--echo # Checking that database doesn't exists |
| 100 |
--error ER_BAD_DB_ERROR |
| 101 |
USE abcdefghijklmnopqrstuvwxyz1234567890bcdefghijklmnopqrstuvwxyz123; |
| 102 |
|
| 103 |
--echo # |
| 104 |
--echo # 5. Testing schema identifier with length 65, should fail |
| 105 |
--echo # NOTE! The MySQL Server limit is 64 and thus it rejects length 65 |
| 106 |
--echo # |
| 107 |
--error ER_TOO_LONG_IDENT |
| 108 |
CREATE DATABASE |
| 109 |
abcdefghijklmnopqrstuvwxyz1234567890bcdefghijklmnopqrstuvwxyz1234; |