-- source include/have_ndb.inc --disable_query_log # Test will produce this error in server log file -> ignore call mtr.add_suppression("Failed to acquire global schema lock"); # Ignore the warning generated by ndbcluster's binlog thread # when cluster is restarted call mtr.add_suppression("cluster disconnect An incident event has been written"); --enable_query_log # Ignore the warning generated by ndbcluster's binlog thread # when cluster is restarted - also on the second mysqld connect(mysqld2,127.0.0.1,root,,test,$MASTER_MYPORT1); connection mysqld2; --disable_query_log ONCE call mtr.add_suppression("cluster disconnect An incident event has been written"); connection default; # # Run all the commands which should take the global schema lock # against a mysqld "connected" to stopped NDB nodes # # Restart NDB nodes into "no start" --source ndb_restart_nostart.inc # To get consistent error messages and warnings from the tests below, wait # until the "ndb binlog thread" has detected the cluster failure and is # waiting for cluster to start again. let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE state = "Waiting for ndbcluster to start"; --source include/wait_condition.inc # Database DDL, works but generate a warning # about failure to acquire global schema lock CREATE DATABASE test2; ALTER DATABASE test2 CHARACTER SET latin2; DROP DATABASE test2; # Table DDL, works since they don't work with NDB tables # but generate warnings about failure to acquire global schema lock # NOTE! The CREATE's all generate three warnings each, ha_discover, # global schema lock and ha_table_exists_in_engine # NOTE2! When using ps protocol a fourth warning pops up due to different # code path -> turn ps off # --disable_ps_protocol CREATE TABLE t1(a int not null primary key); RENAME TABLE t1 TO t2; CREATE TABLE t3 LIKE t2; ALTER TABLE t3 ADD COLUMN b int default NULL; INSERT INTO t2 VALUES(1); TRUNCATE TABLE t2; CREATE TABLE t4 AS SELECT * FROM t2; DROP TABLE t2; DROP TABLE t3, t4; # Check if tablespace DDL works as expected i.e. passes with two warnings # generated including one about failure to acquire global schema lock CREATE TABLESPACE ts1 ADD DATAFILE 'ts1.ibd'; CREATE TABLE t5 (a INT PRIMARY KEY) TABLESPACE ts1; DROP TABLE t5; ALTER TABLESPACE ts1 RENAME TO ts2; DROP TABLESPACE ts2; # Check logfile group DDL. This shall fail of course with 3 warnings # generated including one about failure to acquire global schema lock --error ER_GET_ERRNO CREATE LOGFILE GROUP lg1 ADD UNDOFILE 'lg1_undofile.dat' ENGINE NDB; SHOW WARNINGS; --enable_ps_protocol # Start NDB nodes back up again --source ndb_restart_start.inc # Wait until mysqld has connected properly to cluster again source include/ndb_not_readonly.inc;