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

StringOutOfBoundsException in prepareStatement when rewriteBatchedStatements=true

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 1.3.0, 1.2.2, 1.2.3, 1.3.1
    • 1.3.2
    • Other
    • None

    Description

      This statement causes a StringOutOfBoundsException when rewriteBatchedStatement=true:

      INSERT INTO table1 SELECT a1.col21 b1 FROM table2 a1 LEFT OUTER JOIN table3 c1 ON a1.col21 = c1.col31 AND c1.col32 = ? WHERE c1.col33 IS NULL AND a1.col22 = ? AND a1.col21 IN (?,?,?,?,?)

      Exception (with version 1.3.1):

      Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String index out of range: -59
      	at java.lang.String.substring(String.java:1931)
      	at org.mariadb.jdbc.internal.query.MariaDbClientParameterizeQuery.<init>(MariaDbClientParameterizeQuery.java:134)
      	at org.mariadb.jdbc.MariaDbClientPreparedStatement.<init>(MariaDbClientPreparedStatement.java:89)

      It worked fine with version 1.2.0, so it could be the CONJ-168 fix that broke something.

      Attachments

        Activity

          People

            diego dupin Diego Dupin
            andreas Andreas Persson
            Votes:
            0 Vote for this issue
            Watchers:
            2 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.