1
/******************************************************
6
Created 2/16/1997 Heikki Tuuri
7
*******************************************************/
9
/*************************************************************************
10
Gets the nth trx id in a read view. */
13
read_view_get_nth_trx_id(
14
/*=====================*/
16
read_view_t* view, /* in: read view */
17
ulint n) /* in: position */
19
ut_ad(n < view->n_trx_ids);
21
return(*(view->trx_ids + n));
24
/*************************************************************************
25
Sets the nth trx id in a read view. */
28
read_view_set_nth_trx_id(
29
/*=====================*/
30
read_view_t* view, /* in: read view */
31
ulint n, /* in: position */
32
dulint trx_id) /* in: trx id to set */
34
ut_ad(n < view->n_trx_ids);
36
*(view->trx_ids + n) = trx_id;
39
/*************************************************************************
40
Checks if a read view sees the specified transaction. */
43
read_view_sees_trx_id(
44
/*==================*/
45
/* out: TRUE if sees */
46
read_view_t* view, /* in: read view */
47
dulint trx_id) /* in: trx id */
53
if (ut_dulint_cmp(trx_id, view->up_limit_id) < 0) {
58
if (ut_dulint_cmp(trx_id, view->low_limit_id) >= 0) {
63
/* We go through the trx ids in the array smallest first: this order
64
may save CPU time, because if there was a very long running
65
transaction in the trx id array, its trx id is looked at first, and
66
the first two comparisons may well decide the visibility of trx_id. */
68
n_ids = view->n_trx_ids;
70
for (i = 0; i < n_ids; i++) {
74
read_view_get_nth_trx_id(view, n_ids - i - 1));