| 1 |
-- source include/have_multi_ndb.inc |
| 2 |
|
| 3 |
--echo ******************************* |
| 4 |
--echo * basic concurent online alter test |
| 5 |
--echo ******************************* |
| 6 |
--echo * With Commit |
| 7 |
--echo ******************************* |
| 8 |
|
| 9 |
connection server1; |
| 10 |
|
| 11 |
CREATE TABLE t1 (a INT UNSIGNED KEY, b INT UNSIGNED) ENGINE NDB; |
| 12 |
let $v=4; |
| 13 |
disable_query_log; |
| 14 |
while ($v) |
| 15 |
{ |
| 16 |
--eval INSERT INTO t1 VALUES($v,$v); |
| 17 |
dec $v; |
| 18 |
} |
| 19 |
enable_query_log; |
| 20 |
|
| 21 |
|
| 22 |
connection server2; |
| 23 |
--disable_query_log |
| 24 |
call mtr.add_suppression("Failed to acquire exclusive metadata lock"); |
| 25 |
call mtr.add_suppression("Failed to update table definition in DD"); |
| 26 |
call mtr.add_suppression("Distribution of ALTER TABLE"); |
| 27 |
--enable_query_log |
| 28 |
begin; |
| 29 |
update t1 set b = 0 where a = 1; |
| 30 |
update t1 set b = 1 where a = 2; |
| 31 |
delete from t1 where a = 3; |
| 32 |
|
| 33 |
insert into t1 values (5,5),(6,6); |
| 34 |
update t1 set b = 0 where a = 6; |
| 35 |
|
| 36 |
connection server1; |
| 37 |
--replace_regex /Node [0-9]+:/Node <nodeid>/ |
| 38 |
ALTER TABLE t1 ADD c CHAR(19), ADD d VARCHAR(255), ADD e char(255); |
| 39 |
|
| 40 |
connection server2; |
| 41 |
# If the table definition gets changed in the middle of the transaction |
| 42 |
# as per the fix in bug#29911440, the transaction will be failed. |
| 43 |
--error ER_TABLE_DEF_CHANGED |
| 44 |
update t1 set b = 0 where a = 2; |
| 45 |
show warnings; |
| 46 |
# Cancel the effects of this transaction, need to start over, |
| 47 |
rollback; |
| 48 |
|
| 49 |
connection server1; |
| 50 |
SELECT * FROM t1 ORDER BY a; |
| 51 |
|
| 52 |
DROP TABLE t1; |