From 7d19d4b2dd692deb38d230e64d3c4c3b64570ad6 Mon Sep 17 00:00:00 2001
From: Deepthi Eranti_Sreenivas <deepthi.e.s@oracle.com>
Date: Wed, 20 Jan 2016 18:23:16 +0530
Subject: [PATCH] Bug#22086528 : TEST CODE DISABLED THOUGH THE HISTORIC REASONS
 - BUGS - ARE FIXED

Problem:
mysql-test/suite/rpl/t/rpl_killed_ddl.test

This test contains code which was disabled because of certain bugs.
BUG#44041 declared to be a duplicate of Bug#45516 which was fixed 2010
BUG#43353 fixed 2012
BUG#44171 fixed 2010

Fix:
Enabled the test code related to the above mentioned bugs.
---
 mysql-test/suite/rpl/r/rpl_killed_ddl.result | 14 +++++++
 mysql-test/suite/rpl/t/rpl_killed_ddl.test   | 43 +++++++-------------
 2 files changed, 28 insertions(+), 29 deletions(-)

diff --git a/mysql-test/suite/rpl/r/rpl_killed_ddl.result b/mysql-test/suite/rpl/r/rpl_killed_ddl.result
index a02c9b599b..4d9f8b7773 100644
--- a/mysql-test/suite/rpl/r/rpl_killed_ddl.result
+++ b/mysql-test/suite/rpl/r/rpl_killed_ddl.result
@@ -56,6 +56,10 @@ CREATE VIEW v1 AS SELECT a FROM t1 WHERE a < 100;
 CREATE DATABASE d2;
 source include/kill_query.inc;
 include/rpl_diff.inc
+ALTER DATABASE d1
+DEFAULT CHARACTER SET = 'utf8';
+source include/kill_query.inc;
+include/rpl_diff.inc
 DROP DATABASE d1;
 source include/kill_query.inc;
 include/rpl_diff.inc
@@ -67,6 +71,10 @@ ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 DAY
 DO INSERT INTO test.t1 VALUES (2);
 source include/kill_query.inc;
 include/rpl_diff.inc
+ALTER EVENT e1
+ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 2 DAY;
+source include/kill_query.inc;
+include/rpl_diff.inc
 DROP EVENT e1;
 source include/kill_query.inc;
 include/rpl_diff.inc
@@ -83,6 +91,9 @@ include/rpl_diff.inc
 DROP FUNCTION f1;
 source include/kill_query.inc;
 include/rpl_diff.inc
+DROP FUNCTION IF EXISTS f2;
+source include/kill_query.inc;
+include/rpl_diff.inc
 CREATE PROCEDURE p2 (OUT rows INT)
 BEGIN
 SELECT COUNT(*) INTO rows FROM t2;
@@ -96,6 +107,9 @@ include/rpl_diff.inc
 DROP PROCEDURE p1;
 source include/kill_query.inc;
 include/rpl_diff.inc
+DROP PROCEDURE IF EXISTS p2;
+source include/kill_query.inc;
+include/rpl_diff.inc
 CREATE TABLE t2 (b int);
 source include/kill_query.inc;
 include/rpl_diff.inc
diff --git a/mysql-test/suite/rpl/t/rpl_killed_ddl.test b/mysql-test/suite/rpl/t/rpl_killed_ddl.test
index a56a39a278..76e9b3af09 100644
--- a/mysql-test/suite/rpl/t/rpl_killed_ddl.test
+++ b/mysql-test/suite/rpl/t/rpl_killed_ddl.test
@@ -26,10 +26,7 @@
 #
 # There are some part of the test are temporarily disabled because of
 # the following bugs, please enable then once they get fixed:
-#  - BUG#44041
-#  - BUG#43353
-#  - BUG#25705
-#  - BUG#44171
+#  - BUG#22473427
 
 source include/have_debug.inc;
 source include/master-slave.inc;
@@ -145,11 +142,9 @@ let $rpl_diff_statement= SELECT schema_name FROM information_schema.schemata
 send CREATE DATABASE d2;
 source include/kill_query_and_diff_master_slave.inc;
 
-# Temporarily disabled, see BUG#44041, the ALTER DATABASE can affect the
-# collation of other database on slave
-#send ALTER DATABASE d1
-#       DEFAULT CHARACTER SET = 'utf8';
-#source include/kill_query_and_diff_master_slave.inc;
+send ALTER DATABASE d1
+       DEFAULT CHARACTER SET = 'utf8';
+source include/kill_query_and_diff_master_slave.inc;
 
 send DROP DATABASE d1;
 source include/kill_query_and_diff_master_slave.inc;
@@ -168,11 +163,9 @@ send CREATE EVENT e2
   DO INSERT INTO test.t1 VALUES (2);
 source include/kill_query_and_diff_master_slave.inc;
 
-# Temporarily disabled because of BUG#44171, killing ALTER EVENT can
-# crash the server
-#send ALTER EVENT e1
-#  ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 2 DAY;
-#source include/kill_query_and_diff_master_slave.inc;
+send ALTER EVENT e1
+  ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 2 DAY;
+source include/kill_query_and_diff_master_slave.inc;
 
 send DROP EVENT e1;
 source include/kill_query_and_diff_master_slave.inc;
@@ -198,16 +191,8 @@ source include/kill_query_and_diff_master_slave.inc;
 
 # function f2 probably does not exist because the CREATE query was
 # killed
-#
-# Temporarily disabled. Because of BUG#43353, KILL the query may
-# result in function not found, and for 5.1, DROP statements will be
-# logged if the function is not found on master, so the following DROP
-# FUNCTION statement may be interrupted and not drop the function on
-# master, but still get logged and executed on slave and cause
-# inconsistence. Also disable the following DROP PROCEDURE IF EXITS
-# below.
-#send DROP FUNCTION IF EXISTS f2;
-#source include/kill_query_and_diff_master_slave.inc;
+send DROP FUNCTION IF EXISTS f2;
+source include/kill_query_and_diff_master_slave.inc;
 
 ######## PROCEDURE ########
 
@@ -228,9 +213,8 @@ source include/kill_query_and_diff_master_slave.inc;
 send DROP PROCEDURE p1;
 source include/kill_query_and_diff_master_slave.inc;
 
-# Temporarily disabled because of bug#43353, see comment above for DROP FUNCTION IF EXISTS
-#send DROP PROCEDURE IF EXISTS p2;
-#source include/kill_query_and_diff_master_slave.inc;
+send DROP PROCEDURE IF EXISTS p2;
+source include/kill_query_and_diff_master_slave.inc;
 
 ######## TABLE ########
 
@@ -258,9 +242,10 @@ source include/kill_query_and_diff_master_slave.inc;
 
 ######## SERVER ########
 
-# Tempoarily disabled, see bug#25705
+# Temporarily disabled, see Bug #22473427 - DROP SERVER FAILS
+# AFTER ALTER SERVER+KILL QUERY
 
-# --let $rpl_diff_statement= SELECT * FROM mysql.server WHERE name like \'s%\'
+# --let $rpl_diff_statement= SELECT * FROM mysql.servers WHERE Server_name like \'s%\'
 
 # send CREATE SERVER s2
 #     FOREIGN DATA WRAPPER mysql
-- 
2.30.9