@@ -576,28 +576,30 @@ mysqlnd_stmt_execute_parse_response(MYSQLND_STMT * const s, enum_mysqlnd_parse_e
576
576
DBG_INF_FMT ("server_status=%u cursor=%u" , UPSERT_STATUS_GET_SERVER_STATUS (stmt -> upsert_status ),
577
577
UPSERT_STATUS_GET_SERVER_STATUS (stmt -> upsert_status ) & SERVER_STATUS_CURSOR_EXISTS );
578
578
579
- if (UPSERT_STATUS_GET_SERVER_STATUS (stmt -> upsert_status ) & SERVER_STATUS_CURSOR_EXISTS ) {
580
- DBG_INF ("cursor exists" );
581
- stmt -> cursor_exists = TRUE;
582
- SET_CONNECTION_STATE (& conn -> state , CONN_READY );
583
- /* Only cursor read */
584
- stmt -> default_rset_handler = s -> m -> use_result ;
585
- DBG_INF ("use_result" );
586
- } else if (stmt -> flags & CURSOR_TYPE_READ_ONLY ) {
587
- DBG_INF ("asked for cursor but got none" );
588
- /*
589
- We have asked for CURSOR but got no cursor, because the condition
590
- above is not fulfilled. Then...
591
-
592
- This is a single-row result set, a result set with no rows, EXPLAIN,
593
- SHOW VARIABLES, or some other command which either a) bypasses the
594
- cursors framework in the server and writes rows directly to the
595
- network or b) is more efficient if all (few) result set rows are
596
- precached on client and server's resources are freed.
597
- */
598
- /* preferred is buffered read */
599
- stmt -> default_rset_handler = s -> m -> store_result ;
600
- DBG_INF ("store_result" );
579
+ if (stmt -> flags & CURSOR_TYPE_READ_ONLY ) {
580
+ if (UPSERT_STATUS_GET_SERVER_STATUS (stmt -> upsert_status ) & SERVER_STATUS_CURSOR_EXISTS ) {
581
+ DBG_INF ("cursor exists" );
582
+ stmt -> cursor_exists = TRUE;
583
+ SET_CONNECTION_STATE (& conn -> state , CONN_READY );
584
+ /* Only cursor read */
585
+ stmt -> default_rset_handler = s -> m -> use_result ;
586
+ DBG_INF ("use_result" );
587
+ } else {
588
+ DBG_INF ("asked for cursor but got none" );
589
+ /*
590
+ We have asked for CURSOR but got no cursor, because the condition
591
+ above is not fulfilled. Then...
592
+
593
+ This is a single-row result set, a result set with no rows, EXPLAIN,
594
+ SHOW VARIABLES, or some other command which either a) bypasses the
595
+ cursors framework in the server and writes rows directly to the
596
+ network or b) is more efficient if all (few) result set rows are
597
+ precached on client and server's resources are freed.
598
+ */
599
+ /* preferred is buffered read */
600
+ stmt -> default_rset_handler = s -> m -> store_result ;
601
+ DBG_INF ("store_result" );
602
+ }
601
603
} else {
602
604
DBG_INF ("no cursor" );
603
605
/* preferred is unbuffered read */
0 commit comments