diff options
author | He Zhenxing <zhenxing.he@sun.com> | 2010-01-24 15:03:23 +0800 |
---|---|---|
committer | He Zhenxing <zhenxing.he@sun.com> | 2010-01-24 15:03:23 +0800 |
commit | 2b16517522afad76bc94b07bdaa8af64091e713b (patch) | |
tree | 30ea0d6bf62fef90f4f1499d15e388cb43241707 /sql/sql_rename.cc | |
parent | 16471fecc7084f2eb56c459ff209bf2491ff327d (diff) | |
download | mariadb-git-2b16517522afad76bc94b07bdaa8af64091e713b.tar.gz |
Backport Bug#37148 to 5.1
Diffstat (limited to 'sql/sql_rename.cc')
-rw-r--r-- | sql/sql_rename.cc | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/sql/sql_rename.cc b/sql/sql_rename.cc index dac96f2e9c4..e85e730db5b 100644 --- a/sql/sql_rename.cc +++ b/sql/sql_rename.cc @@ -34,6 +34,7 @@ static TABLE_LIST *reverse_table_list(TABLE_LIST *table_list); bool mysql_rename_tables(THD *thd, TABLE_LIST *table_list, bool silent) { bool error= 1; + bool binlog_error= 0; TABLE_LIST *ren_table= 0; int to_table; char *rename_log_table[2]= {NULL, NULL}; @@ -174,11 +175,11 @@ bool mysql_rename_tables(THD *thd, TABLE_LIST *table_list, bool silent) */ pthread_mutex_unlock(&LOCK_open); - /* Lets hope this doesn't fail as the result will be messy */ if (!silent && !error) { - write_bin_log(thd, TRUE, thd->query(), thd->query_length()); - my_ok(thd); + binlog_error= write_bin_log(thd, TRUE, thd->query(), thd->query_length()); + if (!binlog_error) + my_ok(thd); } if (!error) @@ -190,7 +191,7 @@ bool mysql_rename_tables(THD *thd, TABLE_LIST *table_list, bool silent) err: start_waiting_global_read_lock(thd); - DBUG_RETURN(error); + DBUG_RETURN(error || binlog_error); } |