Below is the list of changes that have just been committed into a local
5.1 repository of cbell. When cbell does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet@stripped, 2007-03-29 08:17:19-04:00, cbell@mysql_cab_desk. +6 -0
WL#3629 - Replication of Invocation and Invoked Features
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@stripped, 2007-03-29 08:17:12-04:00, cbell@mysql_cab_desk.
+19 -15
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@stripped, 2007-03-29 08:17:13-04:00, cbell@mysql_cab_desk. +50
-44
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@stripped, 2007-03-29 08:17:13-04:00, cbell@mysql_cab_desk. +1
-1
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@stripped, 2007-03-29 08:17:14-04:00, cbell@mysql_cab_desk. +9 -1
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@stripped, 2007-03-29 08:17:14-04:00, cbell@mysql_cab_desk. +4 -3
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@stripped, 2007-03-29 08:17:15-04:00, cbell@mysql_cab_desk. +1 -1
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.
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: cbell
# Host: mysql_cab_desk.
# Root: C:/source/c++/mysql-5.1_WL_3629
--- 1.396/sql/sql_show.cc 2007-03-29 08:17:35 -04:00
+++ 1.397/sql/sql_show.cc 2007-03-29 08:17:35 -04:00
@@ -5447,8 +5447,8 @@
{"CREATED", 0, MYSQL_TYPE_TIMESTAMP, 0, 0, 0},
{"LAST_ALTERED", 0, MYSQL_TYPE_TIMESTAMP, 0, 0, 0},
{"LAST_EXECUTED", 0, MYSQL_TYPE_TIMESTAMP, 0, 1, 0},
- {"ORIGINATOR", 10, MYSQL_TYPE_LONG, 0, 0, "Originator"},
{"EVENT_COMMENT", NAME_LEN, MYSQL_TYPE_STRING, 0, 0, 0},
+ {"ORIGINATOR", 10, MYSQL_TYPE_LONG, 0, 0, "Originator"},
{0, 0, MYSQL_TYPE_STRING, 0, 0, 0}
};
--- 1.27/sql/event_queue.cc 2007-03-29 08:17:35 -04:00
+++ 1.28/sql/event_queue.cc 2007-03-29 08:17:35 -04:00
@@ -197,8 +197,8 @@
DBUG_PRINT("enter", ("thd: 0x%lx et=%s.%s", (long) thd,
new_element->dbname.str, new_element->name.str));
- if (res || new_element->status == Event_queue_element::DISABLED
- || new_element->status == Event_queue_element::SLAVESIDE_DISABLED)
+ if ((new_element->status == Event_queue_element::DISABLED)
+ || (new_element->status == Event_queue_element::SLAVESIDE_DISABLED))
delete new_element;
else
{
@@ -234,7 +234,8 @@
DBUG_ENTER("Event_queue::update_event");
DBUG_PRINT("enter", ("thd: 0x%lx et=[%s.%s]", (long) thd, dbname.str, name.str));
- if (new_element->status == Event_queue_element::DISABLED)
+ if ((new_element->status == Event_queue_element::DISABLED) ||
+ (new_element->status == Event_queue_element::SLAVESIDE_DISABLED))
{
DBUG_PRINT("info", ("The event is disabled."));
/*
--- 1.88/sql/event_data_objects.cc 2007-03-29 08:17:35 -04:00
+++ 1.89/sql/event_data_objects.cc 2007-03-29 08:17:35 -04:00
@@ -658,7 +658,8 @@
(thd->system_thread == SYSTEM_THREAD_SLAVE_IO))
{
DBUG_PRINT("info", ("Invoked object status set to SLAVESIDE_DISABLED."));
- if (status == Event_basic::ENABLED)
+ if ((status == Event_basic::ENABLED) ||
+ (status == Event_basic::DISABLED))
status = Event_basic::SLAVESIDE_DISABLED;
originator = thd->server_id;
}
@@ -1589,6 +1590,13 @@
fields[ET_FIELD_STATUS]->store((longlong)status, TRUE);
status_changed= FALSE;
}
+
+ /*
+ Turn off row binlogging of event timing updates. These are not used
+ for RBR of events replicated to the slave.
+ */
+ if (thd->current_stmt_binlog_row_based)
+ thd->clear_current_stmt_binlog_row_based();
if ((table->file->ha_update_row(table->record[1], table->record[0])))
ret= TRUE;
--- 1.1/mysql-test/include/rpl_events.inc 2007-03-29 08:17:35 -04:00
+++ 1.2/mysql-test/include/rpl_events.inc 2007-03-29 08:17:35 -04:00
@@ -6,7 +6,7 @@
##################################################################
--disable_warnings
-DROP EVENT IF EXISTS justonce;
+DROP EVENT IF EXISTS test.justonce;
drop table if exists t1,t2;
--enable_warnings
@@ -23,9 +23,11 @@
INSERT INTO t1 (c) VALUES ('manually');
# then, we create the event
-CREATE EVENT justonce ON SCHEDULE AT NOW() + INTERVAL 2 SECOND DO INSERT INTo t1
+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';
+
# wait 3 seconds, so the event can trigger
--real_sleep 3
@@ -37,7 +39,6 @@
--disable_info
sync_slave_with_master;
-connection slave;
--echo "in the slave"
--enable_info
@@ -45,6 +46,8 @@
SELECT * FROM t1;
--disable_info
+SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name =
'justonce';
+
# Create an event on the slave and check to see what the originator is.
--disable_warnings
DROP EVENT IF EXISTS test.slave_once;
@@ -52,7 +55,7 @@
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;
+SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name =
'slave_once';
--disable_warnings
DROP EVENT IF EXISTS test.slave_once;
@@ -61,39 +64,40 @@
connection master;
# BUG#20384 - disable events on slave
+--disable_warnings
DROP EVENT IF EXISTS test.justonce;
+--enable_warnings
+
CREATE EVENT test.er ON SCHEDULE EVERY 3 SECOND DO
INSERT INTO t1(c) VALUES ('from er');
-SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name = 'er';
+SELECT db, name, status, originator, body FROM mysql.event WHERE db = 'test' AND name =
'er';
sync_slave_with_master;
-connection slave;
+
--echo "in the slave"
-SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name = 'er';
+SELECT db, name, status, originator, body FROM mysql.event WHERE db = 'test' AND name =
'er';
connection master;
--echo "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 FROM mysql.event WHERE db = 'test' AND name = 'er';
+SELECT db, name, status, originator, body FROM mysql.event WHERE db = 'test' AND name =
'er';
sync_slave_with_master;
-connection slave;
+
--echo "in the slave"
-SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name = 'er';
+SELECT db, name, status, originator, body FROM mysql.event WHERE db = 'test' AND name =
'er';
connection master;
--echo "in the master"
DROP EVENT test.er;
---replace column 8 DATETIME
-SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name = 'er';
+SELECT db, name, status, originator FROM mysql.event WHERE db = 'test';
--disable_info
sync_slave_with_master;
-connection slave;
+
--echo "in the slave"
---replace column 8 DATETIME
-SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name = 'er';
+SELECT db, name, status, originator FROM mysql.event WHERE db = 'test';
--echo "in the master"
connection master;
--- 1.1/mysql-test/r/rpl_events.result 2007-03-29 08:17:35 -04:00
+++ 1.2/mysql-test/r/rpl_events.result 2007-03-29 08:17:35 -04:00
@@ -6,7 +6,7 @@
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
set binlog_format=row;
-DROP EVENT IF EXISTS justonce;
+DROP EVENT IF EXISTS test.justonce;
drop table if exists t1,t2;
CREATE TABLE `t1` (
`id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
@@ -16,8 +16,11 @@
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
INSERT INTO t1 (c) VALUES ('manually');
-CREATE EVENT justonce ON SCHEDULE AT NOW() + INTERVAL 2 SECOND DO INSERT INTo t1
+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
@@ -30,46 +33,46 @@
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;
+SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name =
'slave_once';
db name status originator
-test justonce SLAVESIDE_DISABLED 1
test slave_once ENABLED 2
DROP EVENT IF EXISTS test.slave_once;
DROP EVENT IF EXISTS test.justonce;
-Warnings:
-Note 1305 Event justonce does not exist
CREATE EVENT test.er ON SCHEDULE EVERY 3 SECOND DO
INSERT INTO t1(c) VALUES ('from er');
-SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name = 'er';
-db name status originator
-test er ENABLED 1
-"in the slave"
-SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name = 'er';
-db name status originator
-test er SLAVESIDE_DISABLED 1
+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 FROM mysql.event WHERE db = 'test' AND name = 'er';
-db name status originator
-test er ENABLED 1
-"in the slave"
-SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name = 'er';
-db name status originator
-test er SLAVESIDE_DISABLED 1
+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' AND name = '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' AND name = 'er';
+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 justonce;
+DROP EVENT IF EXISTS test.justonce;
drop table if exists t1,t2;
CREATE TABLE `t1` (
`id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
@@ -79,8 +82,11 @@
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
INSERT INTO t1 (c) VALUES ('manually');
-CREATE EVENT justonce ON SCHEDULE AT NOW() + INTERVAL 2 SECOND DO INSERT INTo t1
+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
@@ -93,41 +99,41 @@
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;
+SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name =
'slave_once';
db name status originator
-test justonce SLAVESIDE_DISABLED 1
test slave_once ENABLED 2
DROP EVENT IF EXISTS test.slave_once;
DROP EVENT IF EXISTS test.justonce;
-Warnings:
-Note 1305 Event justonce does not exist
CREATE EVENT test.er ON SCHEDULE EVERY 3 SECOND DO
INSERT INTO t1(c) VALUES ('from er');
-SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name = 'er';
-db name status originator
-test er ENABLED 1
-"in the slave"
-SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name = 'er';
-db name status originator
-test er SLAVESIDE_DISABLED 1
+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 FROM mysql.event WHERE db = 'test' AND name = 'er';
-db name status originator
-test er ENABLED 1
-"in the slave"
-SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name = 'er';
-db name status originator
-test er SLAVESIDE_DISABLED 1
+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' AND name = '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' AND name = 'er';
+SELECT db, name, status, originator FROM mysql.event WHERE db = 'test';
db name status originator
"in the master"
DROP TABLE t1;
--- 1.5/scripts/mysql_system_tables.sql 2007-03-29 08:17:35 -04:00
+++ 1.6/scripts/mysql_system_tables.sql 2007-03-29 08:17:35 -04:00
@@ -70,7 +70,7 @@
DROP PROCEDURE create_slow_log_table;
-CREATE TABLE IF NOT EXISTS event ( db char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT
NULL default '', name char(64) CHARACTER SET utf8 NOT NULL default '', body longblob NOT
NULL, definer char(77) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '',
execute_at DATETIME default NULL, interval_value int(11) default NULL, interval_field
ENUM('YEAR','QUARTER','MONTH','DAY','HOUR','MINUTE','WEEK','SECOND','MICROSECOND','YEAR_MONTH','DAY_HOUR','DAY_MINUTE','DAY_SECOND','HOUR_MINUTE','HOUR_SECOND','MINUTE_SECOND','DAY_MICROSECOND','HOUR_MICROSECOND','MINUTE_MICROSECOND','SECOND_MICROSECOND')
default NULL, created TIMESTAMP NOT NULL, modified TIMESTAMP NOT NULL, last_executed
DATETIME default NULL, starts DATETIME default NULL, ends DATETIME default NULL, status
ENUM('ENABLED','DISABLED') NOT NULL default 'ENABLED', on_completion
ENUM('DROP','PRESERVE') NOT NULL default 'DROP', sql_mode
set('REAL_AS_FLOAT','PIPES_AS_CONCAT','ANSI_QUOTES','IGNORE_SPACE','NOT_USED','ONLY_FULL_!
GROUP_BY','NO_UNSIGNED_SUBTRACTION','NO_DIR_IN_CREATE','POSTGRESQL','ORACLE','MSSQL','DB2','MAXDB','NO_KEY_OPTIONS','NO_TABLE_OPTIONS','NO_FIELD_OPTIONS','MYSQL323','MYSQL40','ANSI','NO_AUTO_VALUE_ON_ZERO','NO_BACKSLASH_ESCAPES','STRICT_TRANS_TABLES','STRICT_ALL_TABLES','NO_ZERO_IN_DATE','NO_ZERO_DATE','INVALID_DATES','ERROR_FOR_DIVISION_BY_ZERO','TRADITIONAL','NO_AUTO_CREATE_USER','HIGH_NOT_PRECEDENCE')
DEFAULT '' NOT NULL, comment char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default
'', PRIMARY KEY (db, name) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT 'Events';
+CREATE TABLE IF NOT EXISTS event ( db char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT
NULL default '', name char(64) CHARACTER SET utf8 NOT NULL default '', body longblob NOT
NULL, definer char(77) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '',
execute_at DATETIME default NULL, interval_value int(11) default NULL, interval_field
ENUM('YEAR','QUARTER','MONTH','DAY','HOUR','MINUTE','WEEK','SECOND','MICROSECOND','YEAR_MONTH','DAY_HOUR','DAY_MINUTE','DAY_SECOND','HOUR_MINUTE','HOUR_SECOND','MINUTE_SECOND','DAY_MICROSECOND','HOUR_MICROSECOND','MINUTE_MICROSECOND','SECOND_MICROSECOND')
default NULL, created TIMESTAMP NOT NULL, modified TIMESTAMP NOT NULL, last_executed
DATETIME default NULL, starts DATETIME default NULL, ends DATETIME default NULL, status
ENUM('ENABLED','DISABLED','SLAVESIDE_DISABLED') NOT NULL default 'ENABLED', on_completion
ENUM('DROP','PRESERVE') NOT NULL default 'DROP', sql_mode
set('REAL_AS_FLOAT','PIPES_AS_CONCAT','ANSI_QUOTES','IGNORE_SPACE','!
NOT_USED','ONLY_FULL_GROUP_BY','NO_UNSIGNED_SUBTRACTION','NO_DIR_IN_CREATE','POSTGRESQL','ORACLE','MSSQL','DB2','MAXDB','NO_KEY_OPTIONS','NO_TABLE_OPTIONS','NO_FIELD_OPTIONS','MYSQL323','MYSQL40','ANSI','NO_AUTO_VALUE_ON_ZERO','NO_BACKSLASH_ESCAPES','STRICT_TRANS_TABLES','STRICT_ALL_TABLES','NO_ZERO_IN_DATE','NO_ZERO_DATE','INVALID_DATES','ERROR_FOR_DIVISION_BY_ZERO','TRADITIONAL','NO_AUTO_CREATE_USER','HIGH_NOT_PRECEDENCE')
DEFAULT '' NOT NULL, comment char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default
'', originator int(10) NOT NULL, PRIMARY KEY (db, name) ) ENGINE=MyISAM DEFAULT
CHARSET=utf8 COMMENT 'Events';
CREATE TABLE IF NOT EXISTS ndb_binlog_index (Position BIGINT UNSIGNED NOT NULL, File
VARCHAR(255) NOT NULL, epoch BIGINT UNSIGNED NOT NULL, inserts BIGINT UNSIGNED NOT NULL,
updates BIGINT UNSIGNED NOT NULL, deletes BIGINT UNSIGNED NOT NULL, schemaops BIGINT
UNSIGNED NOT NULL, PRIMARY KEY(epoch)) ENGINE=MYISAM;
| Thread |
|---|
| • bk commit into 5.1 tree (cbell:1.2482) | cbell | 29 Mar |