Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MDEV-21578 : CREATE OR REPLACE TRIGGER in Galera cluster not replicating
While doing TOI buffer OR REPLACE option was not added to replicated string.
- Loading branch information
Jan Lindström
committed
Aug 28, 2020
1 parent
df07ea0
commit c710c45
Showing
3 changed files
with
74 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
CREATE TABLE IF NOT EXISTS t1 (id int(10) not null primary key) engine=innodb; | ||
CREATE OR REPLACE TRIGGER tr1 | ||
BEFORE INSERT ON t1 FOR EACH ROW | ||
BEGIN | ||
SET NEW.id = 100; | ||
END| | ||
INSERT INTO t1 VALUES (1); | ||
SELECT * from t1; | ||
id | ||
100 | ||
CREATE OR REPLACE TRIGGER tr1 | ||
BEFORE INSERT ON t1 FOR EACH ROW | ||
BEGIN | ||
SET NEW.id = 200; | ||
END| | ||
connection node_2; | ||
SET SESSION wsrep_sync_wait=15; | ||
SELECT * FROM t1; | ||
id | ||
100 | ||
INSERT INTO t1 values (2); | ||
SELECT * FROM t1; | ||
id | ||
100 | ||
200 | ||
connection node_1; | ||
SELECT * FROM t1; | ||
id | ||
100 | ||
200 | ||
DROP TRIGGER tr1; | ||
DROP TABLE t1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
--source include/galera_cluster.inc | ||
# | ||
# MDEV-21578 CREATE OR REPLACE TRIGGER in Galera cluster not replicating | ||
# | ||
CREATE TABLE IF NOT EXISTS t1 (id int(10) not null primary key) engine=innodb; | ||
--delimiter | | ||
CREATE OR REPLACE TRIGGER tr1 | ||
BEFORE INSERT ON t1 FOR EACH ROW | ||
BEGIN | ||
SET NEW.id = 100; | ||
END| | ||
--delimiter ; | ||
|
||
INSERT INTO t1 VALUES (1); | ||
SELECT * from t1; | ||
|
||
--delimiter | | ||
CREATE OR REPLACE TRIGGER tr1 | ||
BEFORE INSERT ON t1 FOR EACH ROW | ||
BEGIN | ||
SET NEW.id = 200; | ||
END| | ||
--delimiter ; | ||
|
||
--connection node_2 | ||
SET SESSION wsrep_sync_wait=15; | ||
SELECT * FROM t1; | ||
INSERT INTO t1 values (2); | ||
SELECT * FROM t1; | ||
|
||
--connection node_1 | ||
SELECT * FROM t1; | ||
|
||
DROP TRIGGER tr1; | ||
DROP TABLE t1; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters