mirror of
https://github.com/MariaDB/server.git
synced 2025-07-18 23:03:28 +03:00
If a binlog file is manually replaced with a namesake directory the internal purging did not handle the error of deleting the file so that eventually a post-execution guards fires an assert. Fixed with reusing a snippet of code for bug@18199 to tolerate lack of the file but no other error at an attempt to delete it. The same applied to the index file deletion. The cset carries pieces of manual merging. mysql-test/r/binlog_index.result: new results mysql-test/r/ctype_big5.result: results changed mysql-test/suite/binlog/r/binlog_auto_increment_bug33029.result: new results mysql-test/suite/binlog/r/binlog_stm_blackhole.result: new results mysql-test/suite/binlog/t/binlog_auto_increment_bug33029.test: cleanup. still todo: to let the test run multiple times w/o restarting the server (just ./mtr test) mysql-test/suite/rpl/r/rpl_stm_auto_increment_bug33029.result: results changed mysql-test/suite/rpl/t/rpl_stm_auto_increment_bug33029.test: guarding the test with statement format condition as the logics of the test requires sql/log.cc: two changes. One for the bug, other manual merge. The bug change needs MYF(0) to pass to my_delete because not all error out of the function are critical. The finer check is done on the caller of my_delete similarly how it was implemented for bug@18199 fixes. Non-existance of a file is not a critical error. sql/sql_class.cc: manual merge, removing extra automatically brought hunk.
170 lines
3.7 KiB
Plaintext
170 lines
3.7 KiB
Plaintext
stop slave;
|
|
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
|
reset master;
|
|
reset slave;
|
|
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
|
start slave;
|
|
DROP TABLE IF EXISTS t1, t2;
|
|
DROP PROCEDURE IF EXISTS p1;
|
|
DROP PROCEDURE IF EXISTS p2;
|
|
DROP TRIGGER IF EXISTS tr1;
|
|
DROP FUNCTION IF EXISTS f1;
|
|
CREATE TABLE t1 (id INT AUTO_INCREMENT PRIMARY KEY);
|
|
CREATE TABLE t2 (id INT AUTO_INCREMENT PRIMARY KEY);
|
|
CREATE PROCEDURE p1()
|
|
BEGIN
|
|
DECLARE ins_count INT DEFAULT 10;
|
|
WHILE ins_count > 0 DO
|
|
INSERT INTO t1 VALUES (NULL);
|
|
SET ins_count = ins_count - 1;
|
|
END WHILE;
|
|
DELETE FROM t1 WHERE id = 1;
|
|
DELETE FROM t1 WHERE id = 2;
|
|
DELETE FROM t2 WHERE id = 1;
|
|
DELETE FROM t2 WHERE id = 2;
|
|
END//
|
|
CREATE PROCEDURE p2()
|
|
BEGIN
|
|
INSERT INTO t1 VALUES (NULL);
|
|
DELETE FROM t1 WHERE id = f1(3);
|
|
DELETE FROM t1 WHERE id = f1(4);
|
|
DELETE FROM t2 WHERE id = 3;
|
|
DELETE FROM t2 WHERE id = 4;
|
|
END//
|
|
CREATE TRIGGER tr1 BEFORE DELETE
|
|
ON t1 FOR EACH ROW
|
|
BEGIN
|
|
INSERT INTO t2 VALUES (NULL);
|
|
END//
|
|
CREATE FUNCTION f1 (i int) RETURNS int
|
|
BEGIN
|
|
INSERT INTO t2 VALUES (NULL);
|
|
RETURN i;
|
|
END//
|
|
CALL p1();
|
|
show binlog events from <binlog_start>;
|
|
Log_name Pos Event_type Server_id End_log_pos Info
|
|
master-bin.000001 # Intvar # # INSERT_ID=1
|
|
master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (NULL)
|
|
master-bin.000001 # Intvar # # INSERT_ID=2
|
|
master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (NULL)
|
|
master-bin.000001 # Intvar # # INSERT_ID=3
|
|
master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (NULL)
|
|
master-bin.000001 # Intvar # # INSERT_ID=4
|
|
master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (NULL)
|
|
master-bin.000001 # Intvar # # INSERT_ID=5
|
|
master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (NULL)
|
|
master-bin.000001 # Intvar # # INSERT_ID=6
|
|
master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (NULL)
|
|
master-bin.000001 # Intvar # # INSERT_ID=7
|
|
master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (NULL)
|
|
master-bin.000001 # Intvar # # INSERT_ID=8
|
|
master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (NULL)
|
|
master-bin.000001 # Intvar # # INSERT_ID=9
|
|
master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (NULL)
|
|
master-bin.000001 # Intvar # # INSERT_ID=10
|
|
master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (NULL)
|
|
master-bin.000001 # Intvar # # INSERT_ID=1
|
|
master-bin.000001 # Query # # use `test`; DELETE FROM t1 WHERE id = 1
|
|
master-bin.000001 # Intvar # # INSERT_ID=2
|
|
master-bin.000001 # Query # # use `test`; DELETE FROM t1 WHERE id = 2
|
|
master-bin.000001 # Query # # use `test`; DELETE FROM t2 WHERE id = 1
|
|
master-bin.000001 # Query # # use `test`; DELETE FROM t2 WHERE id = 2
|
|
# Result on master
|
|
SELECT * FROM t1;
|
|
id
|
|
3
|
|
4
|
|
5
|
|
6
|
|
7
|
|
8
|
|
9
|
|
10
|
|
SELECT * FROM t2;
|
|
id
|
|
# Result on slave
|
|
SELECT * FROM t1;
|
|
id
|
|
3
|
|
4
|
|
5
|
|
6
|
|
7
|
|
8
|
|
9
|
|
10
|
|
SELECT * FROM t2;
|
|
id
|
|
DROP TRIGGER tr1;
|
|
CALL p2();
|
|
show binlog events from <binlog_start>;
|
|
Log_name Pos Event_type Server_id End_log_pos Info
|
|
master-bin.000001 # Intvar # # INSERT_ID=11
|
|
master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (NULL)
|
|
master-bin.000001 # Intvar # # INSERT_ID=3
|
|
master-bin.000001 # Query # # use `test`; DELETE FROM t1 WHERE id = f1(3)
|
|
master-bin.000001 # Intvar # # INSERT_ID=12
|
|
master-bin.000001 # Query # # use `test`; DELETE FROM t1 WHERE id = f1(4)
|
|
master-bin.000001 # Query # # use `test`; DELETE FROM t2 WHERE id = 3
|
|
master-bin.000001 # Query # # use `test`; DELETE FROM t2 WHERE id = 4
|
|
# Result on master
|
|
SELECT * FROM t1;
|
|
id
|
|
5
|
|
6
|
|
7
|
|
8
|
|
9
|
|
10
|
|
11
|
|
SELECT * FROM t2;
|
|
id
|
|
5
|
|
6
|
|
7
|
|
8
|
|
9
|
|
10
|
|
11
|
|
12
|
|
13
|
|
14
|
|
15
|
|
16
|
|
17
|
|
18
|
|
19
|
|
# Result on slave
|
|
SELECT * FROM t1;
|
|
id
|
|
5
|
|
6
|
|
7
|
|
8
|
|
9
|
|
10
|
|
11
|
|
SELECT * FROM t2;
|
|
id
|
|
5
|
|
6
|
|
7
|
|
8
|
|
9
|
|
10
|
|
11
|
|
12
|
|
13
|
|
14
|
|
15
|
|
16
|
|
17
|
|
18
|
|
19
|
|
DROP TABLE IF EXISTS t1, t2;
|
|
DROP PROCEDURE IF EXISTS p1;
|
|
DROP PROCEDURE IF EXISTS p2;
|
|
DROP FUNCTION IF EXISTS f1;
|
|
DROP TRIGGER IF EXISTS tr1;
|