| 1 |
--source include/have_debug.inc |
| 2 |
--source include/have_multi_ndb.inc |
| 3 |
--source have_ndb_error_insert.inc |
| 4 |
|
| 5 |
# Delay alter table infinitely using error insert |
| 6 |
--connection server1 |
| 7 |
--let $ndb_desc_file= $MYSQLTEST_VARDIR/log/mysqld.2.1.err |
| 8 |
CREATE TABLE t1 (a int) engine ndb; |
| 9 |
# error insert 6217, will keep Dbdict::execALTER_TABLE_REQ() in an loop with a interval of 1 sec. |
| 10 |
# As the signal is not allowed to excuted, ALTER will be struck with holding GSL for some period of time. |
| 11 |
--exec $NDB_MGM -e'all error 6217' > /dev/null |
| 12 |
--send ALTER TABLE t1 ALGORITHM = COPY, ADD COLUMN b INT; |
| 13 |
|
| 14 |
|
| 15 |
# As GSL is held by alter in Server1, restart Server2 and check if ndb-wait-setup timeout occurs |
| 16 |
# Without patch, restart will hang for more than ndb-wait-setup |
| 17 |
--connection server2 |
| 18 |
--disable_query_log |
| 19 |
call mtr.add_suppression("Tables not available after [0-9]* seconds. Consider increasing --ndb-wait-setup value"); |
| 20 |
--enable_query_log |
| 21 |
--let $mysqld_name=mysqld.2.1 |
| 22 |
--source include/restart_mysqld.inc |
| 23 |
|
| 24 |
# Reap for alter in Server1, and thereby release GSL |
| 25 |
--connection server1 |
| 26 |
--error 1005 |
| 27 |
--reap |
| 28 |
--exec $NDB_MGM -e'all error 0' > /dev/null |
| 29 |
drop table t1; |
| 30 |
|
| 31 |
--let $assert_text= Checking if ndb-wait-setup timeout |
| 32 |
--let $assert_select=Tables not available after |
| 33 |
--let $assert_file= $ndb_desc_file |
| 34 |
--let $assert_count= 1 |
| 35 |
--source include/assert_grep.inc |