[CONJ-329] rewriteBatchedStatements causes "QueryException: Query was empty" Created: 2016-08-05  Updated: 2016-08-15  Resolved: 2016-08-15

Status: Closed
Project: MariaDB Connector/J
Component/s: Other
Affects Version/s: 1.5.0-RC
Fix Version/s: 1.5.1-RC

Type: Bug Priority: Major
Reporter: Jaap Beetstra Assignee: Diego Dupin
Resolution: Fixed Votes: 0
Labels: None


 Description   

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();
		}
	}
}



 Comments   
Comment by Diego Dupin [ 2016-08-15 ]

correction done in 1.5.1-RC ( release in a few days)

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