Debian Codegraph @

mysql-test/suite/rpl/t/rpl_row_invisible_columns.test

raw
1 --source include/have_binlog_format_row.inc
2 --source include/master-slave.inc
3 --source include/have_debug.inc
4
5 ################################################################################
6 # WL10905 - Support for INVISIBLE columns. #
7 # #
8 # ==== Purpose ==== #
9 # #
10 # The test checks #
11 # - if operations on rows with invisible columns are completed without #
12 # errors when slave_rows_search_algorithms uses hash scan. #
13 # #
14 # - if replica chooses INDEX_SCAN even when the index contains invisible #
15 # columns. #
16 # #
17 ################################################################################
18 --source include/rpl_connection_slave.inc
19 set @saved_slave_rows_search_algorithms= @@global.slave_rows_search_algorithms;
20 SET GLOBAL slave_rows_search_algorithms= 'INDEX_SCAN,HASH_SCAN';
21 --source include/rpl_connection_master.inc
22
23 CREATE TABLE t1 (f1 INT PRIMARY KEY AUTO_INCREMENT INVISIBLE,
24 f2 INT INVISIBLE DEFAULT 5, f3 INT);
25 SHOW CREATE TABLE t1;
26 INSERT INTO t1 VALUES (10), (20);
27 --source include/sync_slave_sql_with_master.inc
28
29 # Update INVISIBLE column.
30 --source include/rpl_connection_master.inc
31 UPDATE t1 SET f2 = 10 WHERE f1 = 1;
32 --source include/sync_slave_sql_with_master.inc
33
34 --echo # check that t1 exists and has same values in both servers.
35 --let $diff_tables=master:t1, slave:t1
36 --source include/diff_tables.inc
37 --echo # check that INDEX_SCAN is used at replica.
38 SHOW STATUS LIKE 'Replica_rows_last_search_algorithm_used';
39
40 # Cleanup
41 --source include/rpl_connection_master.inc
42 DROP TABLE t1;
43 --source include/sync_slave_sql_with_master.inc
44 SET @@global.slave_rows_search_algorithms= @saved_slave_rows_search_algorithms;
45 --source include/rpl_end.inc