summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsachin <sachin.setiya@mariadb.com>2018-05-14 12:15:38 +0530
committersachin <sachin.setiya@mariadb.com>2018-05-14 12:17:17 +0530
commitab7c7181f13a44c5c987b547f1ae49d41f52b367 (patch)
treec6f90630c01e7726bc15cd04c4ee1b3368082057
parentda3c5c3c9ad53eda04293e5f5ee6795197c70652 (diff)
downloadmariadb-git-bb-mdev-14472.tar.gz
MDEV-14472 Assertion `is_current_stmt_binlog_format_row()' failed...bb-mdev-14472
in THD::binlog_write_table_map try 1 patch
-rw-r--r--mysql-test/suite/binlog/r/mdev_14472.result12
-rw-r--r--mysql-test/suite/binlog/t/mdev_14472.test22
-rw-r--r--sql/sql_base.cc8
3 files changed, 40 insertions, 2 deletions
diff --git a/mysql-test/suite/binlog/r/mdev_14472.result b/mysql-test/suite/binlog/r/mdev_14472.result
new file mode 100644
index 00000000000..0a2483678f1
--- /dev/null
+++ b/mysql-test/suite/binlog/r/mdev_14472.result
@@ -0,0 +1,12 @@
+CREATE TABLE t1 (f1 INT);
+CREATE TABLE t2 (f2 INT);
+CREATE TABLE t3 (f3 INT);
+CREATE TABLE t4 (pk INT AUTO_INCREMENT PRIMARY KEY);
+CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW INSERT INTO t2 VALUES ();
+CREATE TRIGGER tr2 AFTER INSERT ON t1 FOR EACH ROW INSERT INTO t3 VALUES ();
+CREATE TRIGGER tr3 BEFORE INSERT ON t2 FOR EACH ROW INSERT INTO t4 VALUES ();
+LOCK TABLE t1 WRITE;
+INSERT INTO t2 () VALUES ();
+INSERT INTO t3 VALUES ();
+UNLOCK TABLES;
+DROP TABLE t1, t2, t3, t4;
diff --git a/mysql-test/suite/binlog/t/mdev_14472.test b/mysql-test/suite/binlog/t/mdev_14472.test
new file mode 100644
index 00000000000..fd892a44f5c
--- /dev/null
+++ b/mysql-test/suite/binlog/t/mdev_14472.test
@@ -0,0 +1,22 @@
+--source include/have_log_bin.inc
+--source include/have_binlog_format_mixed.inc
+
+# Reproducible with MyISAM, InnoDB, Aria
+
+CREATE TABLE t1 (f1 INT);
+CREATE TABLE t2 (f2 INT);
+CREATE TABLE t3 (f3 INT);
+CREATE TABLE t4 (pk INT AUTO_INCREMENT PRIMARY KEY);
+
+CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW INSERT INTO t2 VALUES ();
+CREATE TRIGGER tr2 AFTER INSERT ON t1 FOR EACH ROW INSERT INTO t3 VALUES ();
+CREATE TRIGGER tr3 BEFORE INSERT ON t2 FOR EACH ROW INSERT INTO t4 VALUES ();
+
+LOCK TABLE t1 WRITE;
+INSERT INTO t2 () VALUES ();
+INSERT INTO t3 VALUES ();
+
+# Cleanup
+
+UNLOCK TABLES;
+DROP TABLE t1, t2, t3, t4;
diff --git a/sql/sql_base.cc b/sql/sql_base.cc
index e20ad15ae51..55cfb669317 100644
--- a/sql/sql_base.cc
+++ b/sql/sql_base.cc
@@ -603,10 +603,14 @@ static void mark_used_tables_as_free_for_reuse(THD *thd, TABLE *table)
table->query_id= 0;
table->file->ha_reset();
}
+ else
+ {
+ // table of exlict LOCK TABLE
+ table->file->check_table_binlog_row_based_done=
+ table->file->check_table_binlog_row_based_result= 0;
+ }
}
}
-
-
/**
Close all open instances of the table but keep the MDL lock.