mirror of
https://github.com/MariaDB/server.git
synced 2025-01-21 06:22:28 +01:00
75686dc73f
This patch corrects errors that occurred in a local manual merge as a result of updating the local repository and includes changes necessary to correct problems found during the recalculation of next execution of events in RBR. mysql-test/include/rpl_events.inc: WL#3629 - Replication of Invocation and Invoked Features This patch changes the rpl_events test to be more comprehensive in catching errors as a result of RBR. Changes include clarification of SELECTs with WHERE clauses and synchronization with master and slave. mysql-test/r/rpl_events.result: WL#3629 - Replication of Invocation and Invoked Features This patch changes the results for the rpl_events test to accomodate the changes in the test. scripts/mysql_system_tables.sql: WL#3629 - Replication of Invocation and Invoked Features This patch adds the originator column and a new enum value to the mysql.event table. This change was necessary to accomodate changes as a result of other patches. sql/event_data_objects.cc: WL#3629 - Replication of Invocation and Invoked Features This patch corrects an error in merging that occurred during manual merge. The status check was changed to include either ENABLED or DISABLED in the gate to change the status to SLAVESIDE_DISABLED for events replicated to the slave. This patch also includes an update to correct a problem encountered during testing after the local merge. The update_timing_fields method is replicating the timing changes in RBR to the slave thereby over writing the change to the status column in the process. This code includes a check to turn off the next binlog event if in RBR. sql/event_queue.cc: WL#3629 - Replication of Invocation and Invoked Features This patch corrects an error in merging that occurred during manual merge. The code was corrected to include both types of disabled status enums (DISABLED, SLAVESIDE_DISABLED) in the create_event and update_event methods. sql/sql_show.cc: WL#3629 - Replication of Invocation and Invoked Features This patch corrects an error in merging that occurred during manual merge. It corrects the order in which the originator column appears in the show structures. The error caused incorrect output on SHOW EVENTS commands.
139 lines
5.3 KiB
Text
139 lines
5.3 KiB
Text
set global event_scheduler=1;
|
|
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;
|
|
set binlog_format=row;
|
|
DROP EVENT IF EXISTS test.justonce;
|
|
drop table if exists t1,t2;
|
|
CREATE TABLE `t1` (
|
|
`id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
|
|
`c` VARCHAR(50) NOT NULL,
|
|
`ts` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE
|
|
CURRENT_TIMESTAMP,
|
|
PRIMARY KEY (`id`)
|
|
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
|
INSERT INTO t1 (c) VALUES ('manually');
|
|
CREATE EVENT test.justonce ON SCHEDULE AT NOW() + INTERVAL 2 SECOND DO INSERT INTO t1
|
|
(c) VALUES ('from justonce');
|
|
SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name = 'justonce';
|
|
db name status originator
|
|
test justonce ENABLED 1
|
|
"in the master"
|
|
SELECT * FROM t1;
|
|
id c ts
|
|
1 manually TIMESTAMP
|
|
2 from justonce TIMESTAMP
|
|
affected rows: 2
|
|
"in the slave"
|
|
SELECT * FROM t1;
|
|
id c ts
|
|
1 manually TIMESTAMP
|
|
2 from justonce TIMESTAMP
|
|
affected rows: 2
|
|
SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name = 'justonce';
|
|
db name status originator
|
|
test justonce SLAVESIDE_DISABLED 1
|
|
DROP EVENT IF EXISTS test.slave_once;
|
|
CREATE EVENT test.slave_once ON SCHEDULE EVERY 5 MINUTE DO
|
|
INSERT INTO t1(c) VALUES ('from slave_once');
|
|
SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name = 'slave_once';
|
|
db name status originator
|
|
test slave_once ENABLED 2
|
|
DROP EVENT IF EXISTS test.slave_once;
|
|
DROP EVENT IF EXISTS test.justonce;
|
|
CREATE EVENT test.er ON SCHEDULE EVERY 3 SECOND DO
|
|
INSERT INTO t1(c) VALUES ('from er');
|
|
SELECT db, name, status, originator, body FROM mysql.event WHERE db = 'test' AND name = 'er';
|
|
db name status originator body
|
|
test er ENABLED 1 INSERT INTO t1(c) VALUES ('from er')
|
|
"in the slave"
|
|
SELECT db, name, status, originator, body FROM mysql.event WHERE db = 'test' AND name = 'er';
|
|
db name status originator body
|
|
test er SLAVESIDE_DISABLED 1 INSERT INTO t1(c) VALUES ('from er')
|
|
"in the master"
|
|
ALTER EVENT test.er ON SCHEDULE EVERY 5 SECOND DO INSERT into t1(c) VALUES ('from alter er');
|
|
SELECT db, name, status, originator, body FROM mysql.event WHERE db = 'test' AND name = 'er';
|
|
db name status originator body
|
|
test er ENABLED 1 INSERT into t1(c) VALUES ('from alter er')
|
|
"in the slave"
|
|
SELECT db, name, status, originator, body FROM mysql.event WHERE db = 'test' AND name = 'er';
|
|
db name status originator body
|
|
test er SLAVESIDE_DISABLED 1 INSERT into t1(c) VALUES ('from alter er')
|
|
"in the master"
|
|
DROP EVENT test.er;
|
|
SELECT db, name, status, originator FROM mysql.event WHERE db = 'test';
|
|
db name status originator
|
|
"in the slave"
|
|
SELECT db, name, status, originator FROM mysql.event WHERE db = 'test';
|
|
db name status originator
|
|
"in the master"
|
|
DROP TABLE t1;
|
|
set binlog_format=statement;
|
|
DROP EVENT IF EXISTS test.justonce;
|
|
drop table if exists t1,t2;
|
|
CREATE TABLE `t1` (
|
|
`id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
|
|
`c` VARCHAR(50) NOT NULL,
|
|
`ts` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE
|
|
CURRENT_TIMESTAMP,
|
|
PRIMARY KEY (`id`)
|
|
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
|
INSERT INTO t1 (c) VALUES ('manually');
|
|
CREATE EVENT test.justonce ON SCHEDULE AT NOW() + INTERVAL 2 SECOND DO INSERT INTO t1
|
|
(c) VALUES ('from justonce');
|
|
SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name = 'justonce';
|
|
db name status originator
|
|
test justonce ENABLED 1
|
|
"in the master"
|
|
SELECT * FROM t1;
|
|
id c ts
|
|
1 manually TIMESTAMP
|
|
2 from justonce TIMESTAMP
|
|
affected rows: 2
|
|
"in the slave"
|
|
SELECT * FROM t1;
|
|
id c ts
|
|
1 manually TIMESTAMP
|
|
2 from justonce TIMESTAMP
|
|
affected rows: 2
|
|
SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name = 'justonce';
|
|
db name status originator
|
|
test justonce SLAVESIDE_DISABLED 1
|
|
DROP EVENT IF EXISTS test.slave_once;
|
|
CREATE EVENT test.slave_once ON SCHEDULE EVERY 5 MINUTE DO
|
|
INSERT INTO t1(c) VALUES ('from slave_once');
|
|
SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name = 'slave_once';
|
|
db name status originator
|
|
test slave_once ENABLED 2
|
|
DROP EVENT IF EXISTS test.slave_once;
|
|
DROP EVENT IF EXISTS test.justonce;
|
|
CREATE EVENT test.er ON SCHEDULE EVERY 3 SECOND DO
|
|
INSERT INTO t1(c) VALUES ('from er');
|
|
SELECT db, name, status, originator, body FROM mysql.event WHERE db = 'test' AND name = 'er';
|
|
db name status originator body
|
|
test er ENABLED 1 INSERT INTO t1(c) VALUES ('from er')
|
|
"in the slave"
|
|
SELECT db, name, status, originator, body FROM mysql.event WHERE db = 'test' AND name = 'er';
|
|
db name status originator body
|
|
test er SLAVESIDE_DISABLED 1 INSERT INTO t1(c) VALUES ('from er')
|
|
"in the master"
|
|
ALTER EVENT test.er ON SCHEDULE EVERY 5 SECOND DO INSERT into t1(c) VALUES ('from alter er');
|
|
SELECT db, name, status, originator, body FROM mysql.event WHERE db = 'test' AND name = 'er';
|
|
db name status originator body
|
|
test er ENABLED 1 INSERT into t1(c) VALUES ('from alter er')
|
|
"in the slave"
|
|
SELECT db, name, status, originator, body FROM mysql.event WHERE db = 'test' AND name = 'er';
|
|
db name status originator body
|
|
test er SLAVESIDE_DISABLED 1 INSERT into t1(c) VALUES ('from alter er')
|
|
"in the master"
|
|
DROP EVENT test.er;
|
|
SELECT db, name, status, originator FROM mysql.event WHERE db = 'test';
|
|
db name status originator
|
|
"in the slave"
|
|
SELECT db, name, status, originator FROM mysql.event WHERE db = 'test';
|
|
db name status originator
|
|
"in the master"
|
|
DROP TABLE t1;
|