Commit b9227410 authored by Sergei Petrunia's avatar Sergei Petrunia

MDEV-15472: Assertion `!is_set() || (m_status == DA_OK_BULK && is_bulk_op())' failure

MariaDB differs from the upstream for "DDL-like" command. For these,
it sets binlog_format=STATEMENT for the duration of the statement.
This doesn't play well with MyRocks, which tries to prevent DML
commands with binlog_format!=ROW.

Also, if Locked_tables_list::reopen_tables() returned an error, then
close_cached_tables should propagate the error condition and not silently
consume it (it's difficult to have test coverage for this because this
error condition is rare)
parent adaee46a
...@@ -481,7 +481,7 @@ bool close_cached_tables(THD *thd, TABLE_LIST *tables, ...@@ -481,7 +481,7 @@ bool close_cached_tables(THD *thd, TABLE_LIST *tables,
old locks. This should always succeed (unless some external process old locks. This should always succeed (unless some external process
has removed the tables) has removed the tables)
*/ */
thd->locked_tables_list.reopen_tables(thd); result= thd->locked_tables_list.reopen_tables(thd);
/* /*
Since downgrade_lock() won't do anything with shared Since downgrade_lock() won't do anything with shared
metadata lock it is much simpler to go through all open tables rather metadata lock it is much simpler to go through all open tables rather
......
...@@ -10056,6 +10056,7 @@ int ha_rocksdb::external_lock(THD *const thd, int lock_type) { ...@@ -10056,6 +10056,7 @@ int ha_rocksdb::external_lock(THD *const thd, int lock_type) {
thd->lex->sql_command != SQLCOM_LOCK_TABLES && // (*) thd->lex->sql_command != SQLCOM_LOCK_TABLES && // (*)
thd->lex->sql_command != SQLCOM_ANALYZE && // (**) thd->lex->sql_command != SQLCOM_ANALYZE && // (**)
thd->lex->sql_command != SQLCOM_OPTIMIZE && // (**) thd->lex->sql_command != SQLCOM_OPTIMIZE && // (**)
thd->lex->sql_command != SQLCOM_FLUSH && // (**)
my_core::thd_binlog_filter_ok(thd)) { my_core::thd_binlog_filter_ok(thd)) {
my_error(ER_REQUIRE_ROW_BINLOG_FORMAT, MYF(0)); my_error(ER_REQUIRE_ROW_BINLOG_FORMAT, MYF(0));
DBUG_RETURN(HA_ERR_UNSUPPORTED); DBUG_RETURN(HA_ERR_UNSUPPORTED);
......
#
# MDEV-15472: Assertion `!is_set() || (m_status == DA_OK_BULK && is_bulk_op())' failure ...
#
select @@log_bin;
@@log_bin
1
select @@binlog_format;
@@binlog_format
ROW
CREATE OR REPLACE TABLE t1 (i INT) ENGINE=RocksDB;
LOCK TABLE t1 WRITE;
FLUSH TABLES;
UNLOCK TABLES;
DROP TABLE t1;
--source include/have_rocksdb.inc
--source include/have_binlog_format_row.inc
--echo #
--echo # MDEV-15472: Assertion `!is_set() || (m_status == DA_OK_BULK && is_bulk_op())' failure ...
--echo #
select @@log_bin;
select @@binlog_format;
CREATE OR REPLACE TABLE t1 (i INT) ENGINE=RocksDB;
LOCK TABLE t1 WRITE;
FLUSH TABLES;
UNLOCK TABLES;
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