Bug #12687 SET NAMES is not replicated. Diff CHARSET & COLLATION Master Vs Slave
Submitted: 19 Aug 2005 19:06 Modified: 12 Dec 2005 14:11
Reporter: Jonathan Miller Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server: Replication Severity:S3 (Non-critical)
Version:5.0-wl1012 OS:Linux (Linux)
Assigned to: Guilhem Bichot CPU Architecture:Any

[19 Aug 2005 19:06] Jonathan Miller
Description:
+ CREATE VIEW test.v5 AS SELECT CHARSET(CHAR(65)), COLLATION(CHAR(65));
+ SET NAMES 'latin1';

MASTER
+ SELECT * FROM test.v5;
+ CHARSET(CHAR(65))     COLLATION(CHAR(65))
+ latin1        latin1_swedish_ci
SLAVE
+ SELECT * FROM test.v5;
+ CHARSET(CHAR(65))     COLLATION(CHAR(65))
+ latin1        latin1_swedish_ci
+ SET NAMES 'utf8';
MASTER
+ SELECT * FROM test.v5;
+ CHARSET(CHAR(65))     COLLATION(CHAR(65))
+ utf8  utf8_general_ci
SLAVE
+ SELECT * FROM test.v5;
+ CHARSET(CHAR(65))     COLLATION(CHAR(65))
+ latin1        latin1_swedish_ci

How to repeat:
SEE ABOVE
[12 Dec 2005 14:11] Guilhem Bichot
The test is equivalent to doing
SET NAMES 'utf8';
on master
and doing SELECT CHARSET(CHAR(65)), COLLATION(CHAR(65));
on master and slave.
But it's normal that the two results differ. If the connection on the master changes its session vars it modifies its session but not the session on slave.
Replication propagates writes: if the output of the SELECT is used to write into a table then content on master and slave should match in RBR (they do). They don't match in SBR as expected and documented, because SBR loses session-variable values (so those values should not be used in statements which do writes).
I'll remove this little part of rpl_row_view01 and enable the rest of the test.