Debian Codegraph @

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

raw
1 ###############################################################################
2 # Bug#21205695 DROP TABLE MAY CAUSE SLAVES TO BREAK
3 #
4 # Problem:
5 # ========
6 # 1) Drop table queries are re-generated by server
7 # before writing the events(queries) into binlog
8 # for various reasons. If table name/db name contains
9 # a non regular characters (like latin characters),
10 # the generated query is wrong. Hence it breaks the
11 # replication.
12 # 2) In the edge case, when table name contains
13 # 64 latin characters (latin takes 2 bytes), server is
14 # throwing an assert (M_TBLLEN < 128)
15 #
16 # 3) In the edge case, when db name contains 64 latin
17 # characters, binlog contents are interpreted wrongly
18 # which is leading to replication issues.
19 #
20 ###############################################################################
21
22 --source include/not_windows.inc
23 --source include/master-slave.inc
24
25 --let iter=1
26 # Change iteration to 4 after fixing Bug #22280214
27 while ($iter <= 2)
28 {
29 --connection master
30 if ($iter == 1)
31 {
32 --echo Test case 1:- table name with one character latin name.
33 --let $tblname= REPEAT(CHAR(131),1)
34 }
35 if ($iter == 2)
36 {
37 --echo Test case 2:- table name and database names with one character latin name.
38 --let $tblname= REPEAT(CHAR(131),1),"`.`",REPEAT(CHAR(131),1)
39 --eval SET @s:=CONCAT("CREATE DATABASE `",REPEAT(CHAR(131),1),"`")
40 PREPARE STMT FROM @s; EXECUTE stmt;
41 }
42 # After fixing Bug #22280214 DATADIR LOCATION IS LIMITING
43 # IDENTIFIER MAX LENGTH, the following two tests (iter 3 and 4) can be
44 # uncommented.
45 #if ($iter == 3)
46 #{
47 # --echo Test case 3:- table name and database names with 64 latin characters name.
48 # --let $tblname= REPEAT(CHAR(131),64),"`.`", REPEAT(CHAR(131),64)
49 # --eval SET @s:=CONCAT("CREATE DATABASE `",REPEAT(CHAR(131),64),"`")
50 # PREPARE STMT FROM @s; EXECUTE stmt;
51 #}
52 #if ($iter == 4)
53 #{
54 # --echo Test case 4:- table name and database names with 64 Euro(€) characters.
55 # --let $tblname= REPEAT(CHAR(226,130,172),64),"`.`", REPEAT(CHAR(226,130,172),64)
56 # --eval SET @s:=CONCAT("CREATE DATABASE `",REPEAT(CHAR(226,130,172),64),"`")
57 # PREPARE STMT FROM @s; EXECUTE stmt;
58 #}
59 --eval SET @s:=CONCAT("CREATE TABLE `",$tblname,"` (a INT)")
60 PREPARE STMT FROM @s; EXECUTE stmt;
61 --eval SET @s:=CONCAT("INSERT INTO `",$tblname,"` VALUES (1)")
62 PREPARE STMT FROM @s; EXECUTE stmt;
63 --eval SET @s:=CONCAT("DROP TABLE `",$tblname, "`")
64 PREPARE STMT FROM @s; EXECUTE stmt;
65 if ($iter == 2)
66 {
67 --eval SET @s:=CONCAT("DROP DATABASE `",REPEAT(CHAR(131),1),"`")
68 PREPARE STMT FROM @s; EXECUTE stmt;
69 }
70 # After fixing Bug #22280214 DATADIR LOCATION IS LIMITING
71 # IDENTIFIER MAX LENGTH, the following two tests (iter 3 and 4) can be
72 # uncommented.
73 #if ($iter == 3)
74 #{
75 # --eval SET @s:=CONCAT("DROP DATABASE `",REPEAT(CHAR(131),64),"`")
76 # PREPARE STMT FROM @s; EXECUTE stmt;
77 #}
78 #if ($iter == 4)
79 #{
80 # --eval SET @s:=CONCAT("DROP DATABASE `",REPEAT(CHAR(226,130,172),64),"`")
81 # PREPARE STMT FROM @s; EXECUTE stmt;
82 #}
83 --sync_slave_with_master
84 --inc $iter
85 }
86
87 --source include/rpl_end.inc