Implement MySQL framework to support consistent read views in

cursors for InnoDB. The idea of the patch is that if MySQL requests
a consistent read view, we open one when open a cursor, set is as the
active view to a transaction when fetch from the cursor, and close
together with cursor close. This patch is associated to bugs #11813, 
#11832, and #11833. Contains after review fixes.
This commit is contained in:
unknown 2005-07-22 14:10:03 +03:00
commit 6fd13aaa3c
8 changed files with 294 additions and 13 deletions

View file

@ -4083,6 +4083,11 @@ normal_return:
}
func_exit:
/* Restore a global read view back to transaction. This forces
MySQL always to set cursor view before fetch if it is used. */
trx->read_view = trx->global_read_view;
trx->op_info = "";
if (UNIV_LIKELY_NULL(heap)) {
mem_heap_free(heap);
@ -4136,7 +4141,8 @@ row_search_check_if_query_cache_permitted(
&& !trx->read_view) {
trx->read_view = read_view_open_now(trx,
trx->read_view_heap);
trx->global_read_view_heap);
trx->global_read_view = trx->read_view;
}
}