lock0lock.c:

  Fix a latching order violation in the previous (2003-06-15) push: could lead to a hang on the btr0sea.c semaphore
parent 6ae8ff3c
......@@ -579,6 +579,10 @@ lock_clust_rec_cons_read_sees(
ut_ad(index->type & DICT_CLUSTERED);
ut_ad(page_rec_is_user_rec(rec));
/* NOTE that we call this function while holding the search
system latch. To obey the latching order we must NOT reserve the
kernel mutex here! */
trx_id = row_get_rec_trx_id(rec, index);
if (read_view_sees_trx_id(view, trx_id)) {
......@@ -586,15 +590,6 @@ lock_clust_rec_cons_read_sees(
return(TRUE);
}
if (!lock_check_trx_id_sanity(trx_id, rec, index, FALSE)) {
/* Trying to get the 'history' of a corrupt record is bound
to fail: let us try to use the record itself in the query */
fprintf(stderr,
"InnoDB: We try to access the corrupt record in the query anyway.\n");
return(TRUE);
}
return(FALSE);
}
......@@ -624,6 +619,10 @@ lock_sec_rec_cons_read_sees(
ut_ad(!(index->type & DICT_CLUSTERED));
ut_ad(page_rec_is_user_rec(rec));
/* NOTE that we might call this function while holding the search
system latch. To obey the latching order we must NOT reserve the
kernel mutex here! */
if (recv_recovery_is_on()) {
return(FALSE);
......@@ -633,16 +632,6 @@ lock_sec_rec_cons_read_sees(
if (ut_dulint_cmp(max_trx_id, view->up_limit_id) >= 0) {
if (!lock_check_trx_id_sanity(max_trx_id, rec, index, FALSE)) {
/* Trying to get the 'history' of a corrupt record is
bound to fail: let us try to use the record itself in
the query */
fprintf(stderr,
"InnoDB: We try to access the corrupt record in the query anyway.\n");
return(TRUE);
}
return(FALSE);
}
......
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