summaryrefslogtreecommitdiff
path: root/sql/sql_db.cc
diff options
context:
space:
mode:
authorHe Zhenxing <zhenxing.he@sun.com>2009-12-09 14:13:56 +0800
committerHe Zhenxing <zhenxing.he@sun.com>2009-12-09 14:13:56 +0800
commitbc2b3d2ccc109768cf918d91e08639b530518ea1 (patch)
tree63c3381ab36006f680a37470e2742ce07ab833aa /sql/sql_db.cc
parent63ff2b4c2e7db9872515cec3d897817ac83d109c (diff)
downloadmariadb-git-bc2b3d2ccc109768cf918d91e08639b530518ea1.tar.gz
BUG#45520 rpl_killed_ddl fails sporadically in pb2
There are three issues that caused rpl_killed_ddl fails sporadically in pb2: 1) thd->clear_error() was not called before create Query event if operation is executed successfully. 2) DATABASE d2 might do exist because the statement to CREATE or ALTER it was killed 3) because of bug 43353, kill the query that do DROP FUNCTION or DROP PROCEDURE can result in SP not found This patch fixed all above issues by: 1) Called thd->clear_error() if the operation succeeded. 2) Add IF EXISTS to the DROP DATABASE d2 statement 3) Temporarily disabled testing DROP FUNCTION/PROCEDURE IF EXISTS. mysql-test/t/rpl_killed_ddl.test: DATABASE d2 might not exists, add IF EXITS to the DROP statement sql/sql_db.cc: Called thd->clear_error() if the operation succeeded
Diffstat (limited to 'sql/sql_db.cc')
-rw-r--r--sql/sql_db.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/sql/sql_db.cc b/sql/sql_db.cc
index be538783458..2ad3953625f 100644
--- a/sql/sql_db.cc
+++ b/sql/sql_db.cc
@@ -541,6 +541,7 @@ int mysql_create_db(THD *thd, char *db, HA_CREATE_INFO *create_info,
file. In this case it's best to just continue as if nothing has
happened. (This is a very unlikely senario)
*/
+ thd->clear_error();
}
if (!silent)
@@ -644,6 +645,7 @@ bool mysql_alter_db(THD *thd, const char *db, HA_CREATE_INFO *create_info)
if (mysql_bin_log.is_open())
{
+ thd->clear_error();
Query_log_event qinfo(thd, thd->query, thd->query_length, 0,
/* suppress_use */ TRUE, THD::NOT_KILLED);
@@ -655,7 +657,6 @@ bool mysql_alter_db(THD *thd, const char *db, HA_CREATE_INFO *create_info)
qinfo.db = db;
qinfo.db_len = (uint) strlen(db);
- thd->clear_error();
/* These DDL methods and logging protected with LOCK_mysql_create_db */
mysql_bin_log.write(&qinfo);
}
@@ -769,6 +770,7 @@ bool mysql_rm_db(THD *thd,char *db,bool if_exists, bool silent)
}
if (mysql_bin_log.is_open())
{
+ thd->clear_error();
Query_log_event qinfo(thd, query, query_length, 0,
/* suppress_use */ TRUE, THD::NOT_KILLED);
/*
@@ -779,7 +781,6 @@ bool mysql_rm_db(THD *thd,char *db,bool if_exists, bool silent)
qinfo.db = db;
qinfo.db_len = (uint) strlen(db);
- thd->clear_error();
/* These DDL methods and logging protected with LOCK_mysql_create_db */
mysql_bin_log.write(&qinfo);
}