summaryrefslogtreecommitdiff
path: root/sql/sql_db.cc
diff options
context:
space:
mode:
authorHe Zhenxing <zhenxing.he@sun.com>2009-12-09 14:24:54 +0800
committerHe Zhenxing <zhenxing.he@sun.com>2009-12-09 14:24:54 +0800
commitb13541ff314a1c352fedc9181d29cbaeb788cee9 (patch)
treebaf92646c98faff95700ddc503f88b187ffa33b5 /sql/sql_db.cc
parent3a733bb4d8c6e1fc9bf9f07aff484d7fb62724a7 (diff)
parentbc2b3d2ccc109768cf918d91e08639b530518ea1 (diff)
downloadmariadb-git-b13541ff314a1c352fedc9181d29cbaeb788cee9.tar.gz
Merge Bug#45520 fix from 5.0-bugteam
Diffstat (limited to 'sql/sql_db.cc')
-rw-r--r--sql/sql_db.cc11
1 files changed, 5 insertions, 6 deletions
diff --git a/sql/sql_db.cc b/sql/sql_db.cc
index e6ccd9aa594..e760fae41f6 100644
--- a/sql/sql_db.cc
+++ b/sql/sql_db.cc
@@ -695,6 +695,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();
}
not_silent:
@@ -810,9 +811,9 @@ bool mysql_alter_db(THD *thd, const char *db, HA_CREATE_INFO *create_info)
if (mysql_bin_log.is_open())
{
- int errcode= query_error_code(thd, TRUE);
+ thd->clear_error();
Query_log_event qinfo(thd, thd->query(), thd->query_length(), 0,
- /* suppress_use */ TRUE, errcode);
+ /* suppress_use */ TRUE, 0);
/*
Write should use the database being created as the "current
@@ -822,7 +823,6 @@ bool mysql_alter_db(THD *thd, const char *db, HA_CREATE_INFO *create_info)
qinfo.db = db;
qinfo.db_len = strlen(db);
- thd->clear_error();
/* These DDL methods and logging protected with LOCK_mysql_create_db */
mysql_bin_log.write(&qinfo);
}
@@ -962,9 +962,9 @@ bool mysql_rm_db(THD *thd,char *db,bool if_exists, bool silent)
}
if (mysql_bin_log.is_open())
{
- int errcode= query_error_code(thd, TRUE);
+ thd->clear_error();
Query_log_event qinfo(thd, query, query_length, 0,
- /* suppress_use */ TRUE, errcode);
+ /* suppress_use */ TRUE, 0);
/*
Write should use the database being created as the "current
database" and not the threads current database, which is the
@@ -973,7 +973,6 @@ bool mysql_rm_db(THD *thd,char *db,bool if_exists, bool silent)
qinfo.db = db;
qinfo.db_len = strlen(db);
- thd->clear_error();
/* These DDL methods and logging protected with LOCK_mysql_create_db */
mysql_bin_log.write(&qinfo);
}