File: alter_sync_myisam.test

package info (click to toggle)
mysql-8.0 8.0.43-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • 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 (72 lines) | stat: -rw-r--r-- 2,264 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#
# RENAME-related tests which require debug sync.
#

--source include/have_debug_sync.inc

--source include/force_myisam_default.inc
--source include/have_myisam.inc

--echo #
--echo # Bug#24571427 MYSQLDUMP & MYSQLPUMP MAY FAIL WHEN
--echo #              DDL STATEMENTS ARE RUNNING
--echo #

--disable_warnings
SET DEBUG_SYNC= 'RESET';
DROP SCHEMA IF EXISTS test_i_s;
--enable_warnings

CREATE SCHEMA test_i_s;
USE test_i_s;
CREATE TABLE t1(a INT) ENGINE=MyISAM;

--connection default
SET DEBUG_SYNC='alter_table_before_rename_result_table SIGNAL blocked WAIT_FOR i_s_select';

--echo # Sending ALTER Command
--send ALTER TABLE t1 modify column a varchar(30);

connect (con_mysqldump,localhost,root,,);

--echo # Wait until ALTER stopped before renaming the temporary file it created.
SET DEBUG_SYNC= 'now WAIT_FOR blocked';

--echo # Verify that #sql... tables are not seen by I_S and SHOW
SELECT COUNT(TABLE_NAME) FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test_i_s' AND TABLE_NAME like '#sql%';
SHOW TABLES FROM test_i_s;

--echo # Check that there exists a hidden table created by ALTER and
--echo # I_S.TABLES had not listed above. The SHOW EXTENDED syntax was
--echo # added as part of Bug#24786075.
--replace_regex /#sql.*$/#sql-xxxxx/
SHOW EXTENDED TABLES FROM test_i_s;

--echo # Make sure mysqldump/mysqlpump ignores the #sql... tables.
--echo # mysqldump fails to acquire the lock without the fix.
--let $file = $MYSQLTEST_VARDIR/tmp/bug24571427.sql
--exec $MYSQL_DUMP --no-tablespaces --databases test_i_s --ignore-table=test_i_s.t1 > $file
--exec $MYSQL_PUMP --databases test_i_s --exclude-tables=t1 > $file
--remove_file $file

--echo # Allow ALTER to continue.
SET DEBUG_SYNC= 'now SIGNAL i_s_select';

--disconnect con_mysqldump
--source include/wait_until_disconnected.inc

--connection default
--echo # Reaping "ALTER ..."
--reap

--echo # Verify if the ALTERed TABLE is not-hidden
SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test_i_s';

--echo # Verify if  inplace alter also keeps the table not-hidden.
ALTER TABLE t1 add column (c2 int);
SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test_i_s';

--connection default
SET DEBUG_SYNC= 'RESET';
SET GLOBAL DEBUG='';
DROP SCHEMA test_i_s;