Uploaded image for project: 'MariaDB Connector/J'
  1. MariaDB Connector/J
  2. CONJ-103

Error calling stored procedure with DECIMAL parameter

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.1.7
    • Fix Version/s: 1.1.8
    • Component/s: None
    • Labels:
      None

      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 //
      }}

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              massimo.siani Massimo Siani (Inactive)
              Reporter:
              gjocher greg
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.