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

java.lang.StringIndexOutOfBoundsException: String index out of range: -1

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 1.2.2
    • 1.3.0
    • Other
    • None
    • The database version isn't relevant since the query is never sent to the db (it fails on the client side)...

    Description

      There seems to be a regression bug in driver 1.2.2 with the following query that raise an exception (works fine with version 1.2.0):

      PreparedStatement ps = c.prepareStatement("insert into t1 (LAST_UPDATE_DATETIME, VERSION) select ?, version from t2");
      ps.setTimestamp(1, new java.sql.Timestamp(System.currentTimeMillis()));
      ps.executeUpdate();

      java.lang.StringIndexOutOfBoundsException: String index out of range: -1
      at java.lang.String.substring(String.java:1911)
      at org.mariadb.jdbc.internal.common.query.MySQLParameterizedQuery.<init>(MySQLParameterizedQuery.java:83)
      at org.mariadb.jdbc.MySQLPreparedStatement.<init>(MySQLPreparedStatement.java:90)
      at org.mariadb.jdbc.MySQLConnection.prepareStatement(MySQLConnection.java:181)
      at com.test.mavenproject5.TestSuite.testMariaDB(TestSuite.java:134)

      Attachments

        Issue Links

          Activity

            People

              diego dupin Diego Dupin
              cbourque Christian Bourque
              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.