File: default_row_format_02.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 (57 lines) | stat: -rw-r--r-- 1,853 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
# **************************************************************
# wl8307 : Check default_row_format functionality by cross
#          Replication Master (M) 5.7 and Slave (S) 5.6. But the
#          problem is that MTR does not support cross version.
#          Hence this testcase assumes slave version is 5.6 by
#          setting the Default_row_format=compact,which is same
#          in mysql-5.6.
# case 1 : The main aim of this testcase is to check the DDL
#          failure on slave side, when user try to create a table
#          with index column size is greater than 767 bytes on
#          master which will (DDL) fail on slave side.
#          Master (M) : *.opt file no need to set as default is
#          row_format=Dynamic.(mysql-5.7).
#          Slave  (S) : *.opt file will be set with default
#          row_format=Compact (mysql-5.6).
# **************************************************************
--source include/not_group_replication_plugin.inc
--source include/master-slave.inc
# This test should not run with GTID=on

# Set expected error nos on slave side
connection slave;
stop slave;
SET GLOBAL SQL_REPLICA_SKIP_COUNTER=4;
start slave;

connection master;
USE test;

# Check Dynamic (default)
SELECT @@innodb_default_row_format;

# Create Index prefix greater than 767 bytes
CREATE TABLE tab(a INT PRIMARY KEY, b VARCHAR(5000) CHARSET latin1, KEY idx1(b(3070)))
ENGINE= InnoDB;

# Insert a record
INSERT INTO tab(a,b) VALUES(1,'Check with max prefix');

# Connect to slave
--source include/sync_slave_sql_with_master.inc

# Check Compact (default)
SELECT @@innodb_default_row_format;

# Check DDL should fail on slave
--error ER_NO_SUCH_TABLE
SHOW CREATE TABLE tab;

# Cleanup
connection master;
DROP TABLE tab;

# Before closing sync slave
--source include/sync_slave_sql_with_master.inc

--source include/rpl_end.inc