1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

Merge branch '10.1' into 10.2

This commit is contained in:
Oleksandr Byelkin
2019-05-04 17:04:55 +02:00
205 changed files with 2788 additions and 657 deletions

View File

@@ -0,0 +1,18 @@
include/master-slave.inc
[connection master]
connection slave;
set global debug_dbug='d,rows_log_event_before_open_table';
set debug_sync='now WAIT_FOR before_open_table';
connection master;
create table t1 (a int);
insert t1 values (1),(2),(3);
connection slave;
kill slave_sql_thread;
set debug_sync='now SIGNAL go_ahead_sql';
set global debug_dbug='';
set debug_sync='RESET';
connection master;
drop table t1;
connection slave;
start slave;
include/rpl_end.inc

View File

@@ -4,9 +4,13 @@ connection master;
SET GLOBAL event_scheduler=off;
CREATE TABLE t1 (a INT);
CREATE EVENT ev1 ON SCHEDULE EVERY 1 SECOND DO INSERT INTO t1 VALUES (10);
Warnings:
Warning 1105 Event scheduler is switched off, use SET GLOBAL event_scheduler=ON to enable it.
CREATE EVENT ev1 ON SCHEDULE EVERY 1 SECOND DO INSERT INTO t1 VALUES (11);
ERROR HY000: Event 'ev1' already exists
CREATE OR REPLACE EVENT ev1 ON SCHEDULE EVERY 1 SECOND DO INSERT INTO t1 VALUES (11);
Warnings:
Warning 1105 Event scheduler is switched off, use SET GLOBAL event_scheduler=ON to enable it.
SELECT EVENT_NAME,STATUS,EVENT_DEFINITION FROM INFORMATION_SCHEMA.EVENTS;
EVENT_NAME STATUS EVENT_DEFINITION
ev1 ENABLED INSERT INTO t1 VALUES (11)

View File

@@ -90,6 +90,8 @@ include/diff_tables.inc [server_1:v_user, server_2:v_user, server_3:v_user]
# Verify 'ALTER EVENT...' statement
connection master;
CREATE EVENT e1 ON SCHEDULE EVERY 1 DAY DO SELECT * FROM t1;
Warnings:
Warning 1105 Event scheduler is switched off, use SET GLOBAL event_scheduler=ON to enable it.
# Explicitly assign CURRENT_USER() to definer
ALTER DEFINER=CURRENT_USER() EVENT e1 ENABLE;
include/rpl_sync.inc

View File

@@ -33,6 +33,8 @@ test justonce SLAVESIDE_DISABLED 1
DROP EVENT IF EXISTS test.slave_once;
CREATE EVENT test.slave_once ON SCHEDULE EVERY 5 MINUTE STARTS CURRENT_TIMESTAMP + INTERVAL 1 HOUR DO
INSERT IGNORE INTO t1(id, c) VALUES (3, 'from slave_once');
Warnings:
Warning 1105 Event scheduler is switched off, use SET GLOBAL event_scheduler=ON to enable it.
"Checking event status on the slave for originator value = slave's server_id"
SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name = 'slave_once';
db name status originator
@@ -80,6 +82,8 @@ db name status originator
"Creating event test.slave_terminate on the slave"
CREATE EVENT test.slave_terminate ON SCHEDULE EVERY 3 SECOND STARTS CURRENT_TIMESTAMP + INTERVAL 1 HOUR DO
INSERT IGNORE INTO t1(id, c) VALUES (6, 'from slave_terminate');
Warnings:
Warning 1105 Event scheduler is switched off, use SET GLOBAL event_scheduler=ON to enable it.
"Checking event status on the slave"
SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name = 'slave_terminate';
db name status originator
@@ -89,6 +93,8 @@ DROP EVENT test.slave_terminate;
"Creating event test.slave_terminate with DISABLE ON SLAVE on the slave"
CREATE EVENT test.slave_terminate ON SCHEDULE EVERY 3 SECOND DISABLE ON SLAVE DO
INSERT IGNORE INTO t1(c) VALUES (7, 'from slave_terminate');
Warnings:
Warning 1105 Event scheduler is switched off, use SET GLOBAL event_scheduler=ON to enable it.
"Checking event status on the slave"
SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name = 'slave_terminate';
db name status originator

View File

@@ -237,6 +237,8 @@ DO
BEGIN
UPDATE test.t1 SET a = a + 1 WHERE a < 10;
END|
Warnings:
Warning 1105 Event scheduler is switched off, use SET GLOBAL event_scheduler=ON to enable it.
connection slave;
RESET SLAVE;
CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_CONNECT_RETRY=20, MASTER_HEARTBEAT_PERIOD=5;

View File

@@ -679,6 +679,8 @@ DROP TRIGGER tr1;
GRANT EVENT ON *.* TO 'root'@'localhost';
INSERT INTO t1 VALUES(1, 'test1');
CREATE EVENT e1 ON SCHEDULE EVERY '1' SECOND COMMENT 'e_second_comment' DO DELETE FROM t1;
Warnings:
Warning 1105 Event scheduler is switched off, use SET GLOBAL event_scheduler=ON to enable it.
SHOW EVENTS;
Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation
test_rpl e1 root@localhost SYSTEM RECURRING NULL 1 # # NULL ENABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci

