[CONJ-116] Make SQLException prettier when too large packet is sent to the server Created: 2014-10-03  Updated: 2014-12-22  Resolved: 2014-12-22

Status: Closed
Project: MariaDB Connector/J
Component/s: None
Affects Version/s: 1.1.7
Fix Version/s: 1.1.8

Type: Task Priority: Trivial
Reporter: Lennart Schedin Assignee: Massimo Siani (Inactive)
Resolution: Fixed Votes: 0
Labels: None

Attachments: Java Source File MaxAllowedPacketTest.java    

 Description   

How to reproduce:
Run the attached test case maxAllowedPackedExceptionIsPrettyTest() in the attached file MaxAllowedPacketTest.java

Psedo code:

  1. Lower or set the server variable max_allowed_packet to a good value
  2. Create an SQL query bigger than max_allowed_packet
  3. Execute the SQL query and look at the Exception text.

Actual:
The test case will fail and this will be printed in the console:

Could not send query: Software caused connection abort: socket write error

Expected:
When running my test with Mysql JDBC the test case will pass and this will be printed in the log:

Packet for query is too large (1106929 > 1048576). You can change this value on the server by setting the max_allowed_packet' variable.

Analysis:
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.

However if 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.


Generated at Thu Feb 08 03:13:17 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.