diff options
author | He Zhenxing <zhenxing.he@sun.com> | 2009-03-27 13:19:50 +0800 |
---|---|---|
committer | He Zhenxing <zhenxing.he@sun.com> | 2009-03-27 13:19:50 +0800 |
commit | 95301268221bfcf72baaa9f34f234ff6231235c8 (patch) | |
tree | c64191bf0f499c4e0d6b020460f019c04f7dc2e8 /sql/sql_db.cc | |
parent | 75ab3274c8f36aa0be49d03e3616e5c557890b2a (diff) | |
download | mariadb-git-95301268221bfcf72baaa9f34f234ff6231235c8.tar.gz |
BUG#37145 Killing a statement doing DDL may log binlog event with error code 1053
When the thread executing a DDL was killed after finished its
execution but before writing the binlog event, the error code in
the binlog event could be set wrongly to ER_SERVER_SHUTDOWN or
ER_QUERY_INTERRUPTED.
This patch fixed the problem by ignoring the kill status when
constructing the event for DDL statements.
This patch also included the following changes in order to
provide the test case.
1) modified mysqltest to support variable for connection command
2) modified mysql-test-run.pl, add new variable MYSQL_SLAVE to
run mysql client against the slave mysqld.
Diffstat (limited to 'sql/sql_db.cc')
-rw-r--r-- | sql/sql_db.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sql/sql_db.cc b/sql/sql_db.cc index 80fea3ef1b1..be538783458 100644 --- a/sql/sql_db.cc +++ b/sql/sql_db.cc @@ -70,7 +70,7 @@ static byte* dboptions_get_key(my_dbopt_t *opt, uint *length, static inline void write_to_binlog(THD *thd, char *query, uint q_len, char *db, uint db_len) { - Query_log_event qinfo(thd, query, q_len, 0, 0); + Query_log_event qinfo(thd, query, q_len, 0, 0, THD::NOT_KILLED); qinfo.error_code= 0; qinfo.db= db; qinfo.db_len= db_len; @@ -562,7 +562,7 @@ int mysql_create_db(THD *thd, char *db, HA_CREATE_INFO *create_info, if (mysql_bin_log.is_open()) { Query_log_event qinfo(thd, query, query_length, 0, - /* suppress_use */ TRUE); + /* suppress_use */ TRUE, THD::NOT_KILLED); /* Write should use the database being created as the "current @@ -645,7 +645,7 @@ bool mysql_alter_db(THD *thd, const char *db, HA_CREATE_INFO *create_info) if (mysql_bin_log.is_open()) { Query_log_event qinfo(thd, thd->query, thd->query_length, 0, - /* suppress_use */ TRUE); + /* suppress_use */ TRUE, THD::NOT_KILLED); /* Write should use the database being created as the "current @@ -770,7 +770,7 @@ bool mysql_rm_db(THD *thd,char *db,bool if_exists, bool silent) if (mysql_bin_log.is_open()) { Query_log_event qinfo(thd, query, query_length, 0, - /* suppress_use */ TRUE); + /* suppress_use */ TRUE, THD::NOT_KILLED); /* Write should use the database being created as the "current database" and not the threads current database, which is the |