summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorMichael Widenius <monty@mariadb.org>2014-03-23 15:55:05 +0200
committerMichael Widenius <monty@askmonty.org>2014-03-23 15:55:05 +0200
commit6214f4e51ccfc2c8cbb82549559e61f4a436996b (patch)
treef6d9506ceeadb812e4e367169a9e4171f22ddaf1 /sql
parentb18a1b0e6ccc326ced01620edd842d899139feec (diff)
downloadmariadb-git-6214f4e51ccfc2c8cbb82549559e61f4a436996b.tar.gz
MDEV-5930: Server crashes in thd_get_ha_data on CREATE OR REPLACE TABLE
I had forgot to check if binary logging and that we had logged row log events before clearing the transaction cache.
Diffstat (limited to 'sql')
-rw-r--r--sql/log.cc8
1 files changed, 5 insertions, 3 deletions
diff --git a/sql/log.cc b/sql/log.cc
index e7a4c82b0b4..f000043f7c2 100644
--- a/sql/log.cc
+++ b/sql/log.cc
@@ -2052,9 +2052,11 @@ void binlog_reset_cache(THD *thd)
binlog_cache_mngr *const cache_mngr=
(binlog_cache_mngr*) thd_get_ha_data(thd, binlog_hton);
DBUG_ENTER("binlog_reset_cache");
- thd->binlog_remove_pending_rows_event(TRUE, TRUE);
- cache_mngr->reset(true, true);
- thd->clear_binlog_table_maps();
+ if (cache_mngr)
+ {
+ thd->binlog_remove_pending_rows_event(TRUE, TRUE);
+ cache_mngr->reset(true, true);
+ }
DBUG_VOID_RETURN;
}