| 1 |
include/rpl_init.inc [topology=1->2] |
| 2 |
connection server_1; |
| 3 |
FLUSH TABLES; |
| 4 |
ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB; |
| 5 |
connection server_2; |
| 6 |
SET @save_slave_parallel_threads= @@GLOBAL.slave_parallel_threads; |
| 7 |
SET @save_slave_parallel_mode= @@GLOBAL.slave_parallel_mode; |
| 8 |
include/stop_slave.inc |
| 9 |
SET GLOBAL slave_parallel_threads=2; |
| 10 |
SET GLOBAL slave_parallel_mode=optimistic; |
| 11 |
include/start_slave.inc |
| 12 |
connection server_1; |
| 13 |
CREATE TABLE t1(a INT) ENGINE=INNODB; |
| 14 |
OPTIMIZE TABLE t1; |
| 15 |
Table Op Msg_type Msg_text |
| 16 |
test.t1 optimize note Table does not support optimize, doing recreate + analyze instead |
| 17 |
test.t1 optimize status OK |
| 18 |
INSERT INTO t1 VALUES(1); |
| 19 |
INSERT INTO t1 SELECT 1+a FROM t1; |
| 20 |
INSERT INTO t1 SELECT 2+a FROM t1; |
| 21 |
connection server_2; |
| 22 |
# |
| 23 |
# Verify that following admin commands are marked as ddl |
| 24 |
# 'OPTIMIZE TABLE', 'REPAIR TABLE' and 'ANALYZE TABLE' |
| 25 |
# |
| 26 |
connection server_1; |
| 27 |
OPTIMIZE TABLE t1; |
| 28 |
Table Op Msg_type Msg_text |
| 29 |
test.t1 optimize note Table does not support optimize, doing recreate + analyze instead |
| 30 |
test.t1 optimize status OK |
| 31 |
REPAIR TABLE t1; |
| 32 |
Table Op Msg_type Msg_text |
| 33 |
test.t1 repair status OK |
| 34 |
ANALYZE TABLE t1; |
| 35 |
Table Op Msg_type Msg_text |
| 36 |
test.t1 analyze status Engine-independent statistics collected |
| 37 |
test.t1 analyze status OK |
| 38 |
FLUSH LOGS; |
| 39 |
FOUND 1 /GTID 0-1-9 ddl/ in mysqlbinlog.out |
| 40 |
FOUND 1 /GTID 0-1-10 ddl/ in mysqlbinlog.out |
| 41 |
FOUND 1 /GTID 0-1-11 ddl/ in mysqlbinlog.out |
| 42 |
# |
| 43 |
# Clean up |
| 44 |
# |
| 45 |
DROP TABLE t1; |
| 46 |
connection server_2; |
| 47 |
FLUSH LOGS; |
| 48 |
# |
| 49 |
# Check that ALTER TABLE commands with ANALYZE, OPTIMIZE and REPAIR on |
| 50 |
# partitions will be marked as DDL in binary log. |
| 51 |
# |
| 52 |
connection server_1; |
| 53 |
CREATE TABLE t1(id INT) PARTITION BY RANGE (id) (PARTITION p0 VALUES LESS THAN (100), |
| 54 |
PARTITION pmax VALUES LESS THAN (MAXVALUE)); |
| 55 |
INSERT INTO t1 VALUES (1), (10), (100), (1000); |
| 56 |
ALTER TABLE t1 ANALYZE PARTITION p0; |
| 57 |
Table Op Msg_type Msg_text |
| 58 |
test.t1 analyze status OK |
| 59 |
ALTER TABLE t1 OPTIMIZE PARTITION p0; |
| 60 |
Table Op Msg_type Msg_text |
| 61 |
test.t1 optimize status OK |
| 62 |
ALTER TABLE t1 REPAIR PARTITION p0; |
| 63 |
Table Op Msg_type Msg_text |
| 64 |
test.t1 repair status OK |
| 65 |
FLUSH LOGS; |
| 66 |
FOUND 1 /GTID 0-1-15 ddl/ in mysqlbinlog.out |
| 67 |
FOUND 1 /GTID 0-1-16 ddl/ in mysqlbinlog.out |
| 68 |
FOUND 1 /GTID 0-1-17 ddl/ in mysqlbinlog.out |
| 69 |
# |
| 70 |
# Clean up |
| 71 |
# |
| 72 |
DROP TABLE t1; |
| 73 |
connection server_2; |
| 74 |
include/stop_slave.inc |
| 75 |
SET GLOBAL slave_parallel_threads= @save_slave_parallel_threads; |
| 76 |
SET GLOBAL slave_parallel_mode= @save_slave_parallel_mode; |
| 77 |
include/start_slave.inc |
| 78 |
include/rpl_end.inc |