mirror of
https://github.com/MariaDB/server.git
synced 2026-05-16 11:57:38 +02:00
BUG#13343 CREATE|etc TRIGGER|VIEW|USER don't commit the transaction (inconsistency)
Updated more DDL statements to cause implicit commit. mysql-test/r/rpl_ddl.result: updated results to test for implicit commit for: CREATE OR REPLACE VIEW ALTER VIEW DROP VIEW CREATE TRIGGER DROP TRIGGER CREATE USER RENAME USER DROP USER mysql-test/t/rpl_ddl.test: updated results to test for implicit commit for: CREATE OR REPLACE VIEW ALTER VIEW DROP VIEW CREATE TRIGGER DROP TRIGGER CREATE USER RENAME USER DROP USER sql/sql_parse.cc: added implicit commit for: CREATE OR REPLACE VIEW ALTER VIEW DROP VIEW CREATE TRIGGER DROP TRIGGER CREATE USER RENAME USER DROP USER
This commit is contained in:
parent
849eafa751
commit
799b1e6c5a
3 changed files with 556 additions and 0 deletions
|
|
@ -391,6 +391,113 @@ SHOW PROCEDURE STATUS LIKE 'p1';
|
|||
connection master;
|
||||
--horizontal_results
|
||||
|
||||
###############################################################
|
||||
# Cases with VIEWs
|
||||
###############################################################
|
||||
let $my_stmt= CREATE OR REPLACE VIEW v1 as select * from t1;
|
||||
let $my_master_commit= true;
|
||||
let $my_slave_commit= true;
|
||||
--source include/rpl_stmt_seq.inc
|
||||
SHOW CREATE VIEW v1;
|
||||
--disable_query_log
|
||||
SELECT '-------- switch to slave -------' as "";
|
||||
--enable_query_log
|
||||
connection slave;
|
||||
SHOW CREATE VIEW v1;
|
||||
connection master;
|
||||
|
||||
let $my_stmt= ALTER VIEW v1 AS select f1 from t1;
|
||||
let $my_master_commit= true;
|
||||
let $my_slave_commit= true;
|
||||
--source include/rpl_stmt_seq.inc
|
||||
SHOW CREATE VIEW v1;
|
||||
--disable_query_log
|
||||
SELECT '-------- switch to slave -------' as "";
|
||||
--enable_query_log
|
||||
connection slave;
|
||||
SHOW CREATE VIEW v1;
|
||||
connection master;
|
||||
|
||||
let $my_stmt= DROP VIEW IF EXISTS v1;
|
||||
let $my_master_commit= true;
|
||||
let $my_slave_commit= true;
|
||||
--source include/rpl_stmt_seq.inc
|
||||
--error 1146
|
||||
SHOW CREATE VIEW v1;
|
||||
--disable_query_log
|
||||
SELECT '-------- switch to slave -------' as "";
|
||||
--enable_query_log
|
||||
connection slave;
|
||||
--error 1146
|
||||
SHOW CREATE VIEW v1;
|
||||
connection master;
|
||||
|
||||
###############################################################
|
||||
# Cases with TRIGGERs
|
||||
###############################################################
|
||||
let $my_stmt= CREATE TRIGGER trg1 BEFORE INSERT ON t1 FOR EACH ROW SET @a:=1;
|
||||
let $my_master_commit= true;
|
||||
let $my_slave_commit= true;
|
||||
--source include/rpl_stmt_seq.inc
|
||||
SHOW TRIGGERS;
|
||||
--disable_query_log
|
||||
SELECT '-------- switch to slave -------' as "";
|
||||
--enable_query_log
|
||||
connection slave;
|
||||
SHOW TRIGGERS;
|
||||
connection master;
|
||||
|
||||
let $my_stmt= DROP TRIGGER trg1;
|
||||
let $my_master_commit= true;
|
||||
let $my_slave_commit= true;
|
||||
--source include/rpl_stmt_seq.inc
|
||||
SHOW TRIGGERS;
|
||||
--disable_query_log
|
||||
SELECT '-------- switch to slave -------' as "";
|
||||
--enable_query_log
|
||||
connection slave;
|
||||
SHOW TRIGGERS;
|
||||
connection master;
|
||||
|
||||
###############################################################
|
||||
# Cases with USERs
|
||||
###############################################################
|
||||
let $my_stmt= CREATE USER user1@localhost;
|
||||
let $my_master_commit= true;
|
||||
let $my_slave_commit= true;
|
||||
--source include/rpl_stmt_seq.inc
|
||||
SELECT user FROM mysql.user WHERE user = 'user1';
|
||||
--disable_query_log
|
||||
SELECT '-------- switch to slave -------' as "";
|
||||
--enable_query_log
|
||||
connection slave;
|
||||
SELECT user FROM mysql.user WHERE user = 'user1';
|
||||
connection master;
|
||||
|
||||
let $my_stmt= RENAME USER user1@localhost TO rename1@localhost;
|
||||
let $my_master_commit= true;
|
||||
let $my_slave_commit= true;
|
||||
--source include/rpl_stmt_seq.inc
|
||||
SELECT user FROM mysql.user WHERE user = 'rename1';
|
||||
--disable_query_log
|
||||
SELECT '-------- switch to slave -------' as "";
|
||||
--enable_query_log
|
||||
connection slave;
|
||||
SELECT user FROM mysql.user WHERE user = 'rename1';
|
||||
connection master;
|
||||
|
||||
let $my_stmt= DROP USER rename1@localhost;
|
||||
let $my_master_commit= true;
|
||||
let $my_slave_commit= true;
|
||||
--source include/rpl_stmt_seq.inc
|
||||
SELECT user FROM mysql.user WHERE user = 'rename1';
|
||||
--disable_query_log
|
||||
SELECT '-------- switch to slave -------' as "";
|
||||
--enable_query_log
|
||||
connection slave;
|
||||
SELECT user FROM mysql.user WHERE user = 'rename1';
|
||||
connection master;
|
||||
|
||||
###############################################################
|
||||
# Cleanup
|
||||
###############################################################
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue