summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorSergei Petrunia <psergey@askmonty.org>2018-04-07 14:05:28 +0300
committerSergei Petrunia <psergey@askmonty.org>2018-04-07 14:05:28 +0300
commit1cb2e0333d3006f83370168c75d602edf2c3bfd1 (patch)
tree3c4638b42af0464786797ea1e0ef6ca52da7d680 /sql
parent5ccf3f96ac96662c39527997a359746088cef2fb (diff)
downloadmariadb-git-1cb2e0333d3006f83370168c75d602edf2c3bfd1.tar.gz
MDEV-12466 : Assertion `thd->transaction.stmt.is_empty() || thd->in_sub_stmt || ...
When "FLUSH TABLE ... FOR EXPORT" fails, the SQL layer should rollback the statement. Otherwise we hit an assert when we try to close the tables while having a non-empty list of statement transaction participants.
Diffstat (limited to 'sql')
-rw-r--r--sql/sql_reload.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/sql/sql_reload.cc b/sql/sql_reload.cc
index 5d11387fbfe..ce3ff5964e2 100644
--- a/sql/sql_reload.cc
+++ b/sql/sql_reload.cc
@@ -30,6 +30,7 @@
#include "sql_show.h"
#include "debug_sync.h"
#include "des_key_file.h"
+#include "transaction.h"
static void disable_checkpoints(THD *thd);
@@ -593,6 +594,7 @@ bool flush_tables_with_read_lock(THD *thd, TABLE_LIST *all_tables)
return FALSE;
error_reset_bits:
+ trans_rollback_stmt(thd);
close_thread_tables(thd);
thd->variables.option_bits&= ~OPTION_TABLE_LOCK;
error: