Debian Codegraph @

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

raw
1 # **************************************************************
2 # wl8307 : Check default_row_format functionality by Replication
3 # case 1 : Check default_row_format=Dynamic on Master & slave
4 # Check with partition table.
5 # Check with Index prefix length greater 767 bytes
6 # Also check same default row_fromat=Dynamic
7 # case 2 : Row_format=compact with index prefix greater than 767
8 # Bytes should fail on both Master(M) and slave(S)
9 # Also set at the parameter level and check retains same
10 # row_format=compact
11 # case 3 : Set at the Parameter and DDL level different row_format
12 # **************************************************************
13 --source include/not_group_replication_plugin.inc
14 --source include/master-slave.inc
15 # InnoDB doesn't support only 16k as index prefix is 3070 bytes
16
17 connection master;
18 USE test;
19
20 # Create partition table
21 CREATE TABLE tab(empno INT,ename VARCHAR(30),sal NUMERIC(3))
22 ENGINE=InnoDB PARTITION BY HASH(empno) (PARTITION p0,PARTITION p1 );
23
24 # Create Index prefix greater than 767 bytes
25 CREATE TABLE tab1(a INT PRIMARY KEY, b VARCHAR(5000),KEY idx1(b(3070)))
26 ENGINE= InnoDB
27 DEFAULT CHARACTER SET latin1;
28
29 # Insert few records
30 INSERT INTO tab VALUES (100,'VISWANATH',100);
31 INSERT INTO tab VALUES (300,'VISWANATH',200);
32
33 INSERT INTO tab1(a,b) VALUES(1,'Check with max prefix');
34
35 # Connect to slave
36 --source include/sync_slave_sql_with_master.inc
37
38 # Check Dynamic (default) on slave ide
39 SELECT @@innodb_default_row_format;
40
41 # Check data on slave side
42 SELECT * FROM tab ORDER BY empno;
43 SELECT * FROM tab1 ORDER BY a;
44
45 # Chek health of the table
46 CHECK TABLE tab;
47 CHECK TABLE tab1;
48
49 # Check Dynamic (default) on slave
50 --source suite/innodb/include/default_row_format_show.inc
51
52 # Cleanup
53 connection master;
54 DROP TABLE tab,tab1;
55
56 # Set Default Row-foramt=Compact
57 SET GLOBAL innodb_default_row_format=Compact;
58
59 # Create Index prefix greater than 767 bytes
60 -- error ER_INDEX_COLUMN_TOO_LONG
61 CREATE TABLE tab(a INT PRIMARY KEY, b VARCHAR(5000),KEY idx1(b(768)))
62 ENGINE= InnoDB
63 DEFAULT CHARACTER SET latin1;
64
65 # Connect to slave
66 --source include/sync_slave_sql_with_master.inc
67
68 # Check Default is Compact on slave side
69 SELECT @@innodb_default_row_format;
70
71 # Check table does not exist on slave side
72 --error ER_NO_SUCH_TABLE
73 SHOW CREATE TABLE tab;
74
75 connection master;
76 # Set Default Row_foramt=Dynamic
77 SET GLOBAL innodb_default_row_format=Dynamic;
78
79 # Create Index prefix less than 767 bytes
80 CREATE TABLE tab(a INT PRIMARY KEY, b VARCHAR(5000),KEY idx1(b(767)))
81 ENGINE= InnoDB ROW_FORMAT=COMPACT
82 DEFAULT CHARACTER SET latin1;
83
84 INSERT INTO tab(a,b) VALUES(1,'Check with max prefix');
85
86 ALTER TABLE tab ROW_FORMAT=COMPRESSED;
87
88 # Check Row_format=Compressed on Master side
89 --source suite/innodb/include/default_row_format_show.inc
90
91 # Connect to slave
92 --source include/sync_slave_sql_with_master.inc
93
94 # Check Dynamic (default) on slave side
95 SELECT @@innodb_default_row_format;
96
97 # Check Row_format=Compressed on slave side
98 --source suite/innodb/include/default_row_format_show.inc
99
100 # Cleanup
101 connection master;
102 DROP TABLE tab;
103
104 --source include/rpl_end.inc