You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by "strongduanmu (via GitHub)" <gi...@apache.org> on 2023/06/15 02:59:29 UTC

[GitHub] [shardingsphere] strongduanmu opened a new issue, #26360: Streaming result set still active occurs when I execute sql federation with MySQL stream query

strongduanmu opened a new issue, #26360:
URL: https://github.com/apache/shardingsphere/issues/26360

   ## Bug Report
   
   ### Which version of ShardingSphere did you use?
   
   ### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
   
   ShardingSphere-Proxy
   
   ### Expected behavior
   
   Execute `SELECT * FROM t_order o INNER JOIN t_order_item i ON o.order_id = i.order_id;` with stream query successfully.
   
   ### Actual behavior
   
   ```sql
   mysql> SELECT * FROM t_order o INNER JOIN t_order_item i ON o.order_id = i.order_id;
   ERROR 1815 (HY000): Internal error: Streaming result set com.mysql.jdbc.RowDataDynamic@153e5956 is still active. No statements may be issued when any streaming result sets are open and in use on a given connection. Ensure that you have called .close() on any active streaming result sets before attempting more queries.
   ```
   
   ### Reason analyze (If you can)
   
   Refer MySQL document - https://dev.mysql.com/doc/connector-j/8.0/en/connector-j-reference-implementation-notes.html,
   
   ```
   ResultSet
   
   By default, ResultSets are completely retrieved and stored in memory. In most cases this is the most efficient way to operate and, due to the design of the MySQL network protocol, is easier to implement. If you are working with ResultSets that have a large number of rows or large values and cannot allocate heap space in your JVM for the memory required, you can tell the driver to stream the results back one row at a time.
   
   To enable this functionality, create a Statement instance in the following manner:
   
   stmt = conn.createStatement(java.sql.ResultSet.TYPE_FORWARD_ONLY,
                 java.sql.ResultSet.CONCUR_READ_ONLY);
   stmt.setFetchSize(Integer.MIN_VALUE);
   The combination of a forward-only, read-only result set, with a fetch size of Integer.MIN_VALUE serves as a signal to the driver to stream result sets row-by-row. After this, any result sets created with the statement will be retrieved row-by-row.
   
   There are some caveats with this approach. You must read all of the rows in the result set (or close it) before you can issue any other queries on the connection, or an exception will be thrown.
   ```
   
   ### Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.
   
   ### Example codes for reproduce this issue (such as a github link).
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] strongduanmu commented on issue #26360: Streaming result set still active occurs when I execute sql federation with MySQL stream query

Posted by "strongduanmu (via GitHub)" <gi...@apache.org>.
strongduanmu commented on issue #26360:
URL: https://github.com/apache/shardingsphere/issues/26360#issuecomment-1592275083

   Ref #26011


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] sandynz closed issue #26360: Streaming result set still active occurs when I execute sql federation with MySQL stream query

Posted by "sandynz (via GitHub)" <gi...@apache.org>.
sandynz closed issue #26360: Streaming result set still active occurs when I execute sql federation with MySQL stream query
URL: https://github.com/apache/shardingsphere/issues/26360


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org