Details
-
Bug
-
Status: Closed (View Workflow)
-
Minor
-
Resolution: Fixed
-
1.1.8
-
None
-
Windows 7, 64 bit
Description
I can reproduce the error I am submitting here with this code block:
|
public static void main(String[] args) throws SQLException { |
MariaDB db = new MariaDB(); |
Connection conn = db.getConnection();
|
PreparedStatement sqlInsert = conn.prepareStatement("insert into prep (text) values (?)"); |
sqlInsert.setString(1, "aa"); |
sqlInsert.addBatch();
|
sqlInsert.setString(1, "b;b"); |
sqlInsert.addBatch();
|
sqlInsert.executeBatch();
|
conn.commit();
|
}
|
|
The connection uses "rewriteBatchedStatements=true"
As soon as I use a semicolon in the string, I get an "String index out of range: -1"
- if I switch back to connector 1.1.7, I get no error
- if I set rewriteBatchedStatements to false, I get no error
- the MariaDB query.log is empty, i.e. the statement does not reach the database. Which is to be expected since the error is an java.lang.StringIndexOutOfBoundsException
- Tested on MariaDB 10.0.15, connector 1.1.8
If you need any more infos, let me know.