Browse Source

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)
pull/669/merge
Sergei Petrunia 8 years ago
parent
commit
b922741074
  1. 2
      sql/sql_base.cc
  2. 1
      storage/rocksdb/ha_rocksdb.cc
  3. 14
      storage/rocksdb/mysql-test/rocksdb/r/mariadb_port_rpl.result
  4. 14
      storage/rocksdb/mysql-test/rocksdb/t/mariadb_port_rpl.test

2
sql/sql_base.cc

@ -481,7 +481,7 @@ err_with_reopen:
old locks. This should always succeed (unless some external process
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
metadata lock it is much simpler to go through all open tables rather

1
storage/rocksdb/ha_rocksdb.cc

@ -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_ANALYZE && // (**)
thd->lex->sql_command != SQLCOM_OPTIMIZE && // (**)
thd->lex->sql_command != SQLCOM_FLUSH && // (**)
my_core::thd_binlog_filter_ok(thd)) {
my_error(ER_REQUIRE_ROW_BINLOG_FORMAT, MYF(0));
DBUG_RETURN(HA_ERR_UNSUPPORTED);

14
storage/rocksdb/mysql-test/rocksdb/r/mariadb_port_rpl.result

@ -0,0 +1,14 @@
#
# 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;

14
storage/rocksdb/mysql-test/rocksdb/t/mariadb_port_rpl.test

@ -0,0 +1,14 @@
--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;
Loading…
Cancel
Save