Re: Packet for query is too large
Posted by: Todd Farmer
Date: December 17, 2013 10:03AM

Hi Sebastian,

The problem is that you cannot set the maxAllowedPacket on the client side to be smaller than 4739923 (the apparent size of packets exchanged during server handshake process). The test for this is done entirely on the client side, meaning the server has already sent a packet advertizing itself as 4739923 bytes in length, and Connector/J refuses to process it because it exceeds the configured maxAllowedPacket you defined.

The stack trace provided indicates that this is happening during the initial handshake, which is pretty odd. A quick code inspection suggests that maxAllowedPacket isn't currently sent to the server in the handshake (where it normally would be sent to limit responses), and that a value of 16581375 (255 * 255 * 255) is always sent. That would explain why the server sent a larger packet; Connector/J never told it otherwise. I think this behavior is a bug, but checking with the active developers to get their thoughts. In the interim, you may need to increase maxAllowedPacket (it appears to not be guarding against what is actually being sent by the server as is).

Hope that helps.

Todd Farmer
MySQL @ Oracle

Options: ReplyQuote

Written By
Re: Packet for query is too large
December 17, 2013 10:03AM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.