Commit d9b933be authored by Jan Lindström's avatar Jan Lindström

MDEV-24062 : Galera test failure on galera_var_replicate_myisam_on

We should do after_statement only for local transactions.
parent 96b4a5a6
......@@ -53,8 +53,8 @@ COUNT(*) = 0
1
DROP TABLE t1;
connection node_1;
CREATE TABLE t1 (f1 INTEGER) ENGINE=MyISAM;
CREATE TABLE t2 (f1 INTEGER) ENGINE=InnoDB;
CREATE TABLE t1 (f1 INTEGER NOT NULL PRIMARY KEY) ENGINE=MyISAM;
CREATE TABLE t2 (f1 INTEGER NOT NULL PRIMARY KEY) ENGINE=InnoDB;
SET AUTOCOMMIT=OFF;
START TRANSACTION;
INSERT INTO t1 VALUES (1);
......@@ -100,7 +100,7 @@ DROP TABLE t2;
# MDEV-11152: wsrep_replicate_myisam: SELECT gets replicated using TO
#
connection node_1;
CREATE TABLE t1 (i INT) ENGINE=INNODB;
CREATE TABLE t1 (i INT NOT NULL PRIMARY KEY) ENGINE=INNODB;
INSERT INTO t1 VALUES(1);
SELECT * FROM t1;
i
......@@ -237,5 +237,14 @@ DROP TRIGGER tr1;
DROP TRIGGER tr2;
DROP TRIGGER tr3;
DROP TABLE t1,t2;
CREATE TABLE t1 (a INT, b INT, UNIQUE(a)) ENGINE=MyISAM;
CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW SET NEW.a=1;
SET GLOBAL wsrep_replicate_myisam=ON;
INSERT INTO t1 (a,b) VALUES (10,20);
connection node_2;
SELECT * from t1;
a b
1 20
connection node_1;
DROP TABLE t1;
connection node_2;
......@@ -80,8 +80,8 @@ DROP TABLE t1;
#
--connection node_1
CREATE TABLE t1 (f1 INTEGER) ENGINE=MyISAM;
CREATE TABLE t2 (f1 INTEGER) ENGINE=InnoDB;
CREATE TABLE t1 (f1 INTEGER NOT NULL PRIMARY KEY) ENGINE=MyISAM;
CREATE TABLE t2 (f1 INTEGER NOT NULL PRIMARY KEY) ENGINE=InnoDB;
SET AUTOCOMMIT=OFF;
START TRANSACTION;
INSERT INTO t1 VALUES (1);
......@@ -136,7 +136,7 @@ DROP TABLE t2;
--echo # MDEV-11152: wsrep_replicate_myisam: SELECT gets replicated using TO
--echo #
--connection node_1
CREATE TABLE t1 (i INT) ENGINE=INNODB;
CREATE TABLE t1 (i INT NOT NULL PRIMARY KEY) ENGINE=INNODB;
INSERT INTO t1 VALUES(1);
# This command should not get replicated.
SELECT * FROM t1;
......@@ -218,7 +218,16 @@ DROP TRIGGER tr2;
DROP TRIGGER tr3;
DROP TABLE t1,t2;
CREATE TABLE t1 (a INT, b INT, UNIQUE(a)) ENGINE=MyISAM;
CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW SET NEW.a=1;
SET GLOBAL wsrep_replicate_myisam=ON;
INSERT INTO t1 (a,b) VALUES (10,20);
--connection node_2
SELECT * from t1;
--connection node_1
DROP TABLE t1;
--disable_query_log
--eval SET GLOBAL wsrep_replicate_myisam = $wsrep_replicate_myisam_orig
--enable_query_log
......@@ -227,3 +236,4 @@ DROP TABLE t1,t2;
--disable_query_log
--eval SET GLOBAL wsrep_replicate_myisam = $wsrep_replicate_myisam_orig
--enable_query_log
......@@ -396,7 +396,14 @@ static inline
int wsrep_after_statement(THD* thd)
{
DBUG_ENTER("wsrep_after_statement");
DBUG_RETURN(thd->wsrep_cs().state() != wsrep::client_state::s_none ?
WSREP_DEBUG("wsrep_after_statement for %lu client_state %s "
" client_mode %s trans_state %s",
thd_get_thread_id(thd),
wsrep::to_c_string(thd->wsrep_cs().state()),
wsrep::to_c_string(thd->wsrep_cs().mode()),
wsrep::to_c_string(thd->wsrep_cs().transaction().state()));
DBUG_RETURN((thd->wsrep_cs().state() != wsrep::client_state::s_none &&
thd->wsrep_cs().mode() == Wsrep_client_state::m_local) ?
thd->wsrep_cs().after_statement() : 0);
}
......
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