Bug #107648 PacketTooBigException when upgrading to 8.0.29
Submitted: 24 Jun 2022 8:02 Modified: 29 Jul 2022 13:00
Reporter: Alina Eftenoiu Email Updates:
Status: No Feedback Impact on me:
None 
Category:Connector / J Severity:S3 (Non-critical)
Version:8.0.29 OS:Any
Assigned to: MySQL Verification Team CPU Architecture:Any

[24 Jun 2022 8:02] Alina Eftenoiu
Description:
We are using the connector from a Kotlin app with Spring JPA. When trying to upgrade to 8.0.29 our tests are failing with the PacketTooBigException. We allow a maximum size of 6MB and the failure comes when we try to write an entity of 5.99 MB using JPA saveAndFlush method.

Exception:
com.mysql.cj.jdbc.exceptions.PacketTooBigException: Packet for query is too large (17,320,386 > 12,582,912). You can change this value on the server by setting the 'max_allowed_packet' variable.

We allow maximum 12MB on the DB and now we see that the connector tries to save ~18MB when we provide a 6MB payload. We can increase the max_allowed_packet value, but I want to know why this change and if this is a bug or this is how the connector will work from now on.

Spring Boot Version: 2.7.1
MySQL Version: 5.7

How to repeat:
Try to save with JPA a payload size of 1/2 of the max_allowed_packet value.

Suggested fix:
We would like to not be forced to do changed on the DB parameter settings.
[27 Jun 2022 18:17] MySQL Verification Team
Hi,

You are using connector/J 8.0.29 and MySQL 5.7 right? Does the same thing happen if you try connecting to MySQL 8.0.29?

Can you share your full connection string?

Are you using server side prepared statements? Have you tried with serverside prepare off if you are using them now?

thanks
[28 Jun 2022 8:29] Alina Eftenoiu
Yes, we are using 8.0.29 with mysql 5.7.

The connection string is: jdbc:mysql://{rds_instance}.us-east-1.rds.amazonaws.com:3306/{database_name}.

We are not using prepared statements and I cannot test with mysql 8.x because the queries are not compatible.

I can just say that connector/j version 8.0.28 is working as expected with mysql 5.7.
[29 Jun 2022 13:00] MySQL Verification Team
Hi,

Thank you for the additional data. I cannot reproduce this. Can you create a reproducible test case maybe? There are lot of network changes in the 8.0.29 connector/j release but without ability to reproduce this I can't do much.

Thanks
[30 Jul 2022 1:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".