mariadb/mysql-test/t/rpl_ignore_table.test
unknown c755a7a1c4 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.


mysql-test/r/rpl_ignore_table.result:
  Adding test case
mysql-test/t/rpl_ignore_table-slave.opt:
  Don't replicate tables with names starting with "tmptbl"
mysql-test/t/rpl_ignore_table.test:
  Adding test case
sql/sql_parse.cc:
  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.
2006-11-01 12:30:01 +04:00

51 lines
1.3 KiB
Text
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

source include/master-slave.inc;
#
# BUG#16487
#
# Requirement:
# Multi-updates on ignored tables should not fail even if the slave does
# not have the ignored tables.
#
# Note table t1, t2, and t3 are ignored in the option file to this test.
#
--echo **** Test case for BUG#16487 ****
--echo **** Master ****
connection master;
CREATE TABLE test.t4 (a int);
CREATE TABLE test.t1 (a int);
# Expect: The row must *not* by updated on slave, since t1 is ignored
UPDATE test.t4 NATURAL JOIN test.t1 SET t1.a=5;
--echo **** Slave ****
sync_slave_with_master;
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;