| 1 |
# Setup |
| 2 |
create table t1 (a int) engine ndb; |
| 3 |
create logfile group lg_1 |
| 4 |
add undofile 'undo_1.log' |
| 5 |
initial_size 1M |
| 6 |
undo_buffer_size 2M |
| 7 |
engine ndbcluster; |
| 8 |
create tablespace ts_1 |
| 9 |
add datafile 'data_1.dat' |
| 10 |
use logfile group lg_1 |
| 11 |
initial_size 2M |
| 12 |
engine ndbcluster; |
| 13 |
# Restart the MySQL Server to simulate upgrade from a non DD version |
| 14 |
# by enabling the debug flag ndb_simulate_upgrade_from_non_dd_version |
| 15 |
# restart: --debug=+d,ndb_simulate_upgrade_from_non_dd_version |
| 16 |
# Try various DDLs and verify that they are blocked |
| 17 |
# Create table |
| 18 |
create table t2 (a int) engine ndb; |
| 19 |
ERROR HY000: DDLs are disallowed on NDB SE as there is at least one node without MySQL DD support connected to the cluster. |
| 20 |
# Inplace alter |
| 21 |
alter table t1 add index idx(a), algorithm = inplace; |
| 22 |
ERROR HY000: DDLs are disallowed on NDB SE as there is at least one node without MySQL DD support connected to the cluster. |
| 23 |
# Copy alter |
| 24 |
alter table t1 add index idx(a), algorithm = copy; |
| 25 |
ERROR HY000: DDLs are disallowed on NDB SE as there is at least one node without MySQL DD support connected to the cluster. |
| 26 |
# Rename table |
| 27 |
rename table t1 to t2; |
| 28 |
ERROR HY000: DDLs are disallowed on NDB SE as there is at least one node without MySQL DD support connected to the cluster. |
| 29 |
# Drop table |
| 30 |
drop table t1; |
| 31 |
ERROR HY000: DDLs are disallowed on NDB SE as there is at least one node without MySQL DD support connected to the cluster. |
| 32 |
# Create logfile group |
| 33 |
create logfile group lg_2 |
| 34 |
add undofile 'undo_2.log' |
| 35 |
initial_size 1M |
| 36 |
undo_buffer_size 2M |
| 37 |
engine ndbcluster; |
| 38 |
ERROR HY000: DDLs are disallowed on NDB SE as there is at least one node without MySQL DD support connected to the cluster. |
| 39 |
# Alter logfile group |
| 40 |
alter logfile group lg_1 |
| 41 |
add undofile 'undo_2.log' |
| 42 |
initial_size 1M |
| 43 |
engine ndbcluster; |
| 44 |
ERROR HY000: DDLs are disallowed on NDB SE as there is at least one node without MySQL DD support connected to the cluster. |
| 45 |
# Create tablespace |
| 46 |
create tablespace ts_2 |
| 47 |
add datafile 'data_2.dat' |
| 48 |
use logfile group lg_1 |
| 49 |
initial_size 2M |
| 50 |
engine ndbcluster; |
| 51 |
ERROR HY000: DDLs are disallowed on NDB SE as there is at least one node without MySQL DD support connected to the cluster. |
| 52 |
# Alter tablespace |
| 53 |
alter tablespace ts_1 |
| 54 |
add datafile 'data_2.dat' |
| 55 |
initial_size 2M |
| 56 |
engine ndbcluster; |
| 57 |
ERROR HY000: DDLs are disallowed on NDB SE as there is at least one node without MySQL DD support connected to the cluster. |
| 58 |
# Verify that database DDLs are still allowed |
| 59 |
create database test1; |
| 60 |
alter database test1 default charset latin1; |
| 61 |
drop database test1; |
| 62 |
# Drop database will still fail if it has tables in it |
| 63 |
drop database test; |
| 64 |
ERROR HY000: DDLs are disallowed on NDB SE as there is at least one node without MySQL DD support connected to the cluster. |
| 65 |
# Any Non-NDB DDLs are allowed |
| 66 |
create table t1_innodb(a int) engine innodb; |
| 67 |
drop table t1_innodb; |
| 68 |
# Verify that DDLs are allowed after upgrade |
| 69 |
set GLOBAL debug="-d,ndb_simulate_upgrade_from_non_dd_version"; |
| 70 |
create table t2 (a int) engine ndb; |
| 71 |
show create table t2; |
| 72 |
Table Create Table |
| 73 |
t2 CREATE TABLE `t2` ( |
| 74 |
`a` int DEFAULT NULL |
| 75 |
) ENGINE=ndbcluster DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci |
| 76 |
# Cleanup |
| 77 |
drop table t1, t2; |
| 78 |
alter tablespace ts_1 drop datafile 'data_1.dat'; |
| 79 |
drop tablespace ts_1; |
| 80 |
drop logfile group lg_1 engine ndb; |