Commit 1cb2e033 authored by Sergei Petrunia's avatar Sergei Petrunia

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.
parent 5ccf3f96
......@@ -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:
......
......@@ -81,3 +81,10 @@ ROCKSDB_DDL Gamma
ROCKSDB_INDEX_FILE_MAP Gamma
ROCKSDB_LOCKS Gamma
ROCKSDB_TRX Gamma
#
# MDEV-12466 : Assertion `thd->transaction.stmt.is_empty() || thd->in_sub_stmt || ...
#
CREATE TABLE t1 (i INT) ENGINE=RocksDB;
FLUSH TABLE t1 FOR EXPORT;
ERROR HY000: Storage engine ROCKSDB of the table `test`.`t1` doesn't have this option
DROP TABLE t1;
......@@ -73,3 +73,13 @@ set global rocksdb_strict_collation_check=@tmp_rscc;
--echo #
select plugin_name, plugin_maturity from information_schema.plugins where plugin_name like '%rocksdb%';
--echo #
--echo # MDEV-12466 : Assertion `thd->transaction.stmt.is_empty() || thd->in_sub_stmt || ...
--echo #
CREATE TABLE t1 (i INT) ENGINE=RocksDB;
--error ER_ILLEGAL_HA
FLUSH TABLE t1 FOR EXPORT;
DROP TABLE t1;
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