Bug #2428 --old-rpl-compat is broken
Submitted: 16 Jan 2004 9:23 Modified: 18 Jan 2004 8:40
Reporter: Masaki Fujimoto Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Replication Severity:S3 (Non-critical)
Version:4.0.17 OS:Linux (Debian GNU Linux (Woody))
Assigned to: Guilhem Bichot CPU Architecture:Any

[16 Jan 2004 9:23] Masaki Fujimoto
Description:
Replication with the option --old-rpl-compat always fail after the LOAD DATA INFILE statement is performed. Once the LOAD DATA INFILE statement is executed on the master server, slave servers and mysqlbinlog command continue claiming as follows:

ERROR: Error in Log_event::read_log_event(): 'Found invalid event in binary log', data_len: 73, event_type: 6
ERROR: Could not read entry at offset 200 : Error in log format or read error

Although --old-rpl-compat is the undocumented option and it could be found only in mysqld --help or sql/mysqld.cc, I think it should work perfectly as long as this feature is included in the official release (or should be marked as experimental or something like that).

How to repeat:
my.cnf:
[mysqld]
server-id       = 1
log-bin         = /usr/local/mysql/log/mysql-bin.log
old-rpl-compat  = 1

$ /usr/local/mysql/bin/mysqld_safe &
$ echo 'CREATE TABLE t1 (col1 INT);' | /usr/local/mysql/bin/mysql -uroot test
$ echo 'INSERT INTO t1 VALUES (0);' | /usr/local/mysql/bin/mysql -uroot test
$ /usr/local/mysql/bin/mysqlbinlog /usr/local/mysql/log/mysql-bin.001
# at 4
#040117  2:17:47 server id 1  log_pos 4         Start: binlog v 3, server v 4.0.16-standard-log create
d 040117  2:17:47 at startup
# at 79
#040117  2:17:54 server id 1  log_pos 79        Query   thread_id=1     exec_time=0     error_code=0
use test;
SET TIMESTAMP=1074273474;
CREATE TABLE t1 (col1 INT);
# at 140
#040117  2:18:00 server id 1  log_pos 140       Query   thread_id=2     exec_time=0     error_code=0
SET TIMESTAMP=1074273480;
INSERT INTO t1 VALUES (0);

$ echo '1' > /tmp/infile.txt
$ echo 'LOAD DATA INFILE "/tmp/infile.txt" INTO TABLE t1;' | /usr/local/mysql/bin/mysql -uroot test
$ /usr/local/mysql/bin/mysqlbinlog /usr/local/mysql/log/mysql-bin.001
# at 4
#040117  2:17:47 server id 1  log_pos 4         Start: binlog v 3, server v 4.0.16-standard-log create
d 040117  2:17:47 at startup
# at 79
#040117  2:17:54 server id 1  log_pos 79        Query   thread_id=1     exec_time=0     error_code=0
use test;
SET TIMESTAMP=1074273474;
CREATE TABLE t1 (col1 INT);
# at 140
#040117  2:18:00 server id 1  log_pos 140       Query   thread_id=2     exec_time=0     error_code=0
SET TIMESTAMP=1074273480;
INSERT INTO t1 VALUES (0);
ERROR: Error in Log_event::read_log_event(): 'Found invalid event in binary log', data_len: 73, event_
type: 6
ERROR: Could not read entry at offset 200 : Error in log format or read error
[18 Jan 2004 8:40] Guilhem Bichot
This option, --old-rpl-compat, was introduced in MySQL 4.0.0-alpha (released in 2001), which was a very early development release of 4.0, which replication has little to do with the current one in MySQL 4.0.17.
Simply put, this option should have been removed since a long time; it produces nothing usable: it produces binary logs events in a format which is a mixture of the format of 3.23 and the format of 4.0, so which is readable by no version :(
Moreover, this option, even if it worked, would be of no use, as MySQL 3.23 can't be a slave of a MySQL 4.0 master (so there is no point in making a 4.0 produce binary logs in the format of 3.23).
This out-of-date option should never have slipped into the production releases of MySQL 4.0; I will immediately remove it from MySQL 4.0.18.
Please accept all our excuses, and thank you for pointing us to this.

Regards,
Guilhem