Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
2.3.0
-
None
-
Amazon Linux
Java 8
Groovy 2.5.2
Description
I believe the fix for this issue is likely similar to these two commits that were made for CONJ-616:
- https://github.com/MariaDB/mariadb-connector-j/commit/a4fe8a6584eb0bc7b9e3a2cbb8d2944aae8760ff#diff-a20a8f2ac5655c0096cb43b49262e501
- https://github.com/MariaDB/mariadb-connector-j/commit/0013ee923a70ca012be42b82fd8d2c75c3ff2ec1#diff-a20a8f2ac5655c0096cb43b49262e501
We are connecting to an AWS Aurora RDS datasource using a connection string that looks like this:
jdbc:mariadb:aurora://XXXXX.cluster-XXXXX.us-east-1.rds.amazonaws.com:3306/XXXXX?socketTimeout=0&useSSL=true&connectTimeout=31000
After connecting successfully, we are occasionally getting this NullPointerException on calls to prepareStatement:
java.lang.NullPointerException: null
|
at org.mariadb.jdbc.internal.failover.impl.MastersSlavesListener.noBackslashEscapes(MastersSlavesListener.java:294)
|
at org.mariadb.jdbc.internal.failover.FailoverProxy.invoke(FailoverProxy.java:158)
|
at com.sun.proxy.$Proxy18.noBackslashEscapes(Unknown Source)
|
at org.mariadb.jdbc.MariaDbConnection.internalPrepareStatement(MariaDbConnection.java:535)
|
at org.mariadb.jdbc.MariaDbConnection.prepareStatement(MariaDbConnection.java:350)
|
at groovy.sql.Sql$CreatePreparedStatementCommand.execute(Sql.java:4604)
|
at groovy.sql.Sql$CreatePreparedStatementCommand.execute(Sql.java:4582)
|
at groovy.sql.Sql.getAbstractStatement(Sql.java:4421)
|
at groovy.sql.Sql.getPreparedStatement(Sql.java:4436)
|
at groovy.sql.Sql.getPreparedStatement(Sql.java:4525)
|
at groovy.sql.Sql.eachRow(Sql.java:1282)
|
at groovy.sql.Sql.eachRow(Sql.java:1376)
|
at groovy.sql.Sql.eachRow(Sql.java:1435)
|
at groovy.sql.Sql$eachRow.call(Unknown Source)
|
In this instance, our input into Groovy's eachRow method was:
sql: "SELECT table_name FROM information_schema.tables where table_schema=current_database() and lower(table_name)=?"
params: ["connection_data"]
closure: irrelevant, we weren't getting far enough into execution for the code to hit this parameter