Bug #74600 mysql setting collation_database to 2048 in binlog file
Submitted: 28 Oct 2014 7:19 Modified: 28 Oct 2014 15:54
Reporter: Sarvesh Padwal Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server: Charsets Severity:S1 (Critical)
Version:5.0.51b OS:Other (CentOS 6.4)
Assigned to: CPU Architecture:Any
Tags: CentOS, mysql 5.0.51b, mysql collation issue, replication

[28 Oct 2014 7:19] Sarvesh Padwal
Description:
I was migrating mysql server from centos 5.5 to 6.4.
I installed mysql 5.0.51b 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.0.51b on centos 5.5 and check binlog files.
there is no conflict in collation setting.
When mysql 5.0.51b 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.
[28 Oct 2014 12:09] MySQL Verification Team
Thank you for the bug report. 5.0 version is EOL please upgrade for recent versions.
[28 Oct 2014 14:06] Sarvesh Padwal
I tried the same installation and replication with mysql 5.5. Still issue persists. Please suggest.