summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mysql-test/suite/galera/r/galera_mdev_15611.result16
-rw-r--r--mysql-test/suite/galera/t/galera_mdev_15611.cnf5
-rw-r--r--mysql-test/suite/galera/t/galera_mdev_15611.test30
-rw-r--r--storage/innobase/row/row0upd.cc18
4 files changed, 59 insertions, 10 deletions
diff --git a/mysql-test/suite/galera/r/galera_mdev_15611.result b/mysql-test/suite/galera/r/galera_mdev_15611.result
new file mode 100644
index 00000000000..9ea1684494a
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_mdev_15611.result
@@ -0,0 +1,16 @@
+connection node_1;
+CREATE TABLE t1 (
+id int primary key
+);
+CREATE TABLE t2 (
+id int primary key ,
+f_id int DEFAULT NULL, FOREIGN KEY(f_id) REFERENCES t1 (id)
+);
+insert into t1 select 1;
+#Running 200 insert in t2 table
+select count(*) from t2;
+count(*)
+200
+delete from t2;
+delete from t1;
+drop table t2,t1;
diff --git a/mysql-test/suite/galera/t/galera_mdev_15611.cnf b/mysql-test/suite/galera/t/galera_mdev_15611.cnf
new file mode 100644
index 00000000000..b6f601c56b1
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_mdev_15611.cnf
@@ -0,0 +1,5 @@
+!include ../galera_2nodes.cnf
+[mysqld.1]
+
+[mysqld.2]
+wsrep_slave_threads=6
diff --git a/mysql-test/suite/galera/t/galera_mdev_15611.test b/mysql-test/suite/galera/t/galera_mdev_15611.test
new file mode 100644
index 00000000000..d32d7e75262
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_mdev_15611.test
@@ -0,0 +1,30 @@
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+--connection node_1
+CREATE TABLE t1 (
+ id int primary key
+);
+
+CREATE TABLE t2 (
+ id int primary key ,
+ f_id int DEFAULT NULL, FOREIGN KEY(f_id) REFERENCES t1 (id)
+);
+
+insert into t1 select 1;
+
+--disable_query_log
+--let $count=200
+--echo #Running 200 insert in t2 table
+while($count)
+{
+ #Repeatedly execute the following SQL until you generate thousands of data
+ --eval insert into t2 values ($count, 1);
+ --dec $count
+}
+--enable_query_log
+
+select count(*) from t2;
+delete from t2;
+delete from t1;
+drop table t2,t1;
diff --git a/storage/innobase/row/row0upd.cc b/storage/innobase/row/row0upd.cc
index 5009ac02408..fd116384026 100644
--- a/storage/innobase/row/row0upd.cc
+++ b/storage/innobase/row/row0upd.cc
@@ -466,17 +466,15 @@ func_exit:
@param[in] node query node
@param[in] trx transaction
@return whether the node cannot be ignored */
-inline
-bool
-wsrep_must_process_fk(const upd_node_t* node, const trx_t* trx)
-{
- if (que_node_get_type(node->common.parent) != QUE_NODE_UPDATE
- || !wsrep_on_trx(trx)) {
- return false;
- }
- return static_cast<upd_node_t*>(node->common.parent)->cascade_node
- == node;
+inline bool wsrep_must_process_fk(const upd_node_t* node, const trx_t* trx)
+{
+ if (!wsrep_on_trx(trx)) {
+ return false;
+ }
+ return que_node_get_type(node->common.parent) != QUE_NODE_UPDATE
+ || static_cast<upd_node_t*>(node->common.parent)->cascade_node
+ != node;
}
#endif /* WITH_WSREP */