How to reproduce:
Run the attached test case maxAllowedPackedExceptionIsPrettyTest() in the attached file MaxAllowedPacketTest.java
- Lower or set the server variable max_allowed_packet to a good value
- Create an SQL query bigger than max_allowed_packet
- Execute the SQL query and look at the Exception text.
The test case will fail and this will be printed in the console:
When running my test with Mysql JDBC the test case will pass and this will be printed in the log:
The amount of effort to fix this is probably big. It would require that the JDBC connector to find out the session max_allowed_packet variable and count the bytes in the queries. I would prioritize this ticket low.
CONJ-115 is fixed in a super nice way and using the max_allowed_packet to regulate how large LOAD DATA INFILE chunks to send to the server I suspect it would be easier to write a pretty Exception message.