View File

@@ -50,11 +50,15 @@ BEGIN
ALTER EVENT e1 DISABLE;
CALL p1(10, '');
END|
Warnings:
Warning 1105 Event scheduler is switched off, use SET GLOBAL event_scheduler=ON to enable it.
CREATE EVENT e11 ON SCHEDULE EVERY 1 SECOND DISABLE DO
BEGIN
ALTER EVENT e11 DISABLE;
CALL p11(10, '');
END|
Warnings:
Warning 1105 Event scheduler is switched off, use SET GLOBAL event_scheduler=ON to enable it.
CREATE FUNCTION f1 (x INT) RETURNS VARCHAR(64)
BEGIN
IF x > 5 THEN

View File

@@ -32,6 +32,8 @@ CREATE DATABASE d1;
CREATE EVENT e1
ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 DAY
DO INSERT INTO test.t1 VALUES (1);
Warnings:
Warning 1105 Event scheduler is switched off, use SET GLOBAL event_scheduler=ON to enable it.
CREATE FUNCTION f1 () RETURNS INT DETERMINISTIC
RETURN 1;
CREATE PROCEDURE p1 (OUT rows_cnt INT)

View File

@@ -61,6 +61,8 @@ INSERT INTO tt_1(ddl_case) VALUES (28);
DROP USER 'user_new'@'localhost';
INSERT INTO tt_1(ddl_case) VALUES (27);
CREATE EVENT evt ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 HOUR DO SELECT * FROM tt_1;
Warnings:
Warning 1105 Event scheduler is switched off, use SET GLOBAL event_scheduler=ON to enable it.
INSERT INTO tt_1(ddl_case) VALUES (26);
ALTER EVENT evt COMMENT 'evt';
INSERT INTO tt_1(ddl_case) VALUES (25);

View File

@@ -61,6 +61,8 @@ INSERT INTO tt_1(ddl_case) VALUES (28);
DROP USER 'user_new'@'localhost';
INSERT INTO tt_1(ddl_case) VALUES (27);
CREATE EVENT evt ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 HOUR DO SELECT * FROM tt_1;
Warnings:
Warning 1105 Event scheduler is switched off, use SET GLOBAL event_scheduler=ON to enable it.
INSERT INTO tt_1(ddl_case) VALUES (26);
ALTER EVENT evt COMMENT 'evt';
INSERT INTO tt_1(ddl_case) VALUES (25);

View File

@@ -61,6 +61,8 @@ INSERT INTO tt_1(ddl_case) VALUES (28);
DROP USER 'user_new'@'localhost';
INSERT INTO tt_1(ddl_case) VALUES (27);
CREATE EVENT evt ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 HOUR DO SELECT * FROM tt_1;
Warnings:
Warning 1105 Event scheduler is switched off, use SET GLOBAL event_scheduler=ON to enable it.
INSERT INTO tt_1(ddl_case) VALUES (26);
ALTER EVENT evt COMMENT 'evt';
INSERT INTO tt_1(ddl_case) VALUES (25);

View File

@@ -4,6 +4,8 @@ CREATE TEMPORARY TABLE t1 (a INT);
CREATE TABLE t2 (a INT, b INT) ENGINE= MyISAM;
INSERT INTO t1 VALUES (1);
CREATE EVENT e1 ON SCHEDULE EVERY 10 HOUR DO SELECT 1;
Warnings:
Warning 1105 Event scheduler is switched off, use SET GLOBAL event_scheduler=ON to enable it.
INSERT INTO t1 VALUES (1);
ALTER EVENT e1 ON SCHEDULE EVERY 20 HOUR DO SELECT 1;
INSERT INTO t1 VALUES (1);
@@ -125,6 +127,8 @@ ERROR HY000: Can't execute the given command because you have active locked tabl
INSERT INTO t2 VALUES ("CREATE EVENT e1 with table locked");
UNLOCK TABLE;
CREATE EVENT e2 ON SCHEDULE EVERY 10 HOUR DO SELECT 1;
Warnings:
Warning 1105 Event scheduler is switched off, use SET GLOBAL event_scheduler=ON to enable it.
LOCK TABLE t1 WRITE;
ALTER EVENT e2 ON SCHEDULE EVERY 20 HOUR DO SELECT 1;
ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction

View File

@@ -0,0 +1,28 @@
source include/have_debug_sync.inc;
source include/have_binlog_format_row.inc;
source include/master-slave.inc;
connection slave;
set global debug_dbug='d,rows_log_event_before_open_table';
send set debug_sync='now WAIT_FOR before_open_table';
connection master;
create table t1 (a int);
insert t1 values (1),(2),(3);
connection slave;
reap;
let $a=`select id from information_schema.processlist where state='debug sync point: now'`;
replace_result $a slave_sql_thread;
eval kill $a;
set debug_sync='now SIGNAL go_ahead_sql';
set global debug_dbug='';
set debug_sync='RESET';
connection master;
drop table t1;
connection slave;
start slave;
source include/rpl_end.inc;