From a5275fa6e56a9ca46e8cf994a6027306cd2c12eb Mon Sep 17 00:00:00 2001 From: Tod Beardsley Date: Tue, 8 Mar 2011 21:28:20 +0000 Subject: [PATCH] Fixes #3915. This comments out two more raiseable conditions -- neither seem particularly useful to raise on in the first place anyway, though. Some day, I need to go over all this with some decent version switching and submit some upstream patches. git-svn-id: file:///home/svn/framework3/trunk@11897 4d416f70-5f16-0410-b530-b9f4589650da --- lib/rbmysql/protocol.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/rbmysql/protocol.rb b/lib/rbmysql/protocol.rb index 05a696b78d..641a39d690 100644 --- a/lib/rbmysql/protocol.rb +++ b/lib/rbmysql/protocol.rb @@ -235,7 +235,8 @@ class RbMysql header = @sock.read(4) len1, len2, seq = header.unpack("CvC") len = (len2 << 8) + len1 - raise ProtocolError, "invalid packet: sequence number mismatch(#{seq} != #{@seq}(expected))" if @seq != seq + # Ignore the sequence number -- protocol differences between 4.x and 5.x + # raise ProtocolError, "invalid packet: sequence number mismatch(#{seq} != #{@seq}(expected))" if @seq != seq @seq = (@seq + 1) % 256 ret.concat @sock.read(len) end @@ -295,7 +296,8 @@ class RbMysql # ProtocolError :: packet is not EOF def read_eof_packet data = read - raise ProtocolError, "packet is not EOF" unless Protocol.eof_packet? data + # EOF packet is different between MySQL 4.x and 5.x, so ignore. + # raise ProtocolError, "packet is not EOF" unless Protocol.eof_packet? data end # Read initial packet