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

Streaming issue when using procedures in PrepareStatement/Statement

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 1.4.1, 1.4.2, 1.4.3, 1.4.4, 1.4.5, 1.4.6, 1.5.2
    • 1.5.3
    • Other
    • None

    Description

      Statement calling procedures with fetch size (result streaming) will not finished in a stable state, according to fetch size value and procedure resultset size.

      Example :
      /*
      DELIMITER $$
      Create procedure testCallWithFetchSize ()
      BEGIN
      SELECT 1;
      SELECT 2;
      END$$
      DELIMITER;
      */

      try (Statement statement = sharedConnection.createStatement()) {
      	statement.setFetchSize(1);
      	try (ResultSet resultSet = statement.executeQuery("CALL testCallWithFetchSize()")) {
      		int rowCount = 0;
      		while(resultSet.next()) {
      			rowCount++;
      		}
      	}
      }
      //next query will fail.
      

      Procedure result differ from other query, since can have differents results.

      JDBC indicate that procedures are normally called using CallableStatement , but there is not reason to block that for PrepareStatement/statement.

      Attachments

        Activity

          diego dupin Diego Dupin created issue -
          diego dupin Diego Dupin made changes -
          Field Original Value New Value
          Description Statement calling procedures with fetch size (result streaming) will not finished in a stable state, according to fetch size value and procedure resultset size.

          Example :
          /*
          DELIMITER $$
          Create procedure testCallWithFetchSize ()
          BEGIN
          SELECT 1;
          SELECT 2;
          END$$
          DELIMITER;
          */


          {code:java}
          try (Statement statement = sharedConnection.createStatement()) {
                      statement.setFetchSize(1);
                      try (ResultSet resultSet = statement.executeQuery("CALL testCallWithFetchSize()")) {
                          int rowCount = 0;
                          while(resultSet.next()) {
                              rowCount++;
                          }
                      }
                  }
          //next query will fail.
          {code}

          Procedure result differ from other query, since procedures can have differents results. Fetch size does work using CallableStatement, but not with PrepareStatement/Statement.

          JDBC indicate that procedures are normally called using [https://docs.oracle.com/javase/7/docs/api/java/sql/CallableStatement.html|CallableStatement], but there is not reason to block that for PrepareStatement/statement.
          Statement calling procedures with fetch size (result streaming) will not finished in a stable state, according to fetch size value and procedure resultset size.

          Example :
          /*
          DELIMITER $$
          Create procedure testCallWithFetchSize ()
          BEGIN
          SELECT 1;
          SELECT 2;
          END$$
          DELIMITER;
          */


          {code:java}
          try (Statement statement = sharedConnection.createStatement()) {
          statement.setFetchSize(1);
          try (ResultSet resultSet = statement.executeQuery("CALL testCallWithFetchSize()")) {
          int rowCount = 0;
          while(resultSet.next()) {
          rowCount++;
          }
          }
          }
          //next query will fail.
          {code}

          Procedure result differ from other query, since can have differents results.

          JDBC indicate that procedures are normally called using [https://docs.oracle.com/javase/7/docs/api/java/sql/CallableStatement.html|CallableStatement], but there is not reason to block that for PrepareStatement/statement.
          diego dupin Diego Dupin made changes -
          Description Statement calling procedures with fetch size (result streaming) will not finished in a stable state, according to fetch size value and procedure resultset size.

          Example :
          /*
          DELIMITER $$
          Create procedure testCallWithFetchSize ()
          BEGIN
          SELECT 1;
          SELECT 2;
          END$$
          DELIMITER;
          */


          {code:java}
          try (Statement statement = sharedConnection.createStatement()) {
          statement.setFetchSize(1);
          try (ResultSet resultSet = statement.executeQuery("CALL testCallWithFetchSize()")) {
          int rowCount = 0;
          while(resultSet.next()) {
          rowCount++;
          }
          }
          }
          //next query will fail.
          {code}

          Procedure result differ from other query, since can have differents results.

          JDBC indicate that procedures are normally called using [https://docs.oracle.com/javase/7/docs/api/java/sql/CallableStatement.html|CallableStatement], but there is not reason to block that for PrepareStatement/statement.
          Statement calling procedures with fetch size (result streaming) will not finished in a stable state, according to fetch size value and procedure resultset size.

          Example :
          /*
          DELIMITER $$
          Create procedure testCallWithFetchSize ()
          BEGIN
          SELECT 1;
          SELECT 2;
          END$$
          DELIMITER;
          */


          {code:java}
          try (Statement statement = sharedConnection.createStatement()) {
          statement.setFetchSize(1);
          try (ResultSet resultSet = statement.executeQuery("CALL testCallWithFetchSize()")) {
          int rowCount = 0;
          while(resultSet.next()) {
          rowCount++;
          }
          }
          }
          //next query will fail.
          {code}

          Procedure result differ from other query, since can have differents results.

          JDBC indicate that procedures are normally called using [CallableStatement|https://docs.oracle.com/javase/7/docs/api/java/sql/CallableStatement.html] , but there is not reason to block that for PrepareStatement/statement.
          diego dupin Diego Dupin made changes -
          Summary Streaming issue when using procedures not in callableStatement Streaming issue when using procedures in PrepareStatement/Statement
          diego dupin Diego Dupin made changes -
          Status Open [ 1 ] In Progress [ 3 ]
          diego dupin Diego Dupin made changes -
          Resolution Fixed [ 1 ]
          Status In Progress [ 3 ] Closed [ 6 ]
          serg Sergei Golubchik made changes -
          Workflow MariaDB v3 [ 77234 ] MariaDB v4 [ 134909 ]

          People

            diego dupin Diego Dupin
            diego dupin Diego Dupin
            Votes:
            0 Vote for this issue
            Watchers:
            1 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.