Commit 6214f4e5 authored by Michael Widenius's avatar Michael Widenius Committed by Michael Widenius

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.
parent b18a1b0e
......@@ -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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment