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

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.2.2
    • Fix Version/s: 1.3.0
    • Component/s: Other
    • Labels:
      None
    • Environment:
      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

              Assignee:
              diego dupin Diego Dupin
              Reporter:
              cbourque Christian Bourque
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Git Integration