Below is the list of changes that have just been committed into a local
5.0 repository of guilhem. When guilhem 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
1.1969 05/11/14 16:58:18 guilhem@stripped +2 -0
Fix for BUG#14698 "RBR: rpl_row_trig003 fails" which was in fact two problems:
* open_tables() reads the content of thd->lex so lex_start() is needed in
Table_map_log_event::exec_event (Valgrind error)
* TIMESTAMP_NO_AUTO_SET is needed when executing a Rows_log_event; otherwise the slave
does not use
the provided data to fill a TIMESTAMP column and uses the event's timestamp instead.
sql/log_event.cc
1.222 05/11/14 16:54:38 guilhem@stripped +32 -0
* open_tables() reads the content of thd->lex so lex_start() is needed in
Table_map_log_event::exec_event (Valgrind error)
* TIMESTAMP_NO_AUTO_SET is needed when executing a Rows_log_event; otherwise the slave
does not use
the provided data to fill a TIMESTAMP column and uses the event's timestamp instead
(which made rpl_row_trig003
fail sometimes, when the machine was slow).
mysql-test/t/rpl_row_trig003.test
1.8 05/11/14 16:54:38 guilhem@stripped +4 -0
a sleep to force the bug to be repeatable
# 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: guilhem
# Host: gbichot3.local
# Root: /home/mysql_src/mysql-5.0-wl1012
--- 1.221/sql/log_event.cc 2005-11-07 16:28:22 +01:00
+++ 1.222/sql/log_event.cc 2005-11-14 16:54:38 +01:00
@@ -5267,6 +5267,15 @@
}
/*
+ It's not needed to set_time() but
+ 1) it continues the property that "Time" in SHOW PROCESSLIST shows how
+ much slave is behind
+ 2) it will be needed when we allow replication from a table with no
+ TIMESTAMP column to a table with one.
+ So we call set_time(), like in SBR. Presently it changes nothing.
+ */
+ thd->set_time((time_t)when);
+ /*
There are a few flags that are replicated with each row event.
Make sure to set/clear them before executing the main body of
the event.
@@ -5687,6 +5696,12 @@
uint count;
if (find_tables(thd, &table_list, &count) == 0)
{
+ /*
+ open_tables() reads the contents of thd->lex, so they must be
+ initialized, so we should call lex_start(); to be even safer, we call
+ mysql_init_query() which does a more complete set of inits.
+ */
+ mysql_init_query(thd, NULL, 0);
TABLE_LIST *tables= &table_list;
if ((error= open_tables(thd, &tables, &count, 0)))
{
@@ -5956,6 +5971,22 @@
from the start.
*/
table->file->start_bulk_insert(0);
+ /*
+ We need TIMESTAMP_NO_AUTO_SET otherwise ha_write_row() will not use fill
+ any TIMESTAMP column with data from the row but instead will use
+ the event's current time.
+ As we replicate from TIMESTAMP to TIMESTAMP and slave has no extra
+ columns, we know that all TIMESTAMP columns on slave will receive explicit
+ data from the row, so TIMESTAMP_NO_AUTO_SET is ok.
+ When we allow a table without TIMESTAMP to be replicated to a table having
+ more columns including a TIMESTAMP column, or when we allow a TIMESTAMP
+ column to be replicated into a BIGINT column and the slave's table has a
+ TIMESTAMP column, then the slave's TIMESTAMP column will take its value
+ from set_time() which we called earlier (consistent with SBR). And then in
+ some cases we won't want TIMESTAMP_NO_AUTO_SET (will require some code to
+ analyze if explicit data is provided for slave's TIMESTAMP columns).
+ */
+ table->timestamp_field_type= TIMESTAMP_NO_AUTO_SET;
return error;
}
@@ -6522,6 +6553,7 @@
/* We doesn't have a key: search the table using rnd_next() */
error= table->file->ha_rnd_init(1);
}
+ table->timestamp_field_type= TIMESTAMP_NO_AUTO_SET;
return error;
}
--- 1.7/mysql-test/t/rpl_row_trig003.test 2005-10-26 19:50:55 +02:00
+++ 1.8/mysql-test/t/rpl_row_trig003.test 2005-11-14 16:54:38 +01:00
@@ -108,6 +108,10 @@
INSERT INTO test.t1 VALUES(NULL,1,'add some more test data test.', 'and hope for the
best', 3.321,5.221,0,YEAR(NOW()),NOW());
+# To make sure BUG#14698 is gone, we sleep 2 seconds before calling trigger
+# (with the bug in, that caused differences in TIMESTAMP columns)
+sleep 2;
+
DELETE FROM test.t1 WHERE id = 1;
DELETE FROM test.t2 WHERE id = 1;
| Thread |
|---|
| • bk commit into 5.0 tree (guilhem:1.1969) BUG#14698 | guilhem | 14 Nov |