| 1 |
# create table t1 |
| 2 |
CREATE TABLE t1( |
| 3 |
a INT PRIMARY KEY, |
| 4 |
b INT UNIQUE KEY |
| 5 |
)ENGINE = NDB; |
| 6 |
INSERT INTO t1 VALUES (1,10), (2,20), (3,30), (4,40); |
| 7 |
# verify that no temporary named table exists |
| 8 |
SELECT count(*) FROM ndbinfo.dict_obj_info WHERE REGEXP_LIKE(fq_name, '#sql'); |
| 9 |
count(*) |
| 10 |
0 |
| 11 |
SET debug='+d,ndb_simulate_alter_failure_rename1,ndb_simulate_failure_during_rollback'; |
| 12 |
# simulated failure during copy alter table |
| 13 |
ALTER TABLE t1 ALGORITHM=COPY; |
| 14 |
ERROR HY000: Internal error: Simulated : Failed to rename original table to a temp name. |
| 15 |
# verify that the temporary named table has been left behind - required to reproduce the bug |
| 16 |
SELECT count(*) FROM ndbinfo.dict_obj_info WHERE REGEXP_LIKE(fq_name, '#sql'); |
| 17 |
count(*) |
| 18 |
1 |
| 19 |
ALTER TABLE t1 ALGORITHM=COPY; |
| 20 |
Warnings: |
| 21 |
Warning 1296 The temporary named table #sql-XXXX_X.test already exists, it will be removed |
| 22 |
# verify that original data has not been affected |
| 23 |
SELECT a, b FROM t1 ORDER BY a; |
| 24 |
a b |
| 25 |
1 10 |
| 26 |
2 20 |
| 27 |
3 30 |
| 28 |
4 40 |
| 29 |
# cleanup |
| 30 |
DROP TABLE t1; |