Commit db6b8972 authored by marko's avatar marko

branches/innodb+: btr_cur_t: Remove leaf_in_buf_pool. The flag can be

determined from flag == BTR_CUR_ABORTED.  This flag value was previously
never tested for.  It was only assigned to, in the only place where
leaf_in_buf_pool would be set FALSE.

btr_cur_search_to_nth_level(): Do not initialize cursor->leaf_in_buf_pool.

btr_pcur_was_buffered(): Remove.  The only caller, row_search_index_entry(),
will switch (cursor->flag) and handle BTR_CUR_ABORTED as well.

row_purge_remove_sec_if_poss_low(): Remove the assertions on leaf_in_buf_pool.
parent 798a26a9
......@@ -385,7 +385,6 @@ btr_cur_search_to_nth_level(
cursor->flag = BTR_CUR_BINARY;
cursor->index = index;
cursor->leaf_in_buf_pool = FALSE;
cursor->ibuf_cnt = ULINT_UNDEFINED;
#ifndef BTR_CUR_ADAPT
......@@ -532,18 +531,14 @@ btr_cur_search_to_nth_level(
space, zip_size, page_no, rw_latch, guess, buf_mode,
__FILE__, __LINE__, mtr);
if (watch_leaf && height == 0) {
cursor->leaf_in_buf_pool = !!block;
/* We didn't find a page but we set a watch on it. */
if (block == NULL) {
if (block == NULL) {
if (watch_leaf && height == 0) {
/* We didn't find a page but we set a watch on it. */
cursor->flag = BTR_CUR_ABORTED;
goto func_exit;
}
}
if (block == NULL) {
/* This must be a search to perform an insert/delete
mark/ delete; try using the insert/delete buffer */
......@@ -626,11 +621,6 @@ btr_cur_search_to_nth_level(
root_height = height;
cursor->tree_height = root_height + 1;
/* 1-level trees must be handled here
for BTR_WATCH_LEAF. */
if (watch_leaf && height == 0) {
cursor->leaf_in_buf_pool = TRUE;
}
#ifdef BTR_CUR_ADAPT
if (block != guess) {
info->root_guess = block;
......
......@@ -66,7 +66,7 @@ buffer. */
#define BTR_DELETE 8192
/* If the leaf page is not in the buffer pool: don't read it in, set
cursor->leaf_in_buf_pool to FALSE, and set buf_pool_t::watch_* that
cursor->flag = BTR_CUR_ABORTED, and set buf_pool_t::watch_* that
watches for the page to get read in. */
#define BTR_WATCH_LEAF 16384
......
......@@ -674,11 +674,6 @@ struct btr_cur_struct {
node pointer had the 'minimum
record' flag set), this is
ULINT_UNDEFINED. */
ibool leaf_in_buf_pool;
/* TRUE if the leaf page is in
the buffer pool while searching
with BTR_WATCH_LEAF; FALSE
otherwise. */
/*------------------------------*/
btr_path_t* path_arr; /* in estimating the number of
rows in range, we store in this array
......
......@@ -79,16 +79,6 @@ btr_pcur_open(
btr_pcur_t* cursor, /* in: memory buffer for persistent cursor */
mtr_t* mtr); /* in: mtr */
/******************************************************************
Check if an operation was buffered. */
UNIV_INLINE
ibool
btr_pcur_was_buffered(
/*==================*/
/* out: TRUE if the operation was buffered
in the insert/delete buffer */
const btr_pcur_t* cursor);
/* in: persistent cursor */
/******************************************************************
Opens an persistent cursor to an index tree without initializing the
cursor. */
UNIV_INLINE
......
......@@ -506,28 +506,6 @@ btr_pcur_open(
cursor->trx_if_known = NULL;
}
/******************************************************************
Check if an operation was buffered. */
UNIV_INLINE
ibool
btr_pcur_was_buffered(
/*==================*/
/* out: TRUE if the operation was buffered
in the insert/delete buffer */
const btr_pcur_t* cursor)
/* in: persistent cursor */
{
const btr_cur_t* btr_cursor;
/* Look in the tree cursor */
btr_cursor = btr_pcur_get_btr_cur(cursor);
return((btr_cursor->flag == BTR_CUR_DEL_MARK_IBUF)
|| (btr_cursor->flag == BTR_CUR_DELETE_IBUF)
|| (btr_cursor->flag == BTR_CUR_INSERT_TO_IBUF));
}
/******************************************************************
Opens an persistent cursor to an index tree without initializing the
cursor. */
......
......@@ -314,9 +314,6 @@ row_purge_remove_sec_if_poss_low(
{
mtr_t mtr;
btr_pcur_t pcur;
#ifdef UNIV_DEBUG
ibool leaf_in_buf_pool;
#endif /* UNIV_DEBUG */
ibool old_has = FALSE;
enum row_search_result search_result;
......@@ -335,21 +332,17 @@ row_purge_remove_sec_if_poss_low(
search_result = row_search_index_entry(
index, entry, BTR_SEARCH_LEAF | BTR_WATCH_LEAF, &pcur, &mtr);
ut_d(leaf_in_buf_pool = btr_pcur_get_btr_cur(&pcur)->leaf_in_buf_pool);
btr_pcur_close(&pcur);
mtr_commit(&mtr);
switch (search_result) {
case ROW_NOT_FOUND:
/* Index entry does not exist, nothing to do. */
ut_ad(leaf_in_buf_pool);
return(TRUE);
case ROW_FOUND:
/* The index entry exists and is in the buffer pool;
no need to use the insert/delete buffer. */
ut_ad(leaf_in_buf_pool);
goto unbuffered;
case ROW_BUFFERED:
......@@ -359,7 +352,6 @@ row_purge_remove_sec_if_poss_low(
ut_error;
case ROW_NOT_IN_POOL:
ut_ad(!leaf_in_buf_pool);
break;
}
......
......@@ -801,18 +801,17 @@ row_search_index_entry(
btr_pcur_open(index, entry, PAGE_CUR_LE, mode, pcur, mtr);
if (btr_pcur_was_buffered(pcur)) {
return(ROW_BUFFERED);
}
if ((mode & BTR_WATCH_LEAF)
&& !btr_pcur_get_btr_cur(pcur)->leaf_in_buf_pool) {
switch (btr_pcur_get_btr_cur(pcur)->flag) {
case BTR_CUR_ABORTED:
/* We did not read in the leaf page, thus we can't have
found anything. */
ut_a(mode & BTR_WATCH_LEAF);
return(ROW_NOT_IN_POOL);
case BTR_CUR_DEL_MARK_IBUF:
case BTR_CUR_DELETE_IBUF:
case BTR_CUR_INSERT_TO_IBUF:
return(ROW_BUFFERED);
}
low_match = btr_pcur_get_low_match(pcur);
......
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