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

Error calling stored procedure with DECIMAL parameter

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Minor
    • Resolution: Fixed
    • 1.1.7
    • 1.1.8
    • None
    • 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

          There are no Sub-Tasks for this issue.

          Activity

            People

              massimo.siani Massimo Siani (Inactive)
              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.