Bug #22889 Relay bin log file corruption: not properly escaped Null character
Submitted: 2 Oct 2006 12:19 Modified: 16 Oct 2006 8:59
Reporter: Sveta Smirnova Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server: Replication Severity:S3 (Non-critical)
Version:4.0.25-standard-log OS:Linux (Linux)
Assigned to: Mats Kindahl CPU Architecture:Any

[2 Oct 2006 12:19] Sveta Smirnova
Description:
In replication process in the relay log occured not properly escaped Null character.

How to repeat:
Setup replication.
[2 Oct 2006 16:59] Andrei Elkin
I would not claim the bug is about replication until the customer provides
a necessary part for analysis: the original binlog which makes impossible to compare an existed in the report relay-log, containing an offending query,
with the correct one.
[13 Oct 2006 12:26] Lars Thalmann
Active support ended 30 Oct 2006 for MySQL 4.0.
This bug should be fixed in 4.1 and upwards.
[16 Oct 2006 8:59] Mats Kindahl
It's not possible to repeat the failure since we don't know where the query went bad in the following chain:
- Query entered through JDBC interface with a string containing '\\0'
- Query sent to server by JDBC
- Query executed by server
- Query written to binary log
- Query sent to slave by dump thread
- Query written to relay log by I/O thread:
  the query now contain a NUL character

I suspect a combination of the following:
- The quoting is not handled properly somewhere in the chain
- The query is not checked syntactically somewhere in the chain,
  hence the query is logged into the relay log in some form
- The query is read from the relay log in a form that can be executed
- The problem is visible only when inspecting the relay log directly,
  or when using mysqlbinlog