Bug #96582 jdbc.MysqlParameterMetadata#isNullable doesnt check whether to be simple
Submitted: 19 Aug 2019 4:47 Modified: 20 Dec 2023 21:26
Reporter: Daren Klamer Email Updates:
Status: Closed Impact on me:
None 
Category:Connector / J Severity:S3 (Non-critical)
Version:8.0.17 OS:Any
Assigned to: CPU Architecture:Any

[19 Aug 2019 4:47] Daren Klamer
Description:
It seems as though com.mysql.cj.jdbc.MysqlParameterMetadata#isNullable doesn't check whether to return simple meta data or not, whereas all the other related methods do. 

Perhaps when this is true the driver can return https://docs.oracle.com/javase/7/docs/api/java/sql/ParameterMetaData.html#parameterNullabl... ?

How to repeat:
Invoke com.mysql.cj.jdbc.MysqlParameterMetadata#isNullable even when generateSimpleParameterMetdata is set to true on the connection URL

Suggested fix:
Return https://docs.oracle.com/javase/7/docs/api/java/sql/ParameterMetaData.html#parameterNullabl... when com.mysql.cj.jdbc.MysqlParameterMetadata#returnSimpleMetadata is true
[23 Aug 2019 13:59] Alexander Soklakov
Hi Daren,

Right, it makes sense, thanks! Verified by code review.
[20 Dec 2023 21:26] Daniel So
Posted by developer:
 
Added the following entry to the Connector/J 8.3.0 changelog:

"MysqlParameterMetadata.isNullable() ignored the value of the connection property generateSimpleParameterMetadata when returning a value. With this fix, the method returns ParameterMetaData.parameterNullableUnknown when generateSimpleParameterMetadata is true."