From: Date: November 1 2006 9:30am Subject: bk commit into 5.0 tree (bar:1.2299) BUG#22877 List-Archive: http://lists.mysql.com/commits/14651 X-Bug: 22877 Message-Id: <200611010830.kA18UAwQ028267@bar.intranet.mysql.r18.ru> Below is the list of changes that have just been committed into a local 5.0 repository of bar. When bar 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, 2006-11-01 12:30:01+04:00, bar@stripped +5 -0 Bug#22877 replication character sets get out of sync using replicate-wild-ignore-table Problem: changes in character set variables before an action on an replication-ignored table makes slave to forget new variable values. Fix: initialize one_shot variables only when 4.1 -> 5.x replication is running. BitKeeper/etc/collapsed@stripped, 2006-10-24 15:16:59+05:00, bar@stripped +1 -0 mysql-test/r/rpl_ignore_table.result@stripped, 2006-11-01 12:29:55+04:00, bar@stripped +16 -0 Adding test case mysql-test/t/rpl_ignore_table-slave.opt@stripped, 2006-11-01 12:29:55+04:00, bar@stripped +1 -1 Don't replicate tables with names starting with "tmptbl" mysql-test/t/rpl_ignore_table.test@stripped, 2006-11-01 12:29:55+04:00, bar@stripped +23 -0 Adding test case sql/sql_parse.cc@stripped, 2006-11-01 12:29:56+04:00, bar@stripped +17 -1 Reset one_shot variables only if we do 4.1->5.x replication. In other cases we cannot do that: resetting thd->variables out of sync with st_relay_log_info::cached_charset, which makes st_relay_log_info::cached_charset_compare() not to notice character set related variables changes afterwards. # 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: bar # Host: bar.intranet.mysql.r18.ru # Root: /usr/home/bar/mysql-5.0.b22877 --- 1.580/sql/sql_parse.cc 2006-11-01 12:30:10 +04:00 +++ 1.581/sql/sql_parse.cc 2006-11-01 12:30:10 +04:00 @@ -2480,7 +2480,23 @@ mysql_execute_command(THD *thd) { /* we warn the slave SQL thread */ my_message(ER_SLAVE_IGNORED_TABLE, ER(ER_SLAVE_IGNORED_TABLE), MYF(0)); - reset_one_shot_variables(thd); + if (thd->one_shot_set) + { + /* + It's ok to check thd->one_shot_set here: + + The charsets in a MySQL 5.0 slave can change by both a binlogged + SET ONE_SHOT statement and the event-internal charset setting, + and these two ways to change charsets do not seems to work + together. + + At least there seems to be problems in the rli cache for + charsets if we are using ONE_SHOT. Note that this is normally no + problem because either the >= 5.0 slave reads a 4.1 binlog (with + ONE_SHOT) *or* or 5.0 binlog (without ONE_SHOT) but never both." + */ + reset_one_shot_variables(thd); + } DBUG_RETURN(0); } } --- 1.1/mysql-test/r/rpl_ignore_table.result 2006-11-01 12:30:10 +04:00 +++ 1.2/mysql-test/r/rpl_ignore_table.result 2006-11-01 12:30:10 +04:00 @@ -14,3 +14,19 @@ SELECT * FROM t4; a DROP TABLE t1; DROP TABLE t4; +DROP TABLE IF EXISTS t5; +CREATE TABLE t5 ( +word varchar(50) collate utf8_unicode_ci NOT NULL default '' +) DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +SET @@session.character_set_client=33,@@session.collation_connection=192; +CREATE TEMPORARY TABLE tmptbl504451f4258$1 (id INT NOT NULL) ENGINE=MEMORY; +INSERT INTO t5 (word) VALUES ('TEST’'); +SELECT HEX(word) FROM t5; +HEX(word) +54455354E28099 +SELECT HEX(word) FROM t5; +HEX(word) +54455354E28099 +SELECT * FROM tmptbl504451f4258$1; +ERROR 42S02: Table 'test.tmptbl504451f4258$1' doesn't exist +DROP TABLE t5; --- 1.1/mysql-test/t/rpl_ignore_table-slave.opt 2006-11-01 12:30:10 +04:00 +++ 1.2/mysql-test/t/rpl_ignore_table-slave.opt 2006-11-01 12:30:10 +04:00 @@ -1 +1 @@ ---replicate-ignore-table=test.t1 --replicate-ignore-table=test.t2 --replicate-ignore-table=test.t3 +--replicate-ignore-table=test.t1 --replicate-ignore-table=test.t2 --replicate-ignore-table=test.t3 --replicate-wild-ignore-table=%.tmptbl% --- 1.1/mysql-test/t/rpl_ignore_table.test 2006-11-01 12:30:10 +04:00 +++ 1.2/mysql-test/t/rpl_ignore_table.test 2006-11-01 12:30:10 +04:00 @@ -26,3 +26,26 @@ SELECT * FROM t4; connection master; DROP TABLE t1; DROP TABLE t4; + + +# +# bug#22877 replication character sets get out of sync +# using replicate-wild-ignore-table +# +--disable_warnings +DROP TABLE IF EXISTS t5; +--enable_warnings +CREATE TABLE t5 ( + word varchar(50) collate utf8_unicode_ci NOT NULL default '' +) DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +SET @@session.character_set_client=33,@@session.collation_connection=192; +CREATE TEMPORARY TABLE tmptbl504451f4258$1 (id INT NOT NULL) ENGINE=MEMORY; +INSERT INTO t5 (word) VALUES ('TEST’'); +SELECT HEX(word) FROM t5; +sync_slave_with_master; +connection slave; +SELECT HEX(word) FROM t5; +--error 1146 +SELECT * FROM tmptbl504451f4258$1; +connection master; +DROP TABLE t5; --- 1.5/BitKeeper/etc/collapsed 2006-11-01 12:30:10 +04:00 +++ 1.6/BitKeeper/etc/collapsed 2006-11-01 12:30:10 +04:00 @@ -3,3 +3,4 @@ 44edb86b1iE5knJ97MbliK_3lCiAXA 44f33f3aj5KW5qweQeekY1LU0E9ZCg 4513d8e4Af4dQWuk13sArwofRgFDQw +4538a7b0EbDHHkWPbIwxO6ZIDdg6Dg