Merge from mysql-5.1 to mysql-5.5

This commit is contained in:
Annamalai Gurusami 2013-05-16 13:58:26 +05:30
commit f4f7cd05ce

View file

@ -56,6 +56,7 @@ Created 7/19/1997 Heikki Tuuri
#include "log0recv.h" #include "log0recv.h"
#include "que0que.h" #include "que0que.h"
#include "srv0start.h" /* srv_shutdown_state */ #include "srv0start.h" /* srv_shutdown_state */
#include "rem0cmp.h"
/* STRUCTURE OF AN INSERT BUFFER RECORD /* STRUCTURE OF AN INSERT BUFFER RECORD
@ -3824,11 +3825,13 @@ skip_watch:
/********************************************************************//** /********************************************************************//**
During merge, inserts to an index page a secondary index entry extracted During merge, inserts to an index page a secondary index entry extracted
from the insert buffer. */ from the insert buffer.
@return newly inserted record */
static static
void rec_t*
ibuf_insert_to_index_page_low( ibuf_insert_to_index_page_low(
/*==========================*/ /*==========================*/
/* out: newly inserted record */
const dtuple_t* entry, /*!< in: buffered entry to insert */ const dtuple_t* entry, /*!< in: buffered entry to insert */
buf_block_t* block, /*!< in/out: index page where the buffered buf_block_t* block, /*!< in/out: index page where the buffered
entry should be placed */ entry should be placed */
@ -3843,10 +3846,12 @@ ibuf_insert_to_index_page_low(
ulint zip_size; ulint zip_size;
const page_t* bitmap_page; const page_t* bitmap_page;
ulint old_bits; ulint old_bits;
rec_t* rec;
DBUG_ENTER("ibuf_insert_to_index_page_low");
if (UNIV_LIKELY rec = page_cur_tuple_insert(page_cur, entry, index, 0, mtr);
(page_cur_tuple_insert(page_cur, entry, index, 0, mtr) != NULL)) { if (rec != NULL) {
return; DBUG_RETURN(rec);
} }
/* If the record did not fit, reorganize */ /* If the record did not fit, reorganize */
@ -3856,9 +3861,9 @@ ibuf_insert_to_index_page_low(
/* This time the record must fit */ /* This time the record must fit */
if (UNIV_LIKELY rec = page_cur_tuple_insert(page_cur, entry, index, 0, mtr);
(page_cur_tuple_insert(page_cur, entry, index, 0, mtr) != NULL)) { if (rec != NULL) {
return; DBUG_RETURN(rec);
} }
page = buf_block_get_frame(block); page = buf_block_get_frame(block);
@ -3911,6 +3916,7 @@ ibuf_insert_to_index_page(
ulint low_match; ulint low_match;
page_t* page = buf_block_get_frame(block); page_t* page = buf_block_get_frame(block);
rec_t* rec; rec_t* rec;
DBUG_ENTER("ibuf_insert_to_index_page");
ut_ad(ibuf_inside(mtr)); ut_ad(ibuf_inside(mtr));
ut_ad(dtuple_check_typed(entry)); ut_ad(dtuple_check_typed(entry));
@ -3955,7 +3961,7 @@ dump:
"InnoDB: Submit a detailed bug report to" "InnoDB: Submit a detailed bug report to"
" http://bugs.mysql.com!\n", stderr); " http://bugs.mysql.com!\n", stderr);
return; DBUG_VOID_RETURN;
} }
low_match = page_cur_search(block, index, entry, low_match = page_cur_search(block, index, entry,
@ -3990,7 +3996,7 @@ dump:
rec, page_zip, FALSE, mtr); rec, page_zip, FALSE, mtr);
updated_in_place: updated_in_place:
mem_heap_free(heap); mem_heap_free(heap);
return; DBUG_VOID_RETURN;
} }
/* Copy the info bits. Clear the delete-mark. */ /* Copy the info bits. Clear the delete-mark. */
@ -4034,15 +4040,21 @@ updated_in_place:
lock_rec_store_on_page_infimum(block, rec); lock_rec_store_on_page_infimum(block, rec);
page_cur_delete_rec(&page_cur, index, offsets, mtr); page_cur_delete_rec(&page_cur, index, offsets, mtr);
page_cur_move_to_prev(&page_cur); page_cur_move_to_prev(&page_cur);
rec = ibuf_insert_to_index_page_low(entry, block, index, mtr,
&page_cur);
ut_ad(!cmp_dtuple_rec(entry, rec,
rec_get_offsets(rec, index, NULL,
ULINT_UNDEFINED,
&heap)));
mem_heap_free(heap); mem_heap_free(heap);
ibuf_insert_to_index_page_low(entry, block, index, mtr,
&page_cur);
lock_rec_restore_from_page_infimum(block, rec, block); lock_rec_restore_from_page_infimum(block, rec, block);
} else { } else {
ibuf_insert_to_index_page_low(entry, block, index, mtr, ibuf_insert_to_index_page_low(entry, block, index, mtr,
&page_cur); &page_cur);
} }
DBUG_VOID_RETURN;
} }
/****************************************************************//** /****************************************************************//**