[CONJ-103] Error calling stored procedure with DECIMAL parameter Created: 2014-07-17  Updated: 2015-07-07  Resolved: 2014-10-21

Status: Closed
Project: MariaDB Connector/J
Component/s: None
Affects Version/s: 1.1.7
Fix Version/s: 1.1.8

Type: Bug Priority: Minor
Reporter: greg Assignee: Massimo Siani (Inactive)
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Relates
relates to CONJ-165 Updates to DECIMAL field through Java... Closed
Sub-Tasks:
Key
Summary
Type
Status
Assignee
CONJ-165 Updates to DECIMAL field through Java... Sub-Task Closed Georg Richter  

 Description   

We use stored procedures with DECIMAL(10,2) as parameter type definition - we receive an exception with the following cause:
...
Caused by: java.sql.SQLException: cannot parse parameter definition :
IN bar DECIMAL(10
at org.mariadb.jdbc.CallableParameterMetaData.readMetadata(MySQLCallableStatement.java:193)
at org.mariadb.jdbc.CallableParameterMetaData.readMetadataFromDBIfRequired(MySQLCallableStatement.java:63)
at org.mariadb.jdbc.CallableParameterMetaData.getParam(MySQLCallableStatement.java:237)
at org.mariadb.jdbc.CallableParameterMetaData.getName(MySQLCallableStatement.java:278)
at org.mariadb.jdbc.MySQLCallableStatement.nameToIndex(MySQLCallableStatement.java:493)
at org.mariadb.jdbc.MySQLCallableStatement.setObject(MySQLCallableStatement.java:879)

It seems, that the parameters are splitted the wrong way:
StringTokenizer tokenizer = new StringTokenizer(paramList,",", false);

We worked around this issue by using a double without specific definition, cause of default settings of DECIMAL.

Example Procedure:
{{
delimiter //
CREATE PROCEDURE test_proc
(
IN foo VARCHAR(255),
IN bar DECIMAL(10,2),
OUT result int(11)
)
SQL SECURITY INVOKER
BEGIN
select "test";
END //
}}


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