Bug #77394 When warning count is 0, Statement/Connection.getWarnings() should be a no-op
Submitted: 17 Jun 2015 17:54 Modified: 24 Jan 2022 12:27
Reporter: Mark Matthews Email Updates:
Status: Duplicate Impact on me:
None 
Category:Connector / J Severity:S3 (Non-critical)
Version:5.1.35 OS:Any
Assigned to: CPU Architecture:Any

[17 Jun 2015 17:54] Mark Matthews
Description:
Currently, the JDBC driver blindly issues "show warnings" any time Statement or Connection.getWarnings() is called by client code. Many 3rd-party frameworks call this code somewhat blindly in their default configurations, and this causes extra latency that isn't needed, since the driver already knows if something will be returned by that call or not (it's on the wire, and the value is stored somewhere in the driver).

How to repeat:
Issue a query that doesn't cause warnings. Call .getWarnings() on the statement, observe that the driver issues a "SHOW WARNINGS" call, even though nothing will be returned by the server.
[18 Jun 2015 7:31] MySQL Verification Team
Hello Mark,

Thank you for the report.

Thanks,
Umesh
[24 Jan 2022 12:26] Alexander Soklakov
Posted by developer:
 
Fixed in Connector/J 8.0.28 under Bug#101389.

Connector/J 5.1 series came to EOL on Feb 9th, 2021, see https://www.mysql.com/support/eol-notice.html, so this bug will not be fixed there.