Bug #29764 MySQL Proxy aborts when acting between master and slave
Submitted: 12 Jul 2007 16:07 Modified: 13 Jul 2007 13:30
Reporter: Giuseppe Maxia Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Proxy: Core Severity:S2 (Serious)
Version:0.6.0 OS:Any
Assigned to: Jan Kneschke CPU Architecture:Any
Tags: proxy, replication

[12 Jul 2007 16:07] Giuseppe Maxia
Description:
If you use MySQL proxy an intermediate server between master and slave in replication, the proxy aborts when asking for binary logs contents.

The same behavior can be observed using mysqlbinlog.

How to repeat:
* start a master with binary log (assume 127.0.0.1:3306)
* start the proxy
/usr/local/sbin/mysql-proxy -D --proxy-backend-addresses=127.0.0.1:3306

use mysqlbinlog to retrieve the binlog
mysqlbinlog -h 127.0.0.1 -P 4040 -u USER -R -pPWD filename-bin.000001

The proxy aborts with error:
network-mysqld-proxy.c.2823: COM_(0x12) is not handled
Abort trap

mysqlbinlog will fail with this message:
/*!40019 SET @@session.max_insert_delayed_threads=0*/;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
Got error reading packet from server: Lost connection to MySQL server during query
DELIMITER ;
# End of log file
ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;

Suggested fix:
N/A
[13 Jul 2007 13:30] Jan Kneschke
Fixed in [114].

COM_BINLOG_DUMP is a bit different than the other commands as it never finishes. mysqlbinlog just closes the connection when it doesn't want to read anymore. 

In 5.0.x or 5.1.x a non-blocking option was added which isn't supported yet.