Debian Codegraph @

mysql-test/suite/ndb_ddl/alter_inplace_fail.test

raw
1 --source setup.inc
2 --source include/have_debug.inc
3
4 --echo #
5 --echo # Test INPLACE ALTER failures at various stages
6 --echo # - on failure, they should rollback restoring the
7 --echo # original table definitions if not already committed.
8 --echo #
9 --echo # Failure when meta-data is missing when trying to commit
10 SHOW CREATE TABLE t8;
11 SELECT * FROM t8 ORDER BY a;
12
13 set @save_debug = @@global.debug;
14 set global debug='-d'; # Switch DEBUG/TRACING OFF
15 set global debug='+d,ndb_missing_table_in_inplace_alter';
16 call mtr.add_suppression("Failed to complete inplace alter table commit");
17 --error ER_INTERNAL_ERROR
18 ALTER TABLE t8
19 RENAME COLUMN d to d_new,
20 ALGORITHM = INPLACE;
21 set global debug=@save_debug;
22
23 # ALTER TABLE is not properly rolled back (Bug#30302405)
24 SHOW CREATE TABLE t8;
25 --let $ndb_describe_db= ndb_ddl_test
26 --let $ndb_describe_table= t8
27 --let $ndb_describe_indexes= 1
28 --source suite/ndb/include/ndb_describe_table.inc
29
30 --echo #
31 --echo # Bug#31419144 FIX MEMORY LEAK OF NDB_ALTER_DATA IN PREPARE_INPLACE_ALTER_TABLE
32 --echo #
33
34 # Simulate failure during Ndb_schema_dist_client's prepare phase and verify the following :
35 # a) A proper error is returned to the user
36 # b) The internal structures are properly freed - this is verified when the subsequent
37 # shutdown of the mysql server completes without any issues. If it faces an issues,
38 # like a DBUG_ASSERT() failure for example, the shutdown_report will fail.
39
40 set @save_debug = @@global.debug;
41 set global debug='+d,ndb_schema_dist_not_ready_early';
42 --error ER_GET_ERRMSG
43 ALTER TABLE t1 ADD INDEX idx(a), ALGORITHM = INPLACE;
44 set global debug=@save_debug;
45
46 --source cleanup.inc
47