[CONJ-568] PreparedStatement.getParameterMetadata Not Reporting Query Statement Types Correctly Created: 2018-01-05  Updated: 2018-01-22  Resolved: 2018-01-22

Status: Closed
Project: MariaDB Connector/J
Component/s: Other
Affects Version/s: 2.2.1
Fix Version/s: N/A

Type: Bug Priority: Major
Reporter: Stephen Mulcahy Assignee: Diego Dupin
Resolution: Won't Fix Votes: 0
Labels: 10.2-ga
Environment:

Windows 10, MariaDb 10.2.11


Attachments: Zip Archive Project Export for MariaDb Bug Report.zip    
Issue Links:
Relates
relates to MDEV-15031 Parameter metadata Open

 Description   

PreparedStatement.getParameterMetadata is not reporting metadata information correctly. Once returned, Parametermeta only correctly reports the number of parameters a statement contains. It does not report type information correctly - all types are returned as String.

Is there a suggested way to get ParameterMetadata in the absence of the API returning it using PreparedStatement.getParametermetadata.

Example program attached which exhibits the outlined behaviour above. Executed against MariaDb 10.2.1 on Windows 10 using client driver 2.2.1.

Sample output from execution of test program
Connecting to a selected database...
JDBC Version = 4, version = 2.2.1
Connected database successfully...
ps = sql : 'INSERT INTO test (id, dateField, timeField, stringField) VALUES (?, ?, ?, ?)', parameters : [666333425,'2018-01-02',15:35:13,'s']
Name: java.lang.String
TYPE: VARSTRING
MODE: IN
Name: java.lang.String
TYPE: VARSTRING
MODE: IN
Name: java.lang.String
TYPE: VARSTRING
MODE: IN
Name: java.lang.String
TYPE: VARSTRING
MODE: IN
Goodbye!



 Comments   
Comment by Diego Dupin [ 2018-01-22 ]

Closing.
Issue is due because server doesn't send those information. Task created on server backlog MDEV-15031

Comment by Diego Dupin [ 2018-01-22 ]

Actually, the only reliable information for parameter metadata is ParameterMetadata.getParameterCount().

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