File: alter_inplace_fail.test

package info (click to toggle)
mysql-8.0 8.0.43-3
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 1,273,924 kB
  • sloc: cpp: 4,684,605; ansic: 412,450; pascal: 108,398; java: 83,641; perl: 30,221; cs: 27,067; sql: 26,594; sh: 24,181; python: 21,816; yacc: 17,169; php: 11,522; xml: 7,388; javascript: 7,076; makefile: 2,194; lex: 1,075; awk: 670; asm: 520; objc: 183; ruby: 97; lisp: 86
file content (47 lines) | stat: -rw-r--r-- 1,647 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
--source setup.inc
--source include/have_debug.inc

--echo #
--echo # Test INPLACE ALTER failures at various stages
--echo #  - on failure, they should rollback restoring the
--echo #    original table definitions if not already committed.
--echo #
--echo # Failure when meta-data is missing when trying to commit
SHOW CREATE TABLE t8;
SELECT * FROM t8 ORDER BY a;

set @save_debug = @@global.debug;
set global debug='-d'; # Switch DEBUG/TRACING OFF
set global debug='+d,ndb_missing_table_in_inplace_alter';
call mtr.add_suppression("Failed to complete inplace alter table commit");
--error ER_INTERNAL_ERROR
ALTER TABLE t8
  RENAME COLUMN d to d_new,
  ALGORITHM = INPLACE;
set global debug=@save_debug;

# ALTER TABLE is not properly rolled back (Bug#30302405)
SHOW CREATE TABLE t8;
--let $ndb_describe_db= ndb_ddl_test
--let $ndb_describe_table= t8
--let $ndb_describe_indexes= 1
--source suite/ndb/include/ndb_describe_table.inc

--echo #
--echo # Bug#31419144 FIX MEMORY LEAK OF NDB_ALTER_DATA IN PREPARE_INPLACE_ALTER_TABLE
--echo #

# Simulate failure during Ndb_schema_dist_client's prepare phase and verify the following :
# a) A proper error is returned to the user
# b) The internal structures are properly freed - this is verified when the subsequent
#    shutdown of the mysql server completes without any issues. If it faces an issues,
#    like a DBUG_ASSERT() failure for example, the shutdown_report will fail.

set @save_debug = @@global.debug;
set global debug='+d,ndb_schema_dist_not_ready_early';
--error ER_GET_ERRMSG
ALTER TABLE t1 ADD INDEX idx(a), ALGORITHM = INPLACE;
set global debug=@save_debug;

--source cleanup.inc