mariadb/mysql-test/suite/rpl/t/rpl_parallel_charset.test
unknown 010971a761 MDEV-6156: Parallel replication incorrectly caches charset between worker threads
Replication caches the character sets used in a query, to be able to quickly
reuse them for the next query in the common case of them not having changed.

In parallel replication, this caching needs to be per-worker-thread. The
code was not modified to handle this correctly, so the caching in one worker
could cause another worker to run a query using the wrong character set,
causing replication corruption.
2014-04-23 16:06:06 +02:00

56 lines
2 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/have_binlog_format_statement.inc
--let $rpl_topology=1->2
--source include/rpl_init.inc
--echo *** MDEV-6156: Parallel replication incorrectly caches charset between worker threads ***
--connection server_2
SET @old_parallel_threads=@@GLOBAL.slave_parallel_threads;
--source include/stop_slave.inc
SET GLOBAL slave_parallel_threads=5;
--source include/start_slave.inc
--connection server_1
CREATE TABLE t1 (a INT PRIMARY KEY, b VARCHAR(100) CHARACTER SET utf8);
SHOW CREATE TABLE t1;
SET character_set_client=latin1;
INSERT INTO t1 VALUES (1, 'Rødgrød med fløde 1');
INSERT INTO t1 VALUES (2, 'Rødgrød med fløde 2');
INSERT INTO t1 VALUES (3, 'Rødgrød med fløde 3');
INSERT INTO t1 VALUES (4, 'Rødgrød med fløde 4');
INSERT INTO t1 VALUES (5, 'Rødgrød med fløde 5');
INSERT INTO t1 VALUES (6, 'Rødgrød med fløde 6');
INSERT INTO t1 VALUES (7, 'Rødgrød med fløde 7');
INSERT INTO t1 VALUES (8, 'Rødgrød med fløde 8');
INSERT INTO t1 VALUES (9, 'Rødgrød med fløde 9');
INSERT INTO t1 VALUES (10, 'Rødgrød med fløde 10');
SET character_set_client=utf8;
INSERT INTO t1 VALUES (11, 'Rødgrød med fløde 1');
INSERT INTO t1 VALUES (12, 'Rødgrød med fløde 2');
INSERT INTO t1 VALUES (13, 'Rødgrød med fløde 3');
INSERT INTO t1 VALUES (14, 'Rødgrød med fløde 4');
INSERT INTO t1 VALUES (15, 'Rødgrød med fløde 5');
INSERT INTO t1 VALUES (16, 'Rødgrød med fløde 6');
INSERT INTO t1 VALUES (17, 'Rødgrød med fløde 7');
INSERT INTO t1 VALUES (18, 'Rødgrød med fløde 8');
INSERT INTO t1 VALUES (19, 'Rødgrød med fløde 9');
INSERT INTO t1 VALUES (20, 'Rødgrød med fløde 10');
SET character_set_results=utf8;
SELECT * FROM t1 ORDER BY a;
--save_master_pos
--connection server_2
--sync_with_master
SET character_set_results=utf8;
SELECT * FROM t1 ORDER BY a;
--connection server_2
--source include/stop_slave.inc
SET GLOBAL slave_parallel_threads=@old_parallel_threads;
--source include/start_slave.inc
--connection server_1
DROP TABLE t1;
--source include/rpl_end.inc