Commit 9ef29c11 authored by Marko Mäkelä's avatar Marko Mäkelä

Merge mysql-5.1 to mysql-5.5.

parents f73f90e4 ae59e31d
...@@ -330,7 +330,6 @@ buf_buddy_relocate( ...@@ -330,7 +330,6 @@ buf_buddy_relocate(
{ {
buf_page_t* bpage; buf_page_t* bpage;
const ulint size = BUF_BUDDY_LOW << i; const ulint size = BUF_BUDDY_LOW << i;
ullint usec = ut_time_us(NULL);
mutex_t* mutex; mutex_t* mutex;
ulint space; ulint space;
ulint page_no; ulint page_no;
...@@ -397,6 +396,7 @@ buf_buddy_relocate( ...@@ -397,6 +396,7 @@ buf_buddy_relocate(
if (buf_page_can_relocate(bpage)) { if (buf_page_can_relocate(bpage)) {
/* Relocate the compressed page. */ /* Relocate the compressed page. */
ullint usec = ut_time_us(NULL);
ut_a(bpage->zip.data == src); ut_a(bpage->zip.data == src);
memcpy(dst, src, size); memcpy(dst, src, size);
bpage->zip.data = dst; bpage->zip.data = dst;
......
...@@ -1120,7 +1120,7 @@ trx_undo_rec_get_partial_row( ...@@ -1120,7 +1120,7 @@ trx_undo_rec_get_partial_row(
/***********************************************************************//** /***********************************************************************//**
Erases the unused undo log page end. Erases the unused undo log page end.
@return TRUE if the page contained something, FALSE if it was empty */ @return TRUE if the page contained something, FALSE if it was empty */
static __attribute__((nonnull, warn_unused_result)) static __attribute__((nonnull))
ibool ibool
trx_undo_erase_page_end( trx_undo_erase_page_end(
/*====================*/ /*====================*/
...@@ -1131,16 +1131,11 @@ trx_undo_erase_page_end( ...@@ -1131,16 +1131,11 @@ trx_undo_erase_page_end(
first_free = mach_read_from_2(undo_page + TRX_UNDO_PAGE_HDR first_free = mach_read_from_2(undo_page + TRX_UNDO_PAGE_HDR
+ TRX_UNDO_PAGE_FREE); + TRX_UNDO_PAGE_FREE);
if (first_free == TRX_UNDO_PAGE_HDR + TRX_UNDO_PAGE_HDR_SIZE) {
/* This was an empty page to begin with.
Do nothing here; the caller should free the page. */
return(FALSE);
}
memset(undo_page + first_free, 0xff, memset(undo_page + first_free, 0xff,
(UNIV_PAGE_SIZE - FIL_PAGE_DATA_END) - first_free); (UNIV_PAGE_SIZE - FIL_PAGE_DATA_END) - first_free);
mlog_write_initial_log_record(undo_page, MLOG_UNDO_ERASE_END, mtr); mlog_write_initial_log_record(undo_page, MLOG_UNDO_ERASE_END, mtr);
return(TRUE); return(first_free != TRX_UNDO_PAGE_HDR + TRX_UNDO_PAGE_HDR_SIZE);
} }
/***********************************************************//** /***********************************************************//**
...@@ -1162,11 +1157,7 @@ trx_undo_parse_erase_page_end( ...@@ -1162,11 +1157,7 @@ trx_undo_parse_erase_page_end(
return(ptr); return(ptr);
} }
if (!trx_undo_erase_page_end(page, mtr)) { trx_undo_erase_page_end(page, mtr);
/* The function trx_undo_erase_page_end() should not
have done anything to an empty page. */
ut_ad(0);
}
return(ptr); return(ptr);
} }
...@@ -1311,6 +1302,18 @@ trx_undo_report_row_operation( ...@@ -1311,6 +1302,18 @@ trx_undo_report_row_operation(
undo page. Discard the freshly allocated undo page. Discard the freshly allocated
page and return an error. */ page and return an error. */
/* When we remove a page from an undo
log, this is analogous to a
pessimistic insert in a B-tree, and we
must reserve the counterpart of the
tree latch, which is the rseg
mutex. We must commit the mini-transaction
first, because it may be holding lower-level
latches, such as SYNC_FSP and SYNC_FSP_PAGE. */
mtr_commit(&mtr);
mtr_start(&mtr);
mutex_enter(&rseg->mutex); mutex_enter(&rseg->mutex);
trx_undo_free_last_page(trx, undo, &mtr); trx_undo_free_last_page(trx, undo, &mtr);
mutex_exit(&rseg->mutex); mutex_exit(&rseg->mutex);
......
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