Bug #74629 mysql 5.5 setting parameter collation_database to 2048 in binlog file
Submitted: 30 Oct 2014 6:48 Modified: 30 Oct 2014 11:51
Reporter: Sarvesh Padwal Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server: Charsets Severity:S2 (Serious)
Version:5.5 OS:Other (CentOS 6.4)
Assigned to: CPU Architecture:Any
Tags: binlog, CentOS 6.4, collation, mysql 5.5, replication

[30 Oct 2014 6:48] Sarvesh Padwal
Description:
I was migrating mysql server from centos 5.5 to 6.4.
I installed mysql 5.5 on centos 6.4 then start mysql and check
binlog files with mysqlbinlog.
I found following lines in binlog files.

SET @@session.collation_database=2048/*!*/;

However, tables in database are configured to utf8 and latin1

This is leading to chaos at a time of replication of same database.

Find below error logs while replication.

141027  5:33:02 [Note] Slave I/O thread: connected to master
'replication@192.168.**.***:3306',  replication started in log
'binary.000999' at position 98
141027  5:33:02 [ERROR] Slave: Error 'Unknown collation: '2048'' on
query. Default database: '***'. Query: 'BEGIN', Error_code: 1273
141027  5:33:02 [ERROR] Error running query, slave SQL thread aborted.
Fix the problem, and restart the slave SQL thread with "SLAVE START".
We stopped at log 'binary.000999' position 98

How to repeat:
Install same mysql 5.5 on centos 5.5 and check binlog files.
there is no conflict in collation setting.
When mysql 5.5 is installed on centos 6.4 with same installation
procedure, collation setting is corrupted in binlog.

Suggested fix:
I tried to set default_character_set in my.cnf. And started replication.
There is no issue in replication.
When I check binlog, there is no line indicating "SET
@@session.collation_database"
but this wont sure whether collation setting is intact with actual
database parameters.
[30 Oct 2014 11:44] MySQL Verification Team
We're sorry, but the bug system is not the appropriate forum for asking help on using MySQL products. Your problem is not the result of a bug.

Support on using our products is available both free in our forums at http://forums.mysql.com/ and for a reasonable fee direct from our skilled support engineers at http://www.mysql.com/support/

Thank you for your interest in MySQL.
[30 Oct 2014 11:51] Sarvesh Padwal
But why mysql is writting
SET @@session.collation_database=2048/*!*/;
in binlog where 2048 is invalid collation in mysql.
This is affecting replication process.