[CONJ-222] StringOutOfBoundsException in prepareStatement when rewriteBatchedStatements=true Created: 2015-11-21  Updated: 2015-11-22  Resolved: 2015-11-22

Status: Closed
Project: MariaDB Connector/J
Component/s: Other
Affects Version/s: 1.3.0, 1.2.2, 1.2.3, 1.3.1
Fix Version/s: 1.3.2

Type: Bug Priority: Major
Reporter: Andreas Persson Assignee: Diego Dupin
Resolution: Fixed Votes: 0
Labels: 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.



 Comments   
Comment by Diego Dupin [ 2015-11-22 ]

This case INSERT ... SELECT in not handle : it has not to be rewriten but driver was trying to.
Will be handle in the 1.3.2 correction version (this week).

Generated at Thu Feb 08 03:14:05 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.