|
Adding rewriteBatchedStatements=true causes a java.sql.PreparedStatement without parameters to fail. It will throw org.mariadb.jdbc.internal.util.dao.QueryException: Query was empty.
Demonstration is included below.
This was tested using mariadb-java-client-1.5.0-RC1.jar
|
public class RewriteBatchedStatementsTest {
|
public static void main(String[] args) throws SQLException {
|
String failingURL = "jdbc:mariadb://localhost:3306/information_schema?rewriteBatchedStatements=true";
|
String workingURL = "jdbc:mariadb://localhost:3306/information_schema";
|
String url = failingURL;
|
Connection conn = DriverManager.getConnection(url, "root", "");
|
try {
|
PreparedStatement statement = conn.prepareStatement("SELECT 1");
|
try {
|
statement.executeQuery();
|
} finally {
|
statement.close();
|
}
|
} finally {
|
conn.close();
|
}
|
}
|
}
|
|
|