Uploaded image for project: 'MariaDB Connector/J'
  1. MariaDB Connector/J
  2. CONJ-329

rewriteBatchedStatements causes "QueryException: Query was empty"

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 1.5.0-RC
    • 1.5.1-RC
    • Other
    • 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();
      		}
      	}
      }
      
      

      Attachments

        Activity

          jaapbeetstra Jaap Beetstra created issue -
          diego dupin Diego Dupin made changes -
          Field Original Value New Value
          Fix Version/s 1.5.1-RC [ 22121 ]
          diego dupin Diego Dupin added a comment -

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

          diego dupin Diego Dupin added a comment - correction done in 1.5.1-RC ( release in a few days)
          diego dupin Diego Dupin made changes -
          Component/s Other [ 12201 ]
          Resolution Fixed [ 1 ]
          Status Open [ 1 ] Closed [ 6 ]
          serg Sergei Golubchik made changes -
          Workflow MariaDB v3 [ 76582 ] MariaDB v4 [ 134891 ]

          People

            diego dupin Diego Dupin
            jaapbeetstra Jaap Beetstra
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.