mirror of
https://github.com/MariaDB/server.git
synced 2025-01-17 20:42:30 +01:00
51a9116638
When the thread executing a DDL was killed after finished its execution but before writing the binlog event, the error code in the binlog event could be set wrongly to ER_SERVER_SHUTDOWN or ER_QUERY_INTERRUPTED. This patch fixed the problem by ignoring the kill status when constructing the event for DDL statements. This patch also included the following changes in order to provide the test case. 1) modified mysqltest to support variable for connection command 2) modified mysql-test-run.pl, add new variable MYSQL_SLAVE to run mysql client against the slave mysqld.
146 lines
4.1 KiB
Text
146 lines
4.1 KiB
Text
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 DATABASE IF EXISTS d1;
|
|
DROP DATABASE IF EXISTS d2;
|
|
DROP DATABASE IF EXISTS d3;
|
|
DROP DATABASE IF EXISTS d4;
|
|
DROP FUNCTION IF EXISTS f1;
|
|
DROP FUNCTION IF EXISTS f2;
|
|
DROP FUNCTION IF EXISTS f3;
|
|
DROP FUNCTION IF EXISTS f4;
|
|
DROP TABLE IF EXISTS t1;
|
|
DROP TABLE IF EXISTS t2;
|
|
DROP TABLE IF EXISTS t3;
|
|
DROP TABLE IF EXISTS t4;
|
|
DROP PROCEDURE IF EXISTS p1;
|
|
DROP PROCEDURE IF EXISTS p2;
|
|
DROP PROCEDURE IF EXISTS p3;
|
|
DROP PROCEDURE IF EXISTS p4;
|
|
DROP TRIGGER IF EXISTS tr1;
|
|
DROP TRIGGER IF EXISTS tr2;
|
|
DROP TRIGGER IF EXISTS tr3;
|
|
DROP TRIGGER IF EXISTS tr4;
|
|
CREATE DATABASE d1;
|
|
CREATE FUNCTION f1 () RETURNS INT DETERMINISTIC
|
|
RETURN 1;
|
|
CREATE PROCEDURE p1 (OUT rows INT)
|
|
BEGIN
|
|
SELECT COUNT(*) INTO rows FROM t1;
|
|
END;
|
|
//
|
|
CREATE TABLE t1 (a int);
|
|
CREATE TABLE t3 (a int);
|
|
CREATE TRIGGER tr1 BEFORE INSERT ON t1
|
|
FOR EACH ROW BEGIN
|
|
DELETE FROM t4 WHERE a=NEW.a;
|
|
END;
|
|
//
|
|
CREATE INDEX i1 ON t1 (a);
|
|
CREATE VIEW v1 AS SELECT a FROM t1 WHERE a < 100;
|
|
[on master]
|
|
[on master1]
|
|
CREATE DATABASE d2;
|
|
source include/kill_query.inc;
|
|
source include/diff_master_slave.inc;
|
|
ALTER DATABASE d1
|
|
DEFAULT CHARACTER SET = 'utf8';
|
|
source include/kill_query.inc;
|
|
source include/diff_master_slave.inc;
|
|
DROP DATABASE d1;
|
|
source include/kill_query.inc;
|
|
source include/diff_master_slave.inc;
|
|
DROP DATABASE d2;
|
|
source include/kill_query.inc;
|
|
source include/diff_master_slave.inc;
|
|
CREATE FUNCTION f2 () RETURNS INT DETERMINISTIC
|
|
RETURN 1;
|
|
source include/kill_query.inc;
|
|
source include/diff_master_slave.inc;
|
|
ALTER FUNCTION f1 SQL SECURITY INVOKER;
|
|
source include/kill_query.inc;
|
|
source include/diff_master_slave.inc;
|
|
DROP FUNCTION IF EXISTS f1;
|
|
source include/kill_query.inc;
|
|
source include/diff_master_slave.inc;
|
|
DROP FUNCTION IF EXISTS f2;
|
|
source include/kill_query.inc;
|
|
source include/diff_master_slave.inc;
|
|
CREATE PROCEDURE p2 (OUT rows INT)
|
|
BEGIN
|
|
SELECT COUNT(*) INTO rows FROM t2;
|
|
END;
|
|
//
|
|
source include/kill_query.inc;
|
|
source include/diff_master_slave.inc;
|
|
ALTER PROCEDURE p1 SQL SECURITY INVOKER COMMENT 'return rows of table t1';
|
|
source include/kill_query.inc;
|
|
source include/diff_master_slave.inc;
|
|
DROP PROCEDURE IF EXISTS p1;
|
|
source include/kill_query.inc;
|
|
source include/diff_master_slave.inc;
|
|
DROP PROCEDURE IF EXISTS p2;
|
|
source include/kill_query.inc;
|
|
source include/diff_master_slave.inc;
|
|
CREATE TABLE t2 (b int);
|
|
source include/kill_query.inc;
|
|
source include/diff_master_slave.inc;
|
|
ALTER TABLE t1 ADD (d int);
|
|
source include/kill_query.inc;
|
|
source include/diff_master_slave.inc;
|
|
RENAME TABLE t3 TO t4;
|
|
source include/kill_query.inc;
|
|
source include/diff_master_slave.inc;
|
|
CREATE INDEX i2 on t1 (a);
|
|
source include/kill_query.inc;
|
|
source include/diff_master_slave.inc;
|
|
DROP INDEX i1 on t1;
|
|
source include/kill_query.inc;
|
|
source include/diff_master_slave.inc;
|
|
CREATE TRIGGER tr2 BEFORE INSERT ON t4
|
|
FOR EACH ROW BEGIN
|
|
DELETE FROM t1 WHERE a=NEW.a;
|
|
END;
|
|
//
|
|
source include/kill_query.inc;
|
|
source include/diff_master_slave.inc;
|
|
DROP TRIGGER tr1;
|
|
source include/kill_query.inc;
|
|
source include/diff_master_slave.inc;
|
|
DROP TRIGGER IF EXISTS tr2;
|
|
source include/kill_query.inc;
|
|
source include/diff_master_slave.inc;
|
|
CREATE VIEW v2 AS SELECT a FROM t1 WHERE a > 100;
|
|
source include/kill_query.inc;
|
|
source include/diff_master_slave.inc;
|
|
DROP VIEW v1;
|
|
source include/kill_query.inc;
|
|
source include/diff_master_slave.inc;
|
|
DROP VIEW IF EXISTS v2;
|
|
source include/kill_query.inc;
|
|
source include/diff_master_slave.inc;
|
|
DROP TABLE t1;
|
|
source include/kill_query.inc;
|
|
source include/diff_master_slave.inc;
|
|
DROP TABLE IF EXISTS t2;
|
|
source include/kill_query.inc;
|
|
source include/diff_master_slave.inc;
|
|
DROP DATABASE IF EXISTS d1;
|
|
DROP DATABASE IF EXISTS d2;
|
|
DROP DATABASE IF EXISTS d3;
|
|
DROP DATABASE IF EXISTS d4;
|
|
DROP FUNCTION IF EXISTS f1;
|
|
DROP FUNCTION IF EXISTS f2;
|
|
DROP FUNCTION IF EXISTS f3;
|
|
DROP FUNCTION IF EXISTS f4;
|
|
DROP TABLE IF EXISTS t1;
|
|
DROP TABLE IF EXISTS t2;
|
|
DROP TABLE IF EXISTS t3;
|
|
DROP TABLE IF EXISTS t4;
|
|
DROP PROCEDURE IF EXISTS p1;
|
|
DROP PROCEDURE IF EXISTS p2;
|
|
DROP PROCEDURE IF EXISTS p3;
|
|
DROP PROCEDURE IF EXISTS p4;
|