| 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 |
set names latin1; |
| 31 |
if ($iter == 1) |
| 32 |
{ |
| 33 |
--echo Test case 1:- table name with one character latin name. |
| 34 |
--let $tblname= REPEAT(CHAR(131),1) |
| 35 |
} |
| 36 |
if ($iter == 2) |
| 37 |
{ |
| 38 |
--echo Test case 2:- table name and database names with one character latin name. |
| 39 |
--let $tblname= REPEAT(CHAR(131),1),"`.`",REPEAT(CHAR(131),1) |
| 40 |
--eval SET @s:=CONCAT("CREATE DATABASE `",REPEAT(CHAR(131),1),"`") |
| 41 |
PREPARE STMT FROM @s; EXECUTE stmt; |
| 42 |
} |
| 43 |
# After fixing Bug #22280214 DATADIR LOCATION IS LIMITING |
| 44 |
# IDENTIFIER MAX LENGTH, the following two tests (iter 3 and 4) can be |
| 45 |
# uncommented. |
| 46 |
#if ($iter == 3) |
| 47 |
#{ |
| 48 |
# --echo Test case 3:- table name and database names with 64 latin characters name. |
| 49 |
# --let $tblname= REPEAT(CHAR(131),64),"`.`", REPEAT(CHAR(131),64) |
| 50 |
# --eval SET @s:=CONCAT("CREATE DATABASE `",REPEAT(CHAR(131),64),"`") |
| 51 |
# PREPARE STMT FROM @s; EXECUTE stmt; |
| 52 |
#} |
| 53 |
#if ($iter == 4) |
| 54 |
#{ |
| 55 |
# --echo Test case 4:- table name and database names with 64 Euro(€) characters. |
| 56 |
# --let $tblname= REPEAT(CHAR(226,130,172),64),"`.`", REPEAT(CHAR(226,130,172),64) |
| 57 |
# --eval SET @s:=CONCAT("CREATE DATABASE `",REPEAT(CHAR(226,130,172),64),"`") |
| 58 |
# PREPARE STMT FROM @s; EXECUTE stmt; |
| 59 |
#} |
| 60 |
--eval SET @s:=CONCAT("CREATE TABLE `",$tblname,"` (a INT)") |
| 61 |
PREPARE STMT FROM @s; EXECUTE stmt; |
| 62 |
--eval SET @s:=CONCAT("INSERT INTO `",$tblname,"` VALUES (1)") |
| 63 |
PREPARE STMT FROM @s; EXECUTE stmt; |
| 64 |
--eval SET @s:=CONCAT("DROP TABLE `",$tblname, "`") |
| 65 |
PREPARE STMT FROM @s; EXECUTE stmt; |
| 66 |
if ($iter == 2) |
| 67 |
{ |
| 68 |
--eval SET @s:=CONCAT("DROP DATABASE `",REPEAT(CHAR(131),1),"`") |
| 69 |
PREPARE STMT FROM @s; EXECUTE stmt; |
| 70 |
} |
| 71 |
# After fixing Bug #22280214 DATADIR LOCATION IS LIMITING |
| 72 |
# IDENTIFIER MAX LENGTH, the following two tests (iter 3 and 4) can be |
| 73 |
# uncommented. |
| 74 |
#if ($iter == 3) |
| 75 |
#{ |
| 76 |
# --eval SET @s:=CONCAT("DROP DATABASE `",REPEAT(CHAR(131),64),"`") |
| 77 |
# PREPARE STMT FROM @s; EXECUTE stmt; |
| 78 |
#} |
| 79 |
#if ($iter == 4) |
| 80 |
#{ |
| 81 |
# --eval SET @s:=CONCAT("DROP DATABASE `",REPEAT(CHAR(226,130,172),64),"`") |
| 82 |
# PREPARE STMT FROM @s; EXECUTE stmt; |
| 83 |
#} |
| 84 |
--sync_slave_with_master |
| 85 |
--inc $iter |
| 86 |
} |
| 87 |
|
| 88 |
--source include/rpl_end.inc |