| 1 |
set @@global.ndb_schema_dist_lock_wait_timeout = 1; |
| 2 |
create table t1(a int primary key, b int not null, index(b)) engine = ndb; |
| 3 |
insert into t1 values (1,1), (2,2); |
| 4 |
set autocommit=0; |
| 5 |
begin; |
| 6 |
select count(*) from t1; |
| 7 |
count(*) |
| 8 |
2 |
| 9 |
ALTER TABLE t1 algorithm=copy, ADD COLUMN c int; |
| 10 |
Warnings: |
| 11 |
Warning 1296 Node <nodeid> 'Distribution of ALTER TABLE 't1' failed' |
| 12 |
select a from t1 where b = 2; |
| 13 |
ERROR HY000: Table definition has changed, please retry transaction |
| 14 |
show warnings; |
| 15 |
Level Code Message |
| 16 |
Error 1412 Table definition has changed, please retry transaction |
| 17 |
Warning 1296 Failed to discover table 't1' from NDB, not allowed in active transaction |
| 18 |
Error 1412 Table definition has changed, please retry transaction |
| 19 |
show tables; |
| 20 |
Tables_in_test |
| 21 |
t1 |
| 22 |
drop table t1; |
| 23 |
create table t1 ( |
| 24 |
col0 int, col1 int, col2 int, col3 int, |
| 25 |
col4 int, col5 int, col6 int, col7 int, |
| 26 |
col8 int, col9 int, col10 int, col11 int, |
| 27 |
col12 int, col13 int, col14 int, col15 int, |
| 28 |
col16 int, col17 int, col18 int, col19 int, |
| 29 |
col20 int, col21 int, col22 int, col23 int, |
| 30 |
col24 int, col25 int, col26 int, col27 int, |
| 31 |
col28 int, col29 int, col30 int, col31 int, |
| 32 |
primary key(col0)) engine = ndb; |
| 33 |
begin; |
| 34 |
insert into t1 (col0) values (1); |
| 35 |
alter table t1 algorithm=inplace, add column col32 int COLUMN_FORMAT DYNAMIC; |
| 36 |
Warnings: |
| 37 |
Warning 1296 Node <nodeid> 'Distribution of ALTER TABLE 't1' failed' |
| 38 |
select * from t1; |
| 39 |
ERROR HY000: Table definition has changed, please retry transaction |
| 40 |
show warnings; |
| 41 |
Level Code Message |
| 42 |
Error 1412 Table definition has changed, please retry transaction |
| 43 |
Warning 1296 Failed to discover table 't1' from NDB, not allowed in active transaction |
| 44 |
Error 1412 Table definition has changed, please retry transaction |
| 45 |
select * from t1; |
| 46 |
ERROR HY000: Table definition has changed, please retry transaction |
| 47 |
drop table t1; |