Bug #113591 connector/J support query not returning resultset metadata
Submitted: 9 Jan 2024 9:43 Modified: 11 Jan 2024 12:52
Reporter: Allen Iverson Email Updates:
Status: Unsupported Impact on me:
None 
Category:Connector / J Severity:S4 (Feature request)
Version:8.0 OS:Any
Assigned to: MySQL Verification Team CPU Architecture:Any
Tags: ResultSet metadata

[9 Jan 2024 9:43] Allen Iverson
Description:
Optional result set metadata is supportted since MySQL Server 8.0.3.When using C++ Connector to connect to MySQL database, the performance is improved when the number of records returned by the query is very small. For some tables, when the query returns 1 record and does not return metadata, the traffic packet size will be reduced by 87% and the time consumption will be reduced by 13%.

According to mysql database documentation, client can set the resultset_metadata system variable to control whether the server returns result set metadata.But I did not find the corresponding implementation in connector/J.

I would like to know when Connector/J will support the feature of query not returning resultset metadata.

How to repeat:
null
[11 Jan 2024 12:52] Filipe Silva
Hi Allen,

Thank you for your interest in MySQL Connector/J.

So far we haven't considered implementing this feature because the absence of metadata is not JDBC compliant. However, we know it could be useful as a companion of https://dev.mysql.com/doc/connector-j/en/connector-j-connp-props-performance-extensions.ht..., in which case, repeating queries could leverage the reuse of metadata information from the first execution. The problem with this approach is in the nature the system variable `resultset_metadata` which the connector can't control completely, and it could happen the server can send results for which the connector doesn't have any cached metadata.

Anyway, this is how it is today. I can't say whether or when we might consider implementing some form of this feature or not.