row0sel.c:

  Do not allow InnoDB to cache result set in HANDLER because user can use PREV and NEXT and scroll the cursor
parent 3a77f47a
...@@ -2784,6 +2784,10 @@ row_search_for_mysql( ...@@ -2784,6 +2784,10 @@ row_search_for_mysql(
} }
trx->op_info = (char *) ""; trx->op_info = (char *) "";
/* NOTE that we do NOT store the cursor
position */
return(DB_SUCCESS); return(DB_SUCCESS);
} else if (shortcut == SEL_EXHAUSTED) { } else if (shortcut == SEL_EXHAUSTED) {
...@@ -2803,6 +2807,10 @@ row_search_for_mysql( ...@@ -2803,6 +2807,10 @@ row_search_for_mysql(
} }
trx->op_info = (char *) ""; trx->op_info = (char *) "";
/* NOTE that we do NOT store the cursor
position */
return(DB_RECORD_NOT_FOUND); return(DB_RECORD_NOT_FOUND);
} }
...@@ -3183,6 +3191,7 @@ row_search_for_mysql( ...@@ -3183,6 +3191,7 @@ row_search_for_mysql(
&& prebuilt->select_lock_type == LOCK_NONE && prebuilt->select_lock_type == LOCK_NONE
&& !prebuilt->templ_contains_blob && !prebuilt->templ_contains_blob
&& !prebuilt->clust_index_was_generated && !prebuilt->clust_index_was_generated
&& !prebuilt->used_in_HANDLER
&& prebuilt->template_type && prebuilt->template_type
!= ROW_MYSQL_DUMMY_TEMPLATE) { != ROW_MYSQL_DUMMY_TEMPLATE) {
...@@ -3191,7 +3200,9 @@ row_search_for_mysql( ...@@ -3191,7 +3200,9 @@ row_search_for_mysql(
update, that is why we require ...lock_type == LOCK_NONE. update, that is why we require ...lock_type == LOCK_NONE.
Since we keep space in prebuilt only for the BLOBs of Since we keep space in prebuilt only for the BLOBs of
a single row, we cannot cache rows in the case there a single row, we cannot cache rows in the case there
are BLOBs in the fields to be fetched. */ are BLOBs in the fields to be fetched. In HANDLER we do
not cache rows because there the cursor is a scrollable
cursor. */
row_sel_push_cache_row_for_mysql(prebuilt, rec); row_sel_push_cache_row_for_mysql(prebuilt, rec);
...@@ -3224,8 +3235,8 @@ row_search_for_mysql( ...@@ -3224,8 +3235,8 @@ row_search_for_mysql(
a unique search. */ a unique search. */
if (!unique_search_from_clust_index if (!unique_search_from_clust_index
|| prebuilt->select_lock_type == LOCK_X || prebuilt->select_lock_type == LOCK_X
|| prebuilt->used_in_HANDLER) { || prebuilt->used_in_HANDLER) {
/* Inside an update always store the cursor position */ /* Inside an update always store the cursor position */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment