Commit 0a8380ab authored by marko's avatar marko

branches/innodb+: Merge revisions 3519:3541 from branches/zip:

  ------------------------------------------------------------------------
  r3537 | marko | 2008-12-16 10:24:03 +0200 (Tue, 16 Dec 2008) | 3 lines

  branches/zip: sync_thread_add_level(): Add a comment explaining the
  assertion about SYNC_BUF_POOL and SYNC_BUF_BLOCK.
  ------------------------------------------------------------------------
  r3540 | marko | 2008-12-16 12:13:31 +0200 (Tue, 16 Dec 2008) | 2 lines

  branches/zip: buf_page_init_for_read(): Use common code for error exit.
  ------------------------------------------------------------------------
  r3541 | marko | 2008-12-16 12:14:58 +0200 (Tue, 16 Dec 2008) | 3 lines

  branches/zip: btr_cur_optimistic_delete(): Note that no further pages
  must be latched before calling mtr_commit(mtr) if the function returns TRUE.
  ------------------------------------------------------------------------
parent 79e5dc96
......@@ -2863,7 +2863,10 @@ btr_cur_optimistic_delete(
delete; cursor stays valid: if deletion
succeeds, on function exit it points to the
successor of the deleted record */
mtr_t* mtr) /* in: mtr */
mtr_t* mtr) /* in: mtr; if this function returns
TRUE on a leaf page of a secondary
index, the mtr must be committed
before latching any further pages */
{
buf_block_t* block;
rec_t* rec;
......
......@@ -2694,15 +2694,8 @@ err_exit:
mutex_exit(&block->mutex);
}
err_exit2:
buf_pool_mutex_exit();
if (mode == BUF_READ_IBUF_PAGES_ONLY) {
mtr_commit(&mtr);
}
return(NULL);
bpage = NULL;
goto func_exit;
}
if (fil_tablespace_deleted_or_being_deleted_in_mem(
......@@ -2783,7 +2776,9 @@ err_exit2:
/* The block was added by some other thread. */
buf_buddy_free(bpage, sizeof *bpage);
buf_buddy_free(data, zip_size);
goto err_exit2;
bpage = NULL;
goto func_exit;
}
page_zip_des_init(&bpage->zip);
......@@ -2824,6 +2819,7 @@ err_exit2:
}
buf_pool->n_pend_reads++;
func_exit:
buf_pool_mutex_exit();
if (mode == BUF_READ_IBUF_PAGES_ONLY) {
......@@ -2831,7 +2827,7 @@ err_exit2:
mtr_commit(&mtr);
}
ut_ad(buf_page_in_file(bpage));
ut_ad(!bpage || buf_page_in_file(bpage));
return(bpage);
}
......
......@@ -340,7 +340,10 @@ btr_cur_optimistic_delete(
cursor stays valid: if deletion succeeds,
on function exit it points to the successor
of the deleted record */
mtr_t* mtr); /* in: mtr */
mtr_t* mtr); /* in: mtr; if this function returns
TRUE on a leaf page of a secondary
index, the mtr must be committed
before latching any further pages */
/*****************************************************************
Removes the record on which the tree cursor is positioned. Tries
to compress the page if its fillfactor drops below a threshold
......
......@@ -1079,6 +1079,9 @@ sync_thread_add_level(
}
break;
case SYNC_BUF_BLOCK:
/* Either the thread must own the buffer pool mutex
(buf_pool_mutex), or it is allowed to latch only ONE
buffer block (block->mutex or buf_pool_zip_mutex). */
ut_a((sync_thread_levels_contain(array, SYNC_BUF_POOL)
&& sync_thread_levels_g(array, SYNC_BUF_BLOCK - 1))
|| sync_thread_levels_g(array, SYNC_BUF_BLOCK));
......
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