Bug #3943 Queries with non-ASCII literals are not replicated properly after SET NAMES
Submitted: 31 May 2004 19:13 Modified: 3 Jun 2004 23:40
Reporter: Sergey Petrunya Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Replication Severity:S2 (Serious)
Version:4.1 OS:
Assigned to: CPU Architecture:Any

[31 May 2004 19:13] Sergey Petrunya
Description:
See the test case below.

How to repeat:
Create the following .test file:
source include/master-slave.inc;

DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (c1 VARBINARY(255), c2 VARBINARY(255));
SET CHARACTER_SET_CLIENT=koi8r,
 CHARACTER_SET_CONNECTION=cp1251, 
 CHARACTER_SET_RESULTS=koi8r;

INSERT INTO t1 (c1, c2) VALUES ('îÕ, ÚÁ ÒÙÂÁÌËÕ','îÕ, ÚÁ ÒÙÂÁÌËÕ');

select 'on the master:' see;
select hex(c1), hex(c2) from t1;

save_master_pos;
connection slave;
sync_with_master;

select 'on the slave:' see;
select hex(c1), hex(c2) from t1;

connection master;
drop table t1;

save_master_pos;
connection slave;
sync_with_master;
stop slave;

---end of file---
Run it and in result file see that the values are different on the master and on the slave:
...
on the master:
select hex(c1), hex(c2) from t1;
hex(c1)	hex(c2)
CDF32C20E7E020F0FBE1E0EBEAF3	CDF32C20E7E020F0FBE1E0EBEAF3
select 'on the slave:' see;
see
on the slave:
select hex(c1), hex(c2) from t1;
hex(c1)	hex(c2)
EED52C20DAC120D2D9C2C1CCCBD5	EED52C20DAC120D2D9C2C1CCCBD5
drop table t1;
stop slave;
[1 Jun 2004 15:11] Guilhem Bichot
Hi Sergey,
Known bug. Have a patch to fix this but it hasn't been approved enough (waiting for Monty) to be in 4.1.2. Hopefully 4.1.3.
[3 Jun 2004 23:40] Guilhem Bichot
Thank you for your bug report. This issue has been committed to our
source repository of that product and will be incorporated into the
next release.

If necessary, you can access the source repository and build the latest
available version, including the bugfix, yourself. More information 
about accessing the source trees is available at
    http://www.mysql.com/doc/en/Installing_source_tree.html

Additional info:

Fixed in 4.1
ChangeSet@1.1843.14.1, 2004-06-03 23:17:18+02:00, guilhem@mysql.com
  Implementation of WL#1824 "Add replication of character set variables in 4.1"