summaryrefslogtreecommitdiff
path: root/sql/sql_update.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/sql_update.cc')
-rw-r--r--sql/sql_update.cc9
1 files changed, 6 insertions, 3 deletions
diff --git a/sql/sql_update.cc b/sql/sql_update.cc
index 41f0eb97456..29e9c8b8aac 100644
--- a/sql/sql_update.cc
+++ b/sql/sql_update.cc
@@ -237,9 +237,12 @@ int mysql_update(THD *thd,TABLE_LIST *table_list,List<Item> &fields,
table->time_stamp=save_time_stamp; // Restore auto timestamp pointer
if (updated)
{
- mysql_update_log.write(thd->query,thd->query_length);
- Query_log_event qinfo(thd, thd->query);
- mysql_bin_log.write(&qinfo);
+ mysql_update_log.write(thd,thd->query,thd->query_length);
+ if (mysql_bin_log.is_open())
+ {
+ Query_log_event qinfo(thd, thd->query);
+ mysql_bin_log.write(&qinfo);
+ }
}
if (ha_autocommit_or_rollback(thd, error >= 0))
error=1;