2001-02-17 13:19:19 +01:00
|
|
|
/************************************************************************
|
|
|
|
The page cursor
|
|
|
|
|
|
|
|
(c) 1994-1996 Innobase Oy
|
|
|
|
|
|
|
|
Created 10/4/1994 Heikki Tuuri
|
|
|
|
*************************************************************************/
|
|
|
|
|
|
|
|
#include "page0cur.h"
|
|
|
|
#ifdef UNIV_NONINL
|
|
|
|
#include "page0cur.ic"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "rem0cmp.h"
|
|
|
|
#include "mtr0log.h"
|
2002-08-02 22:16:19 +02:00
|
|
|
#include "log0recv.h"
|
2003-06-15 00:04:28 +02:00
|
|
|
#include "rem0cmp.h"
|
2001-02-17 13:19:19 +01:00
|
|
|
|
2004-03-16 17:55:44 +01:00
|
|
|
static ulint page_rnd = 976722341;
|
2001-02-17 13:19:19 +01:00
|
|
|
|
|
|
|
#ifdef PAGE_CUR_ADAPT
|
2004-03-16 17:55:44 +01:00
|
|
|
# ifdef UNIV_SEARCH_PERF_STAT
|
|
|
|
ulint page_cur_short_succ = 0;
|
|
|
|
# endif /* UNIV_SEARCH_PERF_STAT */
|
2001-02-17 13:19:19 +01:00
|
|
|
|
|
|
|
/********************************************************************
|
|
|
|
Tries a search shortcut based on the last insert. */
|
|
|
|
UNIV_INLINE
|
|
|
|
ibool
|
|
|
|
page_cur_try_search_shortcut(
|
|
|
|
/*=========================*/
|
2004-12-09 14:29:55 +01:00
|
|
|
/* out: TRUE on success */
|
2001-02-17 13:19:19 +01:00
|
|
|
page_t* page, /* in: index page */
|
2004-12-02 18:45:07 +01:00
|
|
|
dict_index_t* index, /* in: record descriptor */
|
2001-02-17 13:19:19 +01:00
|
|
|
dtuple_t* tuple, /* in: data tuple */
|
|
|
|
ulint* iup_matched_fields,
|
|
|
|
/* in/out: already matched fields in upper
|
|
|
|
limit record */
|
|
|
|
ulint* iup_matched_bytes,
|
|
|
|
/* in/out: already matched bytes in a field
|
|
|
|
not yet completely matched */
|
|
|
|
ulint* ilow_matched_fields,
|
|
|
|
/* in/out: already matched fields in lower
|
|
|
|
limit record */
|
|
|
|
ulint* ilow_matched_bytes,
|
|
|
|
/* in/out: already matched bytes in a field
|
|
|
|
not yet completely matched */
|
|
|
|
page_cur_t* cursor) /* out: page cursor */
|
|
|
|
{
|
|
|
|
rec_t* rec;
|
|
|
|
rec_t* next_rec;
|
|
|
|
ulint low_match;
|
|
|
|
ulint low_bytes;
|
|
|
|
ulint up_match;
|
|
|
|
ulint up_bytes;
|
|
|
|
#ifdef UNIV_SEARCH_DEBUG
|
|
|
|
page_cur_t cursor2;
|
|
|
|
#endif
|
2004-12-09 14:29:55 +01:00
|
|
|
ibool success = FALSE;
|
|
|
|
mem_heap_t* heap = NULL;
|
2005-03-10 14:16:16 +01:00
|
|
|
ulint offsets_[REC_OFFS_NORMAL_SIZE];
|
2004-12-09 14:29:55 +01:00
|
|
|
ulint* offsets = offsets_;
|
2005-03-09 21:04:55 +01:00
|
|
|
*offsets_ = (sizeof offsets_) / sizeof *offsets_;
|
|
|
|
|
2001-02-17 13:19:19 +01:00
|
|
|
ut_ad(dtuple_check_typed(tuple));
|
|
|
|
|
|
|
|
rec = page_header_get_ptr(page, PAGE_LAST_INSERT);
|
2004-12-09 14:29:55 +01:00
|
|
|
offsets = rec_get_offsets(rec, index, offsets,
|
|
|
|
dtuple_get_n_fields(tuple), &heap);
|
2001-02-17 13:19:19 +01:00
|
|
|
|
|
|
|
ut_ad(rec);
|
|
|
|
ut_ad(page_rec_is_user_rec(rec));
|
|
|
|
|
|
|
|
ut_pair_min(&low_match, &low_bytes,
|
|
|
|
*ilow_matched_fields, *ilow_matched_bytes,
|
|
|
|
*iup_matched_fields, *iup_matched_bytes);
|
|
|
|
|
|
|
|
up_match = low_match;
|
|
|
|
up_bytes = low_bytes;
|
|
|
|
|
2005-06-30 10:15:06 +02:00
|
|
|
if (page_cmp_dtuple_rec_with_match(tuple, rec, offsets,
|
|
|
|
&low_match, &low_bytes) < 0) {
|
2004-12-09 14:29:55 +01:00
|
|
|
goto exit_func;
|
2001-02-17 13:19:19 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
next_rec = page_rec_get_next(rec);
|
2004-12-09 14:29:55 +01:00
|
|
|
offsets = rec_get_offsets(next_rec, index, offsets,
|
|
|
|
dtuple_get_n_fields(tuple), &heap);
|
2001-02-17 13:19:19 +01:00
|
|
|
|
2005-06-30 10:15:06 +02:00
|
|
|
if (page_cmp_dtuple_rec_with_match(tuple, next_rec, offsets,
|
|
|
|
&up_match, &up_bytes) >= 0) {
|
2004-12-09 14:29:55 +01:00
|
|
|
goto exit_func;
|
2001-02-17 13:19:19 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
cursor->rec = rec;
|
|
|
|
|
|
|
|
#ifdef UNIV_SEARCH_DEBUG
|
2004-12-02 18:45:07 +01:00
|
|
|
page_cur_search_with_match(page, index, tuple, PAGE_CUR_DBG,
|
2001-02-17 13:19:19 +01:00
|
|
|
iup_matched_fields,
|
|
|
|
iup_matched_bytes,
|
|
|
|
ilow_matched_fields,
|
|
|
|
ilow_matched_bytes,
|
|
|
|
&cursor2);
|
|
|
|
ut_a(cursor2.rec == cursor->rec);
|
|
|
|
|
|
|
|
if (next_rec != page_get_supremum_rec(page)) {
|
|
|
|
|
|
|
|
ut_a(*iup_matched_fields == up_match);
|
|
|
|
ut_a(*iup_matched_bytes == up_bytes);
|
|
|
|
}
|
|
|
|
|
|
|
|
ut_a(*ilow_matched_fields == low_match);
|
|
|
|
ut_a(*ilow_matched_bytes == low_bytes);
|
|
|
|
#endif
|
2005-06-30 10:15:06 +02:00
|
|
|
if (!page_rec_is_supremum(next_rec)) {
|
2001-02-17 13:19:19 +01:00
|
|
|
|
|
|
|
*iup_matched_fields = up_match;
|
|
|
|
*iup_matched_bytes = up_bytes;
|
|
|
|
}
|
|
|
|
|
|
|
|
*ilow_matched_fields = low_match;
|
|
|
|
*ilow_matched_bytes = low_bytes;
|
|
|
|
|
|
|
|
#ifdef UNIV_SEARCH_PERF_STAT
|
|
|
|
page_cur_short_succ++;
|
|
|
|
#endif
|
2004-12-09 14:29:55 +01:00
|
|
|
success = TRUE;
|
|
|
|
exit_func:
|
2005-04-21 13:23:26 +02:00
|
|
|
if (UNIV_LIKELY_NULL(heap)) {
|
2004-12-09 14:29:55 +01:00
|
|
|
mem_heap_free(heap);
|
|
|
|
}
|
|
|
|
return(success);
|
2001-02-17 13:19:19 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
2005-06-30 10:15:06 +02:00
|
|
|
#ifdef PAGE_CUR_LE_OR_EXTENDS
|
2003-02-18 18:43:41 +01:00
|
|
|
/********************************************************************
|
|
|
|
Checks if the nth field in a record is a character type field which extends
|
|
|
|
the nth field in tuple, i.e., the field is longer or equal in length and has
|
|
|
|
common first characters. */
|
|
|
|
static
|
|
|
|
ibool
|
|
|
|
page_cur_rec_field_extends(
|
|
|
|
/*=======================*/
|
2004-12-02 18:45:07 +01:00
|
|
|
/* out: TRUE if rec field
|
|
|
|
extends tuple field */
|
|
|
|
dtuple_t* tuple, /* in: data tuple */
|
|
|
|
rec_t* rec, /* in: record */
|
|
|
|
const ulint* offsets,/* in: array returned by rec_get_offsets() */
|
|
|
|
ulint n) /* in: compare nth field */
|
2003-02-18 18:43:41 +01:00
|
|
|
{
|
|
|
|
dtype_t* type;
|
|
|
|
dfield_t* dfield;
|
|
|
|
byte* rec_f;
|
|
|
|
ulint rec_f_len;
|
|
|
|
|
2004-12-02 18:45:07 +01:00
|
|
|
ut_ad(rec_offs_validate(rec, NULL, offsets));
|
2003-02-18 18:43:41 +01:00
|
|
|
dfield = dtuple_get_nth_field(tuple, n);
|
|
|
|
|
|
|
|
type = dfield_get_type(dfield);
|
|
|
|
|
2004-12-02 18:45:07 +01:00
|
|
|
rec_f = rec_get_nth_field(rec, offsets, n, &rec_f_len);
|
2003-02-18 18:43:41 +01:00
|
|
|
|
|
|
|
if (type->mtype == DATA_VARCHAR
|
|
|
|
|| type->mtype == DATA_CHAR
|
|
|
|
|| type->mtype == DATA_FIXBINARY
|
|
|
|
|| type->mtype == DATA_BINARY
|
|
|
|
|| type->mtype == DATA_BLOB
|
|
|
|
|| type->mtype == DATA_VARMYSQL
|
|
|
|
|| type->mtype == DATA_MYSQL) {
|
|
|
|
|
|
|
|
if (dfield_get_len(dfield) != UNIV_SQL_NULL
|
|
|
|
&& rec_f_len != UNIV_SQL_NULL
|
|
|
|
&& rec_f_len >= dfield_get_len(dfield)
|
|
|
|
&& 0 == cmp_data_data_slow(type, dfield_get_data(dfield),
|
|
|
|
dfield_get_len(dfield),
|
|
|
|
rec_f, dfield_get_len(dfield))) {
|
|
|
|
|
|
|
|
return(TRUE);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return(FALSE);
|
|
|
|
}
|
2005-06-30 10:15:06 +02:00
|
|
|
#endif /* PAGE_CUR_LE_OR_EXTENDS */
|
2003-02-18 18:43:41 +01:00
|
|
|
|
2001-02-17 13:19:19 +01:00
|
|
|
/********************************************************************
|
|
|
|
Searches the right position for a page cursor. */
|
|
|
|
|
|
|
|
void
|
|
|
|
page_cur_search_with_match(
|
|
|
|
/*=======================*/
|
|
|
|
page_t* page, /* in: index page */
|
2004-12-02 18:45:07 +01:00
|
|
|
dict_index_t* index, /* in: record descriptor */
|
2001-02-17 13:19:19 +01:00
|
|
|
dtuple_t* tuple, /* in: data tuple */
|
|
|
|
ulint mode, /* in: PAGE_CUR_L, PAGE_CUR_LE, PAGE_CUR_G,
|
|
|
|
or PAGE_CUR_GE */
|
|
|
|
ulint* iup_matched_fields,
|
|
|
|
/* in/out: already matched fields in upper
|
|
|
|
limit record */
|
|
|
|
ulint* iup_matched_bytes,
|
|
|
|
/* in/out: already matched bytes in a field
|
|
|
|
not yet completely matched */
|
|
|
|
ulint* ilow_matched_fields,
|
|
|
|
/* in/out: already matched fields in lower
|
|
|
|
limit record */
|
|
|
|
ulint* ilow_matched_bytes,
|
|
|
|
/* in/out: already matched bytes in a field
|
|
|
|
not yet completely matched */
|
|
|
|
page_cur_t* cursor) /* out: page cursor */
|
|
|
|
{
|
|
|
|
ulint up;
|
|
|
|
ulint low;
|
|
|
|
ulint mid;
|
|
|
|
page_dir_slot_t* slot;
|
|
|
|
rec_t* up_rec;
|
|
|
|
rec_t* low_rec;
|
|
|
|
rec_t* mid_rec;
|
|
|
|
ulint up_matched_fields;
|
|
|
|
ulint up_matched_bytes;
|
|
|
|
ulint low_matched_fields;
|
|
|
|
ulint low_matched_bytes;
|
|
|
|
ulint cur_matched_fields;
|
|
|
|
ulint cur_matched_bytes;
|
|
|
|
int cmp;
|
|
|
|
#ifdef UNIV_SEARCH_DEBUG
|
|
|
|
int dbg_cmp;
|
|
|
|
ulint dbg_matched_fields;
|
|
|
|
ulint dbg_matched_bytes;
|
|
|
|
#endif
|
2004-12-09 14:29:55 +01:00
|
|
|
mem_heap_t* heap = NULL;
|
2005-03-10 14:16:16 +01:00
|
|
|
ulint offsets_[REC_OFFS_NORMAL_SIZE];
|
2004-12-09 14:29:55 +01:00
|
|
|
ulint* offsets = offsets_;
|
2005-03-09 21:04:55 +01:00
|
|
|
*offsets_ = (sizeof offsets_) / sizeof *offsets_;
|
2004-12-02 18:45:07 +01:00
|
|
|
|
2001-02-17 13:19:19 +01:00
|
|
|
ut_ad(page && tuple && iup_matched_fields && iup_matched_bytes
|
|
|
|
&& ilow_matched_fields && ilow_matched_bytes && cursor);
|
|
|
|
ut_ad(dtuple_validate(tuple));
|
|
|
|
ut_ad(dtuple_check_typed(tuple));
|
2005-07-05 11:10:20 +02:00
|
|
|
#ifdef UNIV_DEBUG
|
|
|
|
# ifdef PAGE_CUR_DBG
|
|
|
|
if (mode != PAGE_CUR_DBG)
|
|
|
|
# endif /* PAGE_CUR_DBG */
|
|
|
|
# ifdef PAGE_CUR_LE_OR_EXTENDS
|
|
|
|
if (mode != PAGE_CUR_LE_OR_EXTENDS)
|
|
|
|
# endif /* PAGE_CUR_LE_OR_EXTENDS */
|
2001-02-17 13:19:19 +01:00
|
|
|
ut_ad((mode == PAGE_CUR_L) || (mode == PAGE_CUR_LE)
|
2005-06-30 10:15:06 +02:00
|
|
|
|| (mode == PAGE_CUR_G) || (mode == PAGE_CUR_GE));
|
2005-07-05 11:10:20 +02:00
|
|
|
#endif /* UNIV_DEBUG */
|
2005-06-30 10:15:06 +02:00
|
|
|
|
2003-06-15 00:04:28 +02:00
|
|
|
page_check_dir(page);
|
|
|
|
|
2001-02-17 13:19:19 +01:00
|
|
|
#ifdef PAGE_CUR_ADAPT
|
|
|
|
if ((page_header_get_field(page, PAGE_LEVEL) == 0)
|
|
|
|
&& (mode == PAGE_CUR_LE)
|
|
|
|
&& (page_header_get_field(page, PAGE_N_DIRECTION) > 3)
|
|
|
|
&& (page_header_get_ptr(page, PAGE_LAST_INSERT))
|
|
|
|
&& (page_header_get_field(page, PAGE_DIRECTION) == PAGE_RIGHT)) {
|
|
|
|
|
2004-12-02 18:45:07 +01:00
|
|
|
if (page_cur_try_search_shortcut(page, index, tuple,
|
2001-02-17 13:19:19 +01:00
|
|
|
iup_matched_fields,
|
|
|
|
iup_matched_bytes,
|
|
|
|
ilow_matched_fields,
|
|
|
|
ilow_matched_bytes,
|
|
|
|
cursor)) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
2005-06-30 10:15:06 +02:00
|
|
|
# ifdef PAGE_CUR_DBG
|
2001-02-17 13:19:19 +01:00
|
|
|
if (mode == PAGE_CUR_DBG) {
|
|
|
|
mode = PAGE_CUR_LE;
|
|
|
|
}
|
2005-06-30 10:15:06 +02:00
|
|
|
# endif
|
2001-02-17 13:19:19 +01:00
|
|
|
#endif
|
2003-02-07 16:44:09 +01:00
|
|
|
|
|
|
|
/* The following flag does not work for non-latin1 char sets because
|
|
|
|
cmp_full_field does not tell how many bytes matched */
|
2005-06-30 10:15:06 +02:00
|
|
|
#ifdef PAGE_CUR_LE_OR_EXTENDS
|
2003-02-07 16:44:09 +01:00
|
|
|
ut_a(mode != PAGE_CUR_LE_OR_EXTENDS);
|
2005-06-30 10:15:06 +02:00
|
|
|
#endif /* PAGE_CUR_LE_OR_EXTENDS */
|
2003-02-07 16:44:09 +01:00
|
|
|
|
2001-02-17 13:19:19 +01:00
|
|
|
/* If mode PAGE_CUR_G is specified, we are trying to position the
|
|
|
|
cursor to answer a query of the form "tuple < X", where tuple is
|
|
|
|
the input parameter, and X denotes an arbitrary physical record on
|
|
|
|
the page. We want to position the cursor on the first X which
|
|
|
|
satisfies the condition. */
|
|
|
|
|
|
|
|
up_matched_fields = *iup_matched_fields;
|
|
|
|
up_matched_bytes = *iup_matched_bytes;
|
|
|
|
low_matched_fields = *ilow_matched_fields;
|
|
|
|
low_matched_bytes = *ilow_matched_bytes;
|
|
|
|
|
|
|
|
/* Perform binary search. First the search is done through the page
|
|
|
|
directory, after that as a linear search in the list of records
|
|
|
|
owned by the upper limit directory slot. */
|
|
|
|
|
|
|
|
low = 0;
|
|
|
|
up = page_dir_get_n_slots(page) - 1;
|
|
|
|
|
|
|
|
/* Perform binary search until the lower and upper limit directory
|
|
|
|
slots come to the distance 1 of each other */
|
|
|
|
|
|
|
|
while (up - low > 1) {
|
|
|
|
mid = (low + up) / 2;
|
|
|
|
slot = page_dir_get_nth_slot(page, mid);
|
|
|
|
mid_rec = page_dir_slot_get_rec(slot);
|
|
|
|
|
|
|
|
ut_pair_min(&cur_matched_fields, &cur_matched_bytes,
|
|
|
|
low_matched_fields, low_matched_bytes,
|
|
|
|
up_matched_fields, up_matched_bytes);
|
|
|
|
|
2004-12-09 14:29:55 +01:00
|
|
|
offsets = rec_get_offsets(mid_rec, index, offsets,
|
|
|
|
dtuple_get_n_fields_cmp(tuple), &heap);
|
2004-12-02 18:45:07 +01:00
|
|
|
|
|
|
|
cmp = cmp_dtuple_rec_with_match(tuple, mid_rec, offsets,
|
2001-02-17 13:19:19 +01:00
|
|
|
&cur_matched_fields,
|
|
|
|
&cur_matched_bytes);
|
2005-06-30 10:15:06 +02:00
|
|
|
if (UNIV_LIKELY(cmp > 0)) {
|
|
|
|
low_slot_match:
|
2001-02-17 13:19:19 +01:00
|
|
|
low = mid;
|
|
|
|
low_matched_fields = cur_matched_fields;
|
|
|
|
low_matched_bytes = cur_matched_bytes;
|
|
|
|
|
2005-06-30 10:15:06 +02:00
|
|
|
} else if (UNIV_LIKELY(cmp /* == -1 */)) {
|
|
|
|
#ifdef PAGE_CUR_LE_OR_EXTENDS
|
Many files:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
mysqld.cc:
Change MySQL default isolation level to REPEATABLE READ; note that InnoDB has always had that default, and BDB and MyISAM always run at SERIALIZABLE level anyway
sql/mysqld.cc:
Change MySQL default isolation level to REPEATABLE READ; note that InnoDB has always had that default, and BDB and MyISAM always run at SERIALIZABLE level anyway
sql/ha_innodb.cc:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
sql/ha_innodb.h:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/include/buf0buf.h:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/include/dict0dict.h:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/include/fil0fil.h:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/include/lock0lock.h:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/include/os0file.h:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/include/os0proc.h:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/include/os0thread.h:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/include/page0cur.h:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/include/page0page.h:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/include/read0read.h:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/include/rem0rec.h:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/include/srv0srv.h:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/include/sync0rw.h:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/include/sync0sync.h:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/include/trx0purge.h:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/include/trx0trx.h:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/include/rem0rec.ic:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/btr/btr0btr.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/btr/btr0cur.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/btr/btr0pcur.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/buf/buf0buf.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/buf/buf0flu.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/dict/dict0dict.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/fil/fil0fil.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/fsp/fsp0fsp.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/ibuf/ibuf0ibuf.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/lock/lock0lock.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/mem/mem0dbg.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/os/os0file.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/os/os0proc.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/page/page0cur.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/page/page0page.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/pars/lexyy.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/pars/pars0grm.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/read/read0read.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/row/row0ins.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/row/row0mysql.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/row/row0purge.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/row/row0sel.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/row/row0uins.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/row/row0undo.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/row/row0upd.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/srv/srv0srv.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/srv/srv0start.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/sync/sync0rw.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/sync/sync0sync.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/trx/trx0purge.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/trx/trx0trx.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
2002-10-29 22:16:46 +01:00
|
|
|
if (mode == PAGE_CUR_LE_OR_EXTENDS
|
2003-02-18 18:43:41 +01:00
|
|
|
&& page_cur_rec_field_extends(tuple, mid_rec,
|
2004-12-02 18:45:07 +01:00
|
|
|
offsets, cur_matched_fields)) {
|
2001-02-17 13:19:19 +01:00
|
|
|
|
2005-06-30 10:15:06 +02:00
|
|
|
goto low_slot_match;
|
|
|
|
}
|
|
|
|
#endif /* PAGE_CUR_LE_OR_EXTENDS */
|
|
|
|
up_slot_match:
|
2001-02-17 13:19:19 +01:00
|
|
|
up = mid;
|
|
|
|
up_matched_fields = cur_matched_fields;
|
|
|
|
up_matched_bytes = cur_matched_bytes;
|
2005-06-30 10:15:06 +02:00
|
|
|
|
|
|
|
} else if (mode == PAGE_CUR_G || mode == PAGE_CUR_LE
|
|
|
|
#ifdef PAGE_CUR_LE_OR_EXTENDS
|
|
|
|
|| mode == PAGE_CUR_LE_OR_EXTENDS
|
|
|
|
#endif /* PAGE_CUR_LE_OR_EXTENDS */
|
|
|
|
) {
|
|
|
|
|
|
|
|
goto low_slot_match;
|
|
|
|
} else {
|
|
|
|
|
|
|
|
goto up_slot_match;
|
2001-02-17 13:19:19 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
slot = page_dir_get_nth_slot(page, low);
|
|
|
|
low_rec = page_dir_slot_get_rec(slot);
|
|
|
|
slot = page_dir_get_nth_slot(page, up);
|
|
|
|
up_rec = page_dir_slot_get_rec(slot);
|
|
|
|
|
Many files:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
mysqld.cc:
Change MySQL default isolation level to REPEATABLE READ; note that InnoDB has always had that default, and BDB and MyISAM always run at SERIALIZABLE level anyway
sql/mysqld.cc:
Change MySQL default isolation level to REPEATABLE READ; note that InnoDB has always had that default, and BDB and MyISAM always run at SERIALIZABLE level anyway
sql/ha_innodb.cc:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
sql/ha_innodb.h:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/include/buf0buf.h:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/include/dict0dict.h:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/include/fil0fil.h:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/include/lock0lock.h:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/include/os0file.h:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/include/os0proc.h:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/include/os0thread.h:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/include/page0cur.h:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/include/page0page.h:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/include/read0read.h:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/include/rem0rec.h:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/include/srv0srv.h:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/include/sync0rw.h:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/include/sync0sync.h:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/include/trx0purge.h:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/include/trx0trx.h:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/include/rem0rec.ic:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/btr/btr0btr.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/btr/btr0cur.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/btr/btr0pcur.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/buf/buf0buf.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/buf/buf0flu.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/dict/dict0dict.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/fil/fil0fil.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/fsp/fsp0fsp.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/ibuf/ibuf0ibuf.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/lock/lock0lock.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/mem/mem0dbg.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/os/os0file.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/os/os0proc.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/page/page0cur.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/page/page0page.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/pars/lexyy.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/pars/pars0grm.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/read/read0read.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/row/row0ins.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/row/row0mysql.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/row/row0purge.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/row/row0sel.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/row/row0uins.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/row/row0undo.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/row/row0upd.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/srv/srv0srv.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/srv/srv0start.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/sync/sync0rw.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/sync/sync0sync.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/trx/trx0purge.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/trx/trx0trx.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
2002-10-29 22:16:46 +01:00
|
|
|
/* Perform linear search until the upper and lower records come to
|
|
|
|
distance 1 of each other. */
|
2001-02-17 13:19:19 +01:00
|
|
|
|
|
|
|
while (page_rec_get_next(low_rec) != up_rec) {
|
|
|
|
|
|
|
|
mid_rec = page_rec_get_next(low_rec);
|
|
|
|
|
|
|
|
ut_pair_min(&cur_matched_fields, &cur_matched_bytes,
|
|
|
|
low_matched_fields, low_matched_bytes,
|
|
|
|
up_matched_fields, up_matched_bytes);
|
|
|
|
|
2004-12-09 14:29:55 +01:00
|
|
|
offsets = rec_get_offsets(mid_rec, index, offsets,
|
|
|
|
dtuple_get_n_fields_cmp(tuple), &heap);
|
2004-12-02 18:45:07 +01:00
|
|
|
|
|
|
|
cmp = cmp_dtuple_rec_with_match(tuple, mid_rec, offsets,
|
2001-02-17 13:19:19 +01:00
|
|
|
&cur_matched_fields,
|
|
|
|
&cur_matched_bytes);
|
2005-06-30 10:15:06 +02:00
|
|
|
if (UNIV_LIKELY(cmp > 0)) {
|
|
|
|
low_rec_match:
|
2001-02-17 13:19:19 +01:00
|
|
|
low_rec = mid_rec;
|
|
|
|
low_matched_fields = cur_matched_fields;
|
|
|
|
low_matched_bytes = cur_matched_bytes;
|
|
|
|
|
2005-06-30 10:15:06 +02:00
|
|
|
} else if (UNIV_LIKELY(cmp /* == -1 */)) {
|
|
|
|
#ifdef PAGE_CUR_LE_OR_EXTENDS
|
Many files:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
mysqld.cc:
Change MySQL default isolation level to REPEATABLE READ; note that InnoDB has always had that default, and BDB and MyISAM always run at SERIALIZABLE level anyway
sql/mysqld.cc:
Change MySQL default isolation level to REPEATABLE READ; note that InnoDB has always had that default, and BDB and MyISAM always run at SERIALIZABLE level anyway
sql/ha_innodb.cc:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
sql/ha_innodb.h:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/include/buf0buf.h:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/include/dict0dict.h:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/include/fil0fil.h:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/include/lock0lock.h:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/include/os0file.h:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/include/os0proc.h:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/include/os0thread.h:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/include/page0cur.h:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/include/page0page.h:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/include/read0read.h:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/include/rem0rec.h:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/include/srv0srv.h:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/include/sync0rw.h:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/include/sync0sync.h:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/include/trx0purge.h:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/include/trx0trx.h:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/include/rem0rec.ic:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/btr/btr0btr.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/btr/btr0cur.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/btr/btr0pcur.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/buf/buf0buf.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/buf/buf0flu.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/dict/dict0dict.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/fil/fil0fil.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/fsp/fsp0fsp.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/ibuf/ibuf0ibuf.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/lock/lock0lock.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/mem/mem0dbg.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/os/os0file.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/os/os0proc.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/page/page0cur.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/page/page0page.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/pars/lexyy.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/pars/pars0grm.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/read/read0read.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/row/row0ins.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/row/row0mysql.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/row/row0purge.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/row/row0sel.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/row/row0uins.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/row/row0undo.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/row/row0upd.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/srv/srv0srv.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/srv/srv0start.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/sync/sync0rw.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/sync/sync0sync.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/trx/trx0purge.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/trx/trx0trx.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
2002-10-29 22:16:46 +01:00
|
|
|
if (mode == PAGE_CUR_LE_OR_EXTENDS
|
2003-02-18 18:43:41 +01:00
|
|
|
&& page_cur_rec_field_extends(tuple, mid_rec,
|
2004-12-02 18:45:07 +01:00
|
|
|
offsets, cur_matched_fields)) {
|
2005-06-30 10:15:06 +02:00
|
|
|
|
|
|
|
goto low_rec_match;
|
Many files:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
mysqld.cc:
Change MySQL default isolation level to REPEATABLE READ; note that InnoDB has always had that default, and BDB and MyISAM always run at SERIALIZABLE level anyway
sql/mysqld.cc:
Change MySQL default isolation level to REPEATABLE READ; note that InnoDB has always had that default, and BDB and MyISAM always run at SERIALIZABLE level anyway
sql/ha_innodb.cc:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
sql/ha_innodb.h:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/include/buf0buf.h:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/include/dict0dict.h:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/include/fil0fil.h:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/include/lock0lock.h:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/include/os0file.h:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/include/os0proc.h:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/include/os0thread.h:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/include/page0cur.h:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/include/page0page.h:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/include/read0read.h:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/include/rem0rec.h:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/include/srv0srv.h:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/include/sync0rw.h:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/include/sync0sync.h:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/include/trx0purge.h:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/include/trx0trx.h:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/include/rem0rec.ic:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/btr/btr0btr.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/btr/btr0cur.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/btr/btr0pcur.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/buf/buf0buf.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/buf/buf0flu.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/dict/dict0dict.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/fil/fil0fil.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/fsp/fsp0fsp.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/ibuf/ibuf0ibuf.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/lock/lock0lock.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/mem/mem0dbg.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/os/os0file.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/os/os0proc.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/page/page0cur.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/page/page0page.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/pars/lexyy.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/pars/pars0grm.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/read/read0read.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/row/row0ins.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/row/row0mysql.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/row/row0purge.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/row/row0sel.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/row/row0uins.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/row/row0undo.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/row/row0upd.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/srv/srv0srv.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/srv/srv0start.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/sync/sync0rw.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/sync/sync0sync.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/trx/trx0purge.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/trx/trx0trx.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
2002-10-29 22:16:46 +01:00
|
|
|
}
|
2005-06-30 10:15:06 +02:00
|
|
|
#endif /* PAGE_CUR_LE_OR_EXTENDS */
|
|
|
|
up_rec_match:
|
2001-02-17 13:19:19 +01:00
|
|
|
up_rec = mid_rec;
|
|
|
|
up_matched_fields = cur_matched_fields;
|
|
|
|
up_matched_bytes = cur_matched_bytes;
|
2005-06-30 10:15:06 +02:00
|
|
|
} else if (mode == PAGE_CUR_G || mode == PAGE_CUR_LE
|
|
|
|
#ifdef PAGE_CUR_LE_OR_EXTENDS
|
|
|
|
|| mode == PAGE_CUR_LE_OR_EXTENDS
|
|
|
|
#endif /* PAGE_CUR_LE_OR_EXTENDS */
|
|
|
|
) {
|
|
|
|
|
|
|
|
goto low_rec_match;
|
|
|
|
} else {
|
|
|
|
|
|
|
|
goto up_rec_match;
|
2001-02-17 13:19:19 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#ifdef UNIV_SEARCH_DEBUG
|
|
|
|
|
|
|
|
/* Check that the lower and upper limit records have the
|
|
|
|
right alphabetical order compared to tuple. */
|
|
|
|
dbg_matched_fields = 0;
|
|
|
|
dbg_matched_bytes = 0;
|
|
|
|
|
2004-12-09 14:29:55 +01:00
|
|
|
offsets = rec_get_offsets(low_rec, index, offsets,
|
|
|
|
ULINT_UNDEFINED, &heap);
|
2004-12-02 18:45:07 +01:00
|
|
|
dbg_cmp = page_cmp_dtuple_rec_with_match(tuple, low_rec, offsets,
|
2001-02-17 13:19:19 +01:00
|
|
|
&dbg_matched_fields,
|
|
|
|
&dbg_matched_bytes);
|
|
|
|
if (mode == PAGE_CUR_G) {
|
|
|
|
ut_a(dbg_cmp >= 0);
|
|
|
|
} else if (mode == PAGE_CUR_GE) {
|
|
|
|
ut_a(dbg_cmp == 1);
|
|
|
|
} else if (mode == PAGE_CUR_L) {
|
|
|
|
ut_a(dbg_cmp == 1);
|
|
|
|
} else if (mode == PAGE_CUR_LE) {
|
|
|
|
ut_a(dbg_cmp >= 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (low_rec != page_get_infimum_rec(page)) {
|
|
|
|
|
|
|
|
ut_a(low_matched_fields == dbg_matched_fields);
|
|
|
|
ut_a(low_matched_bytes == dbg_matched_bytes);
|
|
|
|
}
|
|
|
|
|
|
|
|
dbg_matched_fields = 0;
|
|
|
|
dbg_matched_bytes = 0;
|
|
|
|
|
2004-12-09 14:29:55 +01:00
|
|
|
offsets = rec_get_offsets(up_rec, index, offsets,
|
|
|
|
ULINT_UNDEFINED, &heap);
|
2004-12-02 18:45:07 +01:00
|
|
|
dbg_cmp = page_cmp_dtuple_rec_with_match(tuple, up_rec, offsets,
|
2001-02-17 13:19:19 +01:00
|
|
|
&dbg_matched_fields,
|
|
|
|
&dbg_matched_bytes);
|
|
|
|
if (mode == PAGE_CUR_G) {
|
|
|
|
ut_a(dbg_cmp == -1);
|
|
|
|
} else if (mode == PAGE_CUR_GE) {
|
|
|
|
ut_a(dbg_cmp <= 0);
|
|
|
|
} else if (mode == PAGE_CUR_L) {
|
|
|
|
ut_a(dbg_cmp <= 0);
|
|
|
|
} else if (mode == PAGE_CUR_LE) {
|
|
|
|
ut_a(dbg_cmp == -1);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (up_rec != page_get_supremum_rec(page)) {
|
|
|
|
|
|
|
|
ut_a(up_matched_fields == dbg_matched_fields);
|
|
|
|
ut_a(up_matched_bytes == dbg_matched_bytes);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
if (mode <= PAGE_CUR_GE) {
|
|
|
|
cursor->rec = up_rec;
|
|
|
|
} else {
|
|
|
|
cursor->rec = low_rec;
|
|
|
|
}
|
|
|
|
|
|
|
|
*iup_matched_fields = up_matched_fields;
|
|
|
|
*iup_matched_bytes = up_matched_bytes;
|
|
|
|
*ilow_matched_fields = low_matched_fields;
|
|
|
|
*ilow_matched_bytes = low_matched_bytes;
|
2005-04-21 13:23:26 +02:00
|
|
|
if (UNIV_LIKELY_NULL(heap)) {
|
2004-12-09 14:29:55 +01:00
|
|
|
mem_heap_free(heap);
|
|
|
|
}
|
2001-02-17 13:19:19 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/***************************************************************
|
|
|
|
Positions a page cursor on a randomly chosen user record on a page. If there
|
|
|
|
are no user records, sets the cursor on the infimum record. */
|
|
|
|
|
|
|
|
void
|
|
|
|
page_cur_open_on_rnd_user_rec(
|
|
|
|
/*==========================*/
|
|
|
|
page_t* page, /* in: page */
|
|
|
|
page_cur_t* cursor) /* in/out: page cursor */
|
|
|
|
{
|
|
|
|
ulint rnd;
|
|
|
|
rec_t* rec;
|
|
|
|
|
|
|
|
if (page_get_n_recs(page) == 0) {
|
|
|
|
page_cur_position(page_get_infimum_rec(page), cursor);
|
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
page_rnd += 87584577;
|
|
|
|
|
|
|
|
rnd = page_rnd % page_get_n_recs(page);
|
|
|
|
|
|
|
|
rec = page_get_infimum_rec(page);
|
|
|
|
|
|
|
|
rec = page_rec_get_next(rec);
|
|
|
|
|
|
|
|
while (rnd > 0) {
|
|
|
|
rec = page_rec_get_next(rec);
|
|
|
|
|
|
|
|
rnd--;
|
|
|
|
}
|
|
|
|
|
|
|
|
page_cur_position(rec, cursor);
|
|
|
|
}
|
|
|
|
|
|
|
|
/***************************************************************
|
|
|
|
Writes the log record of a record insert on a page. */
|
|
|
|
static
|
|
|
|
void
|
|
|
|
page_cur_insert_rec_write_log(
|
|
|
|
/*==========================*/
|
2004-12-02 18:45:07 +01:00
|
|
|
rec_t* insert_rec, /* in: inserted physical record */
|
|
|
|
ulint rec_size, /* in: insert_rec size */
|
|
|
|
rec_t* cursor_rec, /* in: record the
|
|
|
|
cursor is pointing to */
|
|
|
|
dict_index_t* index, /* in: record descriptor */
|
|
|
|
mtr_t* mtr) /* in: mini-transaction handle */
|
2001-02-17 13:19:19 +01:00
|
|
|
{
|
|
|
|
ulint cur_rec_size;
|
|
|
|
ulint extra_size;
|
|
|
|
ulint cur_extra_size;
|
|
|
|
ulint min_rec_size;
|
|
|
|
byte* ins_ptr;
|
|
|
|
byte* cur_ptr;
|
|
|
|
ulint extra_info_yes;
|
|
|
|
byte* log_ptr;
|
2004-12-02 18:45:07 +01:00
|
|
|
byte* log_end;
|
2001-02-17 13:19:19 +01:00
|
|
|
ulint i;
|
InnoDB: Performance optimizations based on OProfile analysis
innobase/btr/btr0btr.c:
Eliminate some buf_frame_align() calls.
Make use of the page_rec_is_infimum(), page_rec_is_supremum()
and page_rec_is_user_rec() functions.
Replace some index->table->comp with page_is_comp().
Eliminate some variables to reduce register spilling on x86.
Note that page_is_comp() may return nonzero instead of TRUE.
Note that rec_offs_comp() may return nonzero instead of TRUE.
innobase/btr/btr0cur.c:
Eliminate some buf_frame_align() calls.
Replace some index->table->comp with
page_is_comp() or rec_offs_comp().
Eliminate some variables to reduce register spilling on x86.
Note that page_is_comp() may return nonzero instead of TRUE.
Note that rec_offs_comp() may return nonzero instead of TRUE.
Remove an extra mem_heap_create() call from btr_cur_update_in_place().
Add "page" parameter to lock_rec_store_on_page_infimum().
Add some UNIV_LIKELY() and UNIV_UNLIKELY() hints.
btr_estimate_number_of_different_key_vals(): Rename the
offsets_* variables to be more descriptive and eliminate one
rec_get_offsets() and one page_rec_get_next() call in the loop.
innobase/btr/btr0pcur.c:
Eliminate some buf_frame_align() calls.
Make use of the page_rec_is_infimum(), page_rec_is_supremum()
and page_rec_is_user_rec() functions.
Replace some index->table->comp with page_is_comp().
Eliminate some variables to reduce register spilling on x86.
Note that page_is_comp() may return nonzero instead of TRUE.
Make some ut_a() assertions ut_ad() ones to improve performance.
Add some UNIV_LIKELY() and UNIV_UNLIKELY() hints.
innobase/btr/btr0sea.c:
Make use of page_rec_is_infimum() and page_rec_is_supremum().
Eliminate some buf_frame_align() calls.
Add some UNIV_UNLIKELY and UNIV_LIKELY hints.
Turn some assertions into debug assertions.
innobase/dict/dict0crea.c:
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp
innobase/ibuf/ibuf0ibuf.c:
Make use of page_rec_is_infimum() and page_rec_is_supremum().
Add some UNIV_UNLIKELY and UNIV_LIKELY hints.
ibuf_get_merge_page_nos(): Rename parameter "first_rec" to "rec"
and eliminate local variable "rec".
innobase/include/btr0btr.h:
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp
innobase/include/buf0buf.h:
Rename buf_frame_get_modify_clock()
to buf_block_get_modify_clock().
innobase/include/buf0buf.ic:
Rename buf_frame_get_modify_clock()
to buf_block_get_modify_clock() and
remove the buf_block_align() call.
innobase/include/lock0lock.h:
lock_rec_store_on_page_infimum(): Add parameter "page"
innobase/include/mach0data.h:
Add mach_encode_2() and mach_decode_2().
innobase/include/mach0data.ic:
Add mach_encode_2() and mach_decode_2().
innobase/include/page0cur.h:
Add const qualifier to page_cur_is_before_first()
and page_cur_is_after_last().
innobase/include/page0cur.ic:
Make use of page_rec_is_infimum() and page_rec_is_supremum().
innobase/include/page0page.h:
Remove page_rec_is_first_user_rec() and page_rec_is_last_user_rec().
Add page_rec_is_infimum() and page_rec_is_supremum().
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp.
innobase/include/page0page.ic:
Remove page_rec_is_first_user_rec() and page_rec_is_last_user_rec().
Add page_rec_is_infimum() and page_rec_is_supremum().
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp.
Add UNIV_UNLIKELY, UNIV_LIKELY and UNIV_EXPECT hints.
Reduce the number of buf_frame_align() calls.
innobase/include/rem0rec.ic:
rec_offs_comp(): Return zero or nonzero instead of FALSE or TRUE.
innobase/include/row0mysql.h:
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp.
innobase/lock/lock0lock.c:
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp.
Remove parameter "comp" from lock_rec_get_next(),
lock_rec_has_expl() and lock_rec_other_has_expl_req().
Add parameter "page" to lock_rec_store_on_page_infimum().
Add UNIV_UNLIKELY hints.
Reduce the number of buf_frame_align() calls.
Make use of page_rec_is_infimum(), page_rec_is_supremum() and
page_rec_is_user_rec().
Move the "comp" flag outside some loops.
innobase/mtr/mtr0log.c:
Replace index->table->comp with page_rec_is_comp().
innobase/page/page0cur.c:
Replace index->table->comp with page_is_comp() or page_rec_is_comp().
Eliminate some buf_frame_align() calls.
Add some debug assertions.
innobase/page/page0page.c:
Optimize page_dir_find_owner_slot(). Compare the record offset
16 bits at a time, because that seems to be the only way to avoid
register spilling on x86.
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp.
Remove parameter "page" of page_delete_rec_list_write_log().
Make use of page_rec_is_infimum().
innobase/rem/rem0cmp.c:
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp.
innobase/row/row0ins.c:
Make use of page_rec_is_infimum() and page_rec_is_supremum().
Reduce the amount of buf_frame_align() calls.
row_ins_index_entry_low(): Disable assertion about column count
unless #ifdef UNIV_DEBUG.
innobase/row/row0mysql.c:
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp.
innobase/row/row0row.c:
Eliminate some buf_frame_align() calls.
Make use of page_rec_is_infimum().
innobase/row/row0sel.c:
Make use of page_rec_is_supremum() and page_rec_is_infimum().
Turn some assertions into debug assertions.
Add UNIV_LIKELY and UNIV_UNLIKELY hints.
row_search_for_mysql(): Eliminate local variables "moved",
"cons_read_requires_clust_rec", "was_lock_wait", "shortcut",
"success" and "comp". Replace some of them with goto's.
Disable variable "cnt" unless #ifdef UNIV_SEARCH_DEBUG.
innobase/row/row0vers.c:
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp.
Replace index->table->comp with page_rec_is_comp().
Eliminate some buf_frame_align() calls.
2005-04-25 09:14:35 +02:00
|
|
|
ulint comp;
|
2001-02-17 13:19:19 +01:00
|
|
|
|
2002-06-22 19:41:14 +02:00
|
|
|
ut_a(rec_size < UNIV_PAGE_SIZE);
|
InnoDB: Performance optimizations based on OProfile analysis
innobase/btr/btr0btr.c:
Eliminate some buf_frame_align() calls.
Make use of the page_rec_is_infimum(), page_rec_is_supremum()
and page_rec_is_user_rec() functions.
Replace some index->table->comp with page_is_comp().
Eliminate some variables to reduce register spilling on x86.
Note that page_is_comp() may return nonzero instead of TRUE.
Note that rec_offs_comp() may return nonzero instead of TRUE.
innobase/btr/btr0cur.c:
Eliminate some buf_frame_align() calls.
Replace some index->table->comp with
page_is_comp() or rec_offs_comp().
Eliminate some variables to reduce register spilling on x86.
Note that page_is_comp() may return nonzero instead of TRUE.
Note that rec_offs_comp() may return nonzero instead of TRUE.
Remove an extra mem_heap_create() call from btr_cur_update_in_place().
Add "page" parameter to lock_rec_store_on_page_infimum().
Add some UNIV_LIKELY() and UNIV_UNLIKELY() hints.
btr_estimate_number_of_different_key_vals(): Rename the
offsets_* variables to be more descriptive and eliminate one
rec_get_offsets() and one page_rec_get_next() call in the loop.
innobase/btr/btr0pcur.c:
Eliminate some buf_frame_align() calls.
Make use of the page_rec_is_infimum(), page_rec_is_supremum()
and page_rec_is_user_rec() functions.
Replace some index->table->comp with page_is_comp().
Eliminate some variables to reduce register spilling on x86.
Note that page_is_comp() may return nonzero instead of TRUE.
Make some ut_a() assertions ut_ad() ones to improve performance.
Add some UNIV_LIKELY() and UNIV_UNLIKELY() hints.
innobase/btr/btr0sea.c:
Make use of page_rec_is_infimum() and page_rec_is_supremum().
Eliminate some buf_frame_align() calls.
Add some UNIV_UNLIKELY and UNIV_LIKELY hints.
Turn some assertions into debug assertions.
innobase/dict/dict0crea.c:
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp
innobase/ibuf/ibuf0ibuf.c:
Make use of page_rec_is_infimum() and page_rec_is_supremum().
Add some UNIV_UNLIKELY and UNIV_LIKELY hints.
ibuf_get_merge_page_nos(): Rename parameter "first_rec" to "rec"
and eliminate local variable "rec".
innobase/include/btr0btr.h:
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp
innobase/include/buf0buf.h:
Rename buf_frame_get_modify_clock()
to buf_block_get_modify_clock().
innobase/include/buf0buf.ic:
Rename buf_frame_get_modify_clock()
to buf_block_get_modify_clock() and
remove the buf_block_align() call.
innobase/include/lock0lock.h:
lock_rec_store_on_page_infimum(): Add parameter "page"
innobase/include/mach0data.h:
Add mach_encode_2() and mach_decode_2().
innobase/include/mach0data.ic:
Add mach_encode_2() and mach_decode_2().
innobase/include/page0cur.h:
Add const qualifier to page_cur_is_before_first()
and page_cur_is_after_last().
innobase/include/page0cur.ic:
Make use of page_rec_is_infimum() and page_rec_is_supremum().
innobase/include/page0page.h:
Remove page_rec_is_first_user_rec() and page_rec_is_last_user_rec().
Add page_rec_is_infimum() and page_rec_is_supremum().
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp.
innobase/include/page0page.ic:
Remove page_rec_is_first_user_rec() and page_rec_is_last_user_rec().
Add page_rec_is_infimum() and page_rec_is_supremum().
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp.
Add UNIV_UNLIKELY, UNIV_LIKELY and UNIV_EXPECT hints.
Reduce the number of buf_frame_align() calls.
innobase/include/rem0rec.ic:
rec_offs_comp(): Return zero or nonzero instead of FALSE or TRUE.
innobase/include/row0mysql.h:
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp.
innobase/lock/lock0lock.c:
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp.
Remove parameter "comp" from lock_rec_get_next(),
lock_rec_has_expl() and lock_rec_other_has_expl_req().
Add parameter "page" to lock_rec_store_on_page_infimum().
Add UNIV_UNLIKELY hints.
Reduce the number of buf_frame_align() calls.
Make use of page_rec_is_infimum(), page_rec_is_supremum() and
page_rec_is_user_rec().
Move the "comp" flag outside some loops.
innobase/mtr/mtr0log.c:
Replace index->table->comp with page_rec_is_comp().
innobase/page/page0cur.c:
Replace index->table->comp with page_is_comp() or page_rec_is_comp().
Eliminate some buf_frame_align() calls.
Add some debug assertions.
innobase/page/page0page.c:
Optimize page_dir_find_owner_slot(). Compare the record offset
16 bits at a time, because that seems to be the only way to avoid
register spilling on x86.
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp.
Remove parameter "page" of page_delete_rec_list_write_log().
Make use of page_rec_is_infimum().
innobase/rem/rem0cmp.c:
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp.
innobase/row/row0ins.c:
Make use of page_rec_is_infimum() and page_rec_is_supremum().
Reduce the amount of buf_frame_align() calls.
row_ins_index_entry_low(): Disable assertion about column count
unless #ifdef UNIV_DEBUG.
innobase/row/row0mysql.c:
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp.
innobase/row/row0row.c:
Eliminate some buf_frame_align() calls.
Make use of page_rec_is_infimum().
innobase/row/row0sel.c:
Make use of page_rec_is_supremum() and page_rec_is_infimum().
Turn some assertions into debug assertions.
Add UNIV_LIKELY and UNIV_UNLIKELY hints.
row_search_for_mysql(): Eliminate local variables "moved",
"cons_read_requires_clust_rec", "was_lock_wait", "shortcut",
"success" and "comp". Replace some of them with goto's.
Disable variable "cnt" unless #ifdef UNIV_SEARCH_DEBUG.
innobase/row/row0vers.c:
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp.
Replace index->table->comp with page_rec_is_comp().
Eliminate some buf_frame_align() calls.
2005-04-25 09:14:35 +02:00
|
|
|
ut_ad(buf_frame_align(insert_rec) == buf_frame_align(cursor_rec));
|
|
|
|
ut_ad(!page_rec_is_comp(insert_rec) == !index->table->comp);
|
|
|
|
comp = page_rec_is_comp(insert_rec);
|
2002-06-22 19:41:14 +02:00
|
|
|
|
2004-12-02 18:45:07 +01:00
|
|
|
{
|
2004-12-09 14:29:55 +01:00
|
|
|
mem_heap_t* heap = NULL;
|
2005-03-10 14:16:16 +01:00
|
|
|
ulint cur_offs_[REC_OFFS_NORMAL_SIZE];
|
|
|
|
ulint ins_offs_[REC_OFFS_NORMAL_SIZE];
|
2004-12-09 14:29:55 +01:00
|
|
|
|
2004-12-02 18:45:07 +01:00
|
|
|
ulint* cur_offs;
|
|
|
|
ulint* ins_offs;
|
2001-02-17 13:19:19 +01:00
|
|
|
|
2005-03-09 21:04:55 +01:00
|
|
|
*cur_offs_ = (sizeof cur_offs_) / sizeof *cur_offs_;
|
|
|
|
*ins_offs_ = (sizeof ins_offs_) / sizeof *ins_offs_;
|
|
|
|
|
2004-12-09 14:29:55 +01:00
|
|
|
cur_offs = rec_get_offsets(cursor_rec, index, cur_offs_,
|
|
|
|
ULINT_UNDEFINED, &heap);
|
|
|
|
ins_offs = rec_get_offsets(insert_rec, index, ins_offs_,
|
|
|
|
ULINT_UNDEFINED, &heap);
|
2001-02-17 13:19:19 +01:00
|
|
|
|
2004-12-02 18:45:07 +01:00
|
|
|
extra_size = rec_offs_extra_size(ins_offs);
|
|
|
|
cur_extra_size = rec_offs_extra_size(cur_offs);
|
|
|
|
ut_ad(rec_size == rec_offs_size(ins_offs));
|
|
|
|
cur_rec_size = rec_offs_size(cur_offs);
|
2001-02-17 13:19:19 +01:00
|
|
|
|
2005-04-21 13:23:26 +02:00
|
|
|
if (UNIV_LIKELY_NULL(heap)) {
|
2004-12-09 14:29:55 +01:00
|
|
|
mem_heap_free(heap);
|
|
|
|
}
|
2004-12-02 18:45:07 +01:00
|
|
|
}
|
2001-02-17 13:19:19 +01:00
|
|
|
|
|
|
|
ins_ptr = insert_rec - extra_size;
|
|
|
|
|
|
|
|
i = 0;
|
|
|
|
|
|
|
|
if (cur_extra_size == extra_size) {
|
|
|
|
min_rec_size = ut_min(cur_rec_size, rec_size);
|
|
|
|
|
|
|
|
cur_ptr = cursor_rec - cur_extra_size;
|
|
|
|
|
|
|
|
/* Find out the first byte in insert_rec which differs from
|
|
|
|
cursor_rec; skip the bytes in the record info */
|
|
|
|
|
|
|
|
for (;;) {
|
|
|
|
if (i >= min_rec_size) {
|
|
|
|
|
|
|
|
break;
|
|
|
|
} else if (*ins_ptr == *cur_ptr) {
|
|
|
|
i++;
|
|
|
|
ins_ptr++;
|
|
|
|
cur_ptr++;
|
|
|
|
} else if ((i < extra_size)
|
InnoDB: Performance optimizations based on OProfile analysis
innobase/btr/btr0btr.c:
Eliminate some buf_frame_align() calls.
Make use of the page_rec_is_infimum(), page_rec_is_supremum()
and page_rec_is_user_rec() functions.
Replace some index->table->comp with page_is_comp().
Eliminate some variables to reduce register spilling on x86.
Note that page_is_comp() may return nonzero instead of TRUE.
Note that rec_offs_comp() may return nonzero instead of TRUE.
innobase/btr/btr0cur.c:
Eliminate some buf_frame_align() calls.
Replace some index->table->comp with
page_is_comp() or rec_offs_comp().
Eliminate some variables to reduce register spilling on x86.
Note that page_is_comp() may return nonzero instead of TRUE.
Note that rec_offs_comp() may return nonzero instead of TRUE.
Remove an extra mem_heap_create() call from btr_cur_update_in_place().
Add "page" parameter to lock_rec_store_on_page_infimum().
Add some UNIV_LIKELY() and UNIV_UNLIKELY() hints.
btr_estimate_number_of_different_key_vals(): Rename the
offsets_* variables to be more descriptive and eliminate one
rec_get_offsets() and one page_rec_get_next() call in the loop.
innobase/btr/btr0pcur.c:
Eliminate some buf_frame_align() calls.
Make use of the page_rec_is_infimum(), page_rec_is_supremum()
and page_rec_is_user_rec() functions.
Replace some index->table->comp with page_is_comp().
Eliminate some variables to reduce register spilling on x86.
Note that page_is_comp() may return nonzero instead of TRUE.
Make some ut_a() assertions ut_ad() ones to improve performance.
Add some UNIV_LIKELY() and UNIV_UNLIKELY() hints.
innobase/btr/btr0sea.c:
Make use of page_rec_is_infimum() and page_rec_is_supremum().
Eliminate some buf_frame_align() calls.
Add some UNIV_UNLIKELY and UNIV_LIKELY hints.
Turn some assertions into debug assertions.
innobase/dict/dict0crea.c:
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp
innobase/ibuf/ibuf0ibuf.c:
Make use of page_rec_is_infimum() and page_rec_is_supremum().
Add some UNIV_UNLIKELY and UNIV_LIKELY hints.
ibuf_get_merge_page_nos(): Rename parameter "first_rec" to "rec"
and eliminate local variable "rec".
innobase/include/btr0btr.h:
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp
innobase/include/buf0buf.h:
Rename buf_frame_get_modify_clock()
to buf_block_get_modify_clock().
innobase/include/buf0buf.ic:
Rename buf_frame_get_modify_clock()
to buf_block_get_modify_clock() and
remove the buf_block_align() call.
innobase/include/lock0lock.h:
lock_rec_store_on_page_infimum(): Add parameter "page"
innobase/include/mach0data.h:
Add mach_encode_2() and mach_decode_2().
innobase/include/mach0data.ic:
Add mach_encode_2() and mach_decode_2().
innobase/include/page0cur.h:
Add const qualifier to page_cur_is_before_first()
and page_cur_is_after_last().
innobase/include/page0cur.ic:
Make use of page_rec_is_infimum() and page_rec_is_supremum().
innobase/include/page0page.h:
Remove page_rec_is_first_user_rec() and page_rec_is_last_user_rec().
Add page_rec_is_infimum() and page_rec_is_supremum().
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp.
innobase/include/page0page.ic:
Remove page_rec_is_first_user_rec() and page_rec_is_last_user_rec().
Add page_rec_is_infimum() and page_rec_is_supremum().
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp.
Add UNIV_UNLIKELY, UNIV_LIKELY and UNIV_EXPECT hints.
Reduce the number of buf_frame_align() calls.
innobase/include/rem0rec.ic:
rec_offs_comp(): Return zero or nonzero instead of FALSE or TRUE.
innobase/include/row0mysql.h:
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp.
innobase/lock/lock0lock.c:
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp.
Remove parameter "comp" from lock_rec_get_next(),
lock_rec_has_expl() and lock_rec_other_has_expl_req().
Add parameter "page" to lock_rec_store_on_page_infimum().
Add UNIV_UNLIKELY hints.
Reduce the number of buf_frame_align() calls.
Make use of page_rec_is_infimum(), page_rec_is_supremum() and
page_rec_is_user_rec().
Move the "comp" flag outside some loops.
innobase/mtr/mtr0log.c:
Replace index->table->comp with page_rec_is_comp().
innobase/page/page0cur.c:
Replace index->table->comp with page_is_comp() or page_rec_is_comp().
Eliminate some buf_frame_align() calls.
Add some debug assertions.
innobase/page/page0page.c:
Optimize page_dir_find_owner_slot(). Compare the record offset
16 bits at a time, because that seems to be the only way to avoid
register spilling on x86.
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp.
Remove parameter "page" of page_delete_rec_list_write_log().
Make use of page_rec_is_infimum().
innobase/rem/rem0cmp.c:
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp.
innobase/row/row0ins.c:
Make use of page_rec_is_infimum() and page_rec_is_supremum().
Reduce the amount of buf_frame_align() calls.
row_ins_index_entry_low(): Disable assertion about column count
unless #ifdef UNIV_DEBUG.
innobase/row/row0mysql.c:
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp.
innobase/row/row0row.c:
Eliminate some buf_frame_align() calls.
Make use of page_rec_is_infimum().
innobase/row/row0sel.c:
Make use of page_rec_is_supremum() and page_rec_is_infimum().
Turn some assertions into debug assertions.
Add UNIV_LIKELY and UNIV_UNLIKELY hints.
row_search_for_mysql(): Eliminate local variables "moved",
"cons_read_requires_clust_rec", "was_lock_wait", "shortcut",
"success" and "comp". Replace some of them with goto's.
Disable variable "cnt" unless #ifdef UNIV_SEARCH_DEBUG.
innobase/row/row0vers.c:
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp.
Replace index->table->comp with page_rec_is_comp().
Eliminate some buf_frame_align() calls.
2005-04-25 09:14:35 +02:00
|
|
|
&& (i >= extra_size - (comp
|
2004-12-02 18:45:07 +01:00
|
|
|
? REC_N_NEW_EXTRA_BYTES
|
|
|
|
: REC_N_OLD_EXTRA_BYTES))) {
|
2001-02-17 13:19:19 +01:00
|
|
|
i = extra_size;
|
|
|
|
ins_ptr = insert_rec;
|
|
|
|
cur_ptr = cursor_rec;
|
|
|
|
} else {
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (mtr_get_log_mode(mtr) != MTR_LOG_SHORT_INSERTS) {
|
2004-12-02 18:45:07 +01:00
|
|
|
|
|
|
|
log_ptr = mlog_open_and_write_index(mtr, insert_rec, index,
|
InnoDB: Performance optimizations based on OProfile analysis
innobase/btr/btr0btr.c:
Eliminate some buf_frame_align() calls.
Make use of the page_rec_is_infimum(), page_rec_is_supremum()
and page_rec_is_user_rec() functions.
Replace some index->table->comp with page_is_comp().
Eliminate some variables to reduce register spilling on x86.
Note that page_is_comp() may return nonzero instead of TRUE.
Note that rec_offs_comp() may return nonzero instead of TRUE.
innobase/btr/btr0cur.c:
Eliminate some buf_frame_align() calls.
Replace some index->table->comp with
page_is_comp() or rec_offs_comp().
Eliminate some variables to reduce register spilling on x86.
Note that page_is_comp() may return nonzero instead of TRUE.
Note that rec_offs_comp() may return nonzero instead of TRUE.
Remove an extra mem_heap_create() call from btr_cur_update_in_place().
Add "page" parameter to lock_rec_store_on_page_infimum().
Add some UNIV_LIKELY() and UNIV_UNLIKELY() hints.
btr_estimate_number_of_different_key_vals(): Rename the
offsets_* variables to be more descriptive and eliminate one
rec_get_offsets() and one page_rec_get_next() call in the loop.
innobase/btr/btr0pcur.c:
Eliminate some buf_frame_align() calls.
Make use of the page_rec_is_infimum(), page_rec_is_supremum()
and page_rec_is_user_rec() functions.
Replace some index->table->comp with page_is_comp().
Eliminate some variables to reduce register spilling on x86.
Note that page_is_comp() may return nonzero instead of TRUE.
Make some ut_a() assertions ut_ad() ones to improve performance.
Add some UNIV_LIKELY() and UNIV_UNLIKELY() hints.
innobase/btr/btr0sea.c:
Make use of page_rec_is_infimum() and page_rec_is_supremum().
Eliminate some buf_frame_align() calls.
Add some UNIV_UNLIKELY and UNIV_LIKELY hints.
Turn some assertions into debug assertions.
innobase/dict/dict0crea.c:
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp
innobase/ibuf/ibuf0ibuf.c:
Make use of page_rec_is_infimum() and page_rec_is_supremum().
Add some UNIV_UNLIKELY and UNIV_LIKELY hints.
ibuf_get_merge_page_nos(): Rename parameter "first_rec" to "rec"
and eliminate local variable "rec".
innobase/include/btr0btr.h:
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp
innobase/include/buf0buf.h:
Rename buf_frame_get_modify_clock()
to buf_block_get_modify_clock().
innobase/include/buf0buf.ic:
Rename buf_frame_get_modify_clock()
to buf_block_get_modify_clock() and
remove the buf_block_align() call.
innobase/include/lock0lock.h:
lock_rec_store_on_page_infimum(): Add parameter "page"
innobase/include/mach0data.h:
Add mach_encode_2() and mach_decode_2().
innobase/include/mach0data.ic:
Add mach_encode_2() and mach_decode_2().
innobase/include/page0cur.h:
Add const qualifier to page_cur_is_before_first()
and page_cur_is_after_last().
innobase/include/page0cur.ic:
Make use of page_rec_is_infimum() and page_rec_is_supremum().
innobase/include/page0page.h:
Remove page_rec_is_first_user_rec() and page_rec_is_last_user_rec().
Add page_rec_is_infimum() and page_rec_is_supremum().
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp.
innobase/include/page0page.ic:
Remove page_rec_is_first_user_rec() and page_rec_is_last_user_rec().
Add page_rec_is_infimum() and page_rec_is_supremum().
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp.
Add UNIV_UNLIKELY, UNIV_LIKELY and UNIV_EXPECT hints.
Reduce the number of buf_frame_align() calls.
innobase/include/rem0rec.ic:
rec_offs_comp(): Return zero or nonzero instead of FALSE or TRUE.
innobase/include/row0mysql.h:
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp.
innobase/lock/lock0lock.c:
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp.
Remove parameter "comp" from lock_rec_get_next(),
lock_rec_has_expl() and lock_rec_other_has_expl_req().
Add parameter "page" to lock_rec_store_on_page_infimum().
Add UNIV_UNLIKELY hints.
Reduce the number of buf_frame_align() calls.
Make use of page_rec_is_infimum(), page_rec_is_supremum() and
page_rec_is_user_rec().
Move the "comp" flag outside some loops.
innobase/mtr/mtr0log.c:
Replace index->table->comp with page_rec_is_comp().
innobase/page/page0cur.c:
Replace index->table->comp with page_is_comp() or page_rec_is_comp().
Eliminate some buf_frame_align() calls.
Add some debug assertions.
innobase/page/page0page.c:
Optimize page_dir_find_owner_slot(). Compare the record offset
16 bits at a time, because that seems to be the only way to avoid
register spilling on x86.
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp.
Remove parameter "page" of page_delete_rec_list_write_log().
Make use of page_rec_is_infimum().
innobase/rem/rem0cmp.c:
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp.
innobase/row/row0ins.c:
Make use of page_rec_is_infimum() and page_rec_is_supremum().
Reduce the amount of buf_frame_align() calls.
row_ins_index_entry_low(): Disable assertion about column count
unless #ifdef UNIV_DEBUG.
innobase/row/row0mysql.c:
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp.
innobase/row/row0row.c:
Eliminate some buf_frame_align() calls.
Make use of page_rec_is_infimum().
innobase/row/row0sel.c:
Make use of page_rec_is_supremum() and page_rec_is_infimum().
Turn some assertions into debug assertions.
Add UNIV_LIKELY and UNIV_UNLIKELY hints.
row_search_for_mysql(): Eliminate local variables "moved",
"cons_read_requires_clust_rec", "was_lock_wait", "shortcut",
"success" and "comp". Replace some of them with goto's.
Disable variable "cnt" unless #ifdef UNIV_SEARCH_DEBUG.
innobase/row/row0vers.c:
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp.
Replace index->table->comp with page_rec_is_comp().
Eliminate some buf_frame_align() calls.
2005-04-25 09:14:35 +02:00
|
|
|
comp
|
2004-12-02 18:45:07 +01:00
|
|
|
? MLOG_COMP_REC_INSERT : MLOG_REC_INSERT,
|
|
|
|
2 + 5 + 1 + 5 + 5 + MLOG_BUF_MARGIN);
|
|
|
|
|
|
|
|
if (!log_ptr) {
|
|
|
|
/* Logging in mtr is switched off during crash
|
|
|
|
recovery: in that case mlog_open returns NULL */
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
log_end = &log_ptr[2 + 5 + 1 + 5 + 5 + MLOG_BUF_MARGIN];
|
2001-02-17 13:19:19 +01:00
|
|
|
/* Write the cursor rec offset as a 2-byte ulint */
|
|
|
|
mach_write_to_2(log_ptr, cursor_rec
|
|
|
|
- buf_frame_align(cursor_rec));
|
|
|
|
log_ptr += 2;
|
2004-12-02 18:45:07 +01:00
|
|
|
} else {
|
|
|
|
log_ptr = mlog_open(mtr, 5 + 1 + 5 + 5 + MLOG_BUF_MARGIN);
|
|
|
|
if (!log_ptr) {
|
|
|
|
/* Logging in mtr is switched off during crash
|
|
|
|
recovery: in that case mlog_open returns NULL */
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
log_end = &log_ptr[5 + 1 + 5 + 5 + MLOG_BUF_MARGIN];
|
2001-02-17 13:19:19 +01:00
|
|
|
}
|
|
|
|
|
InnoDB: Performance optimizations based on OProfile analysis
innobase/btr/btr0btr.c:
Eliminate some buf_frame_align() calls.
Make use of the page_rec_is_infimum(), page_rec_is_supremum()
and page_rec_is_user_rec() functions.
Replace some index->table->comp with page_is_comp().
Eliminate some variables to reduce register spilling on x86.
Note that page_is_comp() may return nonzero instead of TRUE.
Note that rec_offs_comp() may return nonzero instead of TRUE.
innobase/btr/btr0cur.c:
Eliminate some buf_frame_align() calls.
Replace some index->table->comp with
page_is_comp() or rec_offs_comp().
Eliminate some variables to reduce register spilling on x86.
Note that page_is_comp() may return nonzero instead of TRUE.
Note that rec_offs_comp() may return nonzero instead of TRUE.
Remove an extra mem_heap_create() call from btr_cur_update_in_place().
Add "page" parameter to lock_rec_store_on_page_infimum().
Add some UNIV_LIKELY() and UNIV_UNLIKELY() hints.
btr_estimate_number_of_different_key_vals(): Rename the
offsets_* variables to be more descriptive and eliminate one
rec_get_offsets() and one page_rec_get_next() call in the loop.
innobase/btr/btr0pcur.c:
Eliminate some buf_frame_align() calls.
Make use of the page_rec_is_infimum(), page_rec_is_supremum()
and page_rec_is_user_rec() functions.
Replace some index->table->comp with page_is_comp().
Eliminate some variables to reduce register spilling on x86.
Note that page_is_comp() may return nonzero instead of TRUE.
Make some ut_a() assertions ut_ad() ones to improve performance.
Add some UNIV_LIKELY() and UNIV_UNLIKELY() hints.
innobase/btr/btr0sea.c:
Make use of page_rec_is_infimum() and page_rec_is_supremum().
Eliminate some buf_frame_align() calls.
Add some UNIV_UNLIKELY and UNIV_LIKELY hints.
Turn some assertions into debug assertions.
innobase/dict/dict0crea.c:
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp
innobase/ibuf/ibuf0ibuf.c:
Make use of page_rec_is_infimum() and page_rec_is_supremum().
Add some UNIV_UNLIKELY and UNIV_LIKELY hints.
ibuf_get_merge_page_nos(): Rename parameter "first_rec" to "rec"
and eliminate local variable "rec".
innobase/include/btr0btr.h:
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp
innobase/include/buf0buf.h:
Rename buf_frame_get_modify_clock()
to buf_block_get_modify_clock().
innobase/include/buf0buf.ic:
Rename buf_frame_get_modify_clock()
to buf_block_get_modify_clock() and
remove the buf_block_align() call.
innobase/include/lock0lock.h:
lock_rec_store_on_page_infimum(): Add parameter "page"
innobase/include/mach0data.h:
Add mach_encode_2() and mach_decode_2().
innobase/include/mach0data.ic:
Add mach_encode_2() and mach_decode_2().
innobase/include/page0cur.h:
Add const qualifier to page_cur_is_before_first()
and page_cur_is_after_last().
innobase/include/page0cur.ic:
Make use of page_rec_is_infimum() and page_rec_is_supremum().
innobase/include/page0page.h:
Remove page_rec_is_first_user_rec() and page_rec_is_last_user_rec().
Add page_rec_is_infimum() and page_rec_is_supremum().
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp.
innobase/include/page0page.ic:
Remove page_rec_is_first_user_rec() and page_rec_is_last_user_rec().
Add page_rec_is_infimum() and page_rec_is_supremum().
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp.
Add UNIV_UNLIKELY, UNIV_LIKELY and UNIV_EXPECT hints.
Reduce the number of buf_frame_align() calls.
innobase/include/rem0rec.ic:
rec_offs_comp(): Return zero or nonzero instead of FALSE or TRUE.
innobase/include/row0mysql.h:
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp.
innobase/lock/lock0lock.c:
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp.
Remove parameter "comp" from lock_rec_get_next(),
lock_rec_has_expl() and lock_rec_other_has_expl_req().
Add parameter "page" to lock_rec_store_on_page_infimum().
Add UNIV_UNLIKELY hints.
Reduce the number of buf_frame_align() calls.
Make use of page_rec_is_infimum(), page_rec_is_supremum() and
page_rec_is_user_rec().
Move the "comp" flag outside some loops.
innobase/mtr/mtr0log.c:
Replace index->table->comp with page_rec_is_comp().
innobase/page/page0cur.c:
Replace index->table->comp with page_is_comp() or page_rec_is_comp().
Eliminate some buf_frame_align() calls.
Add some debug assertions.
innobase/page/page0page.c:
Optimize page_dir_find_owner_slot(). Compare the record offset
16 bits at a time, because that seems to be the only way to avoid
register spilling on x86.
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp.
Remove parameter "page" of page_delete_rec_list_write_log().
Make use of page_rec_is_infimum().
innobase/rem/rem0cmp.c:
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp.
innobase/row/row0ins.c:
Make use of page_rec_is_infimum() and page_rec_is_supremum().
Reduce the amount of buf_frame_align() calls.
row_ins_index_entry_low(): Disable assertion about column count
unless #ifdef UNIV_DEBUG.
innobase/row/row0mysql.c:
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp.
innobase/row/row0row.c:
Eliminate some buf_frame_align() calls.
Make use of page_rec_is_infimum().
innobase/row/row0sel.c:
Make use of page_rec_is_supremum() and page_rec_is_infimum().
Turn some assertions into debug assertions.
Add UNIV_LIKELY and UNIV_UNLIKELY hints.
row_search_for_mysql(): Eliminate local variables "moved",
"cons_read_requires_clust_rec", "was_lock_wait", "shortcut",
"success" and "comp". Replace some of them with goto's.
Disable variable "cnt" unless #ifdef UNIV_SEARCH_DEBUG.
innobase/row/row0vers.c:
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp.
Replace index->table->comp with page_rec_is_comp().
Eliminate some buf_frame_align() calls.
2005-04-25 09:14:35 +02:00
|
|
|
if ((rec_get_info_and_status_bits(insert_rec, comp) !=
|
|
|
|
rec_get_info_and_status_bits(cursor_rec, comp))
|
2001-02-17 13:19:19 +01:00
|
|
|
|| (extra_size != cur_extra_size)
|
|
|
|
|| (rec_size != cur_rec_size)) {
|
|
|
|
|
|
|
|
extra_info_yes = 1;
|
|
|
|
} else {
|
|
|
|
extra_info_yes = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Write the record end segment length and the extra info storage
|
|
|
|
flag */
|
|
|
|
log_ptr += mach_write_compressed(log_ptr, 2 * (rec_size - i)
|
|
|
|
+ extra_info_yes);
|
|
|
|
if (extra_info_yes) {
|
|
|
|
/* Write the info bits */
|
2004-12-02 18:45:07 +01:00
|
|
|
mach_write_to_1(log_ptr,
|
InnoDB: Performance optimizations based on OProfile analysis
innobase/btr/btr0btr.c:
Eliminate some buf_frame_align() calls.
Make use of the page_rec_is_infimum(), page_rec_is_supremum()
and page_rec_is_user_rec() functions.
Replace some index->table->comp with page_is_comp().
Eliminate some variables to reduce register spilling on x86.
Note that page_is_comp() may return nonzero instead of TRUE.
Note that rec_offs_comp() may return nonzero instead of TRUE.
innobase/btr/btr0cur.c:
Eliminate some buf_frame_align() calls.
Replace some index->table->comp with
page_is_comp() or rec_offs_comp().
Eliminate some variables to reduce register spilling on x86.
Note that page_is_comp() may return nonzero instead of TRUE.
Note that rec_offs_comp() may return nonzero instead of TRUE.
Remove an extra mem_heap_create() call from btr_cur_update_in_place().
Add "page" parameter to lock_rec_store_on_page_infimum().
Add some UNIV_LIKELY() and UNIV_UNLIKELY() hints.
btr_estimate_number_of_different_key_vals(): Rename the
offsets_* variables to be more descriptive and eliminate one
rec_get_offsets() and one page_rec_get_next() call in the loop.
innobase/btr/btr0pcur.c:
Eliminate some buf_frame_align() calls.
Make use of the page_rec_is_infimum(), page_rec_is_supremum()
and page_rec_is_user_rec() functions.
Replace some index->table->comp with page_is_comp().
Eliminate some variables to reduce register spilling on x86.
Note that page_is_comp() may return nonzero instead of TRUE.
Make some ut_a() assertions ut_ad() ones to improve performance.
Add some UNIV_LIKELY() and UNIV_UNLIKELY() hints.
innobase/btr/btr0sea.c:
Make use of page_rec_is_infimum() and page_rec_is_supremum().
Eliminate some buf_frame_align() calls.
Add some UNIV_UNLIKELY and UNIV_LIKELY hints.
Turn some assertions into debug assertions.
innobase/dict/dict0crea.c:
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp
innobase/ibuf/ibuf0ibuf.c:
Make use of page_rec_is_infimum() and page_rec_is_supremum().
Add some UNIV_UNLIKELY and UNIV_LIKELY hints.
ibuf_get_merge_page_nos(): Rename parameter "first_rec" to "rec"
and eliminate local variable "rec".
innobase/include/btr0btr.h:
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp
innobase/include/buf0buf.h:
Rename buf_frame_get_modify_clock()
to buf_block_get_modify_clock().
innobase/include/buf0buf.ic:
Rename buf_frame_get_modify_clock()
to buf_block_get_modify_clock() and
remove the buf_block_align() call.
innobase/include/lock0lock.h:
lock_rec_store_on_page_infimum(): Add parameter "page"
innobase/include/mach0data.h:
Add mach_encode_2() and mach_decode_2().
innobase/include/mach0data.ic:
Add mach_encode_2() and mach_decode_2().
innobase/include/page0cur.h:
Add const qualifier to page_cur_is_before_first()
and page_cur_is_after_last().
innobase/include/page0cur.ic:
Make use of page_rec_is_infimum() and page_rec_is_supremum().
innobase/include/page0page.h:
Remove page_rec_is_first_user_rec() and page_rec_is_last_user_rec().
Add page_rec_is_infimum() and page_rec_is_supremum().
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp.
innobase/include/page0page.ic:
Remove page_rec_is_first_user_rec() and page_rec_is_last_user_rec().
Add page_rec_is_infimum() and page_rec_is_supremum().
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp.
Add UNIV_UNLIKELY, UNIV_LIKELY and UNIV_EXPECT hints.
Reduce the number of buf_frame_align() calls.
innobase/include/rem0rec.ic:
rec_offs_comp(): Return zero or nonzero instead of FALSE or TRUE.
innobase/include/row0mysql.h:
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp.
innobase/lock/lock0lock.c:
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp.
Remove parameter "comp" from lock_rec_get_next(),
lock_rec_has_expl() and lock_rec_other_has_expl_req().
Add parameter "page" to lock_rec_store_on_page_infimum().
Add UNIV_UNLIKELY hints.
Reduce the number of buf_frame_align() calls.
Make use of page_rec_is_infimum(), page_rec_is_supremum() and
page_rec_is_user_rec().
Move the "comp" flag outside some loops.
innobase/mtr/mtr0log.c:
Replace index->table->comp with page_rec_is_comp().
innobase/page/page0cur.c:
Replace index->table->comp with page_is_comp() or page_rec_is_comp().
Eliminate some buf_frame_align() calls.
Add some debug assertions.
innobase/page/page0page.c:
Optimize page_dir_find_owner_slot(). Compare the record offset
16 bits at a time, because that seems to be the only way to avoid
register spilling on x86.
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp.
Remove parameter "page" of page_delete_rec_list_write_log().
Make use of page_rec_is_infimum().
innobase/rem/rem0cmp.c:
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp.
innobase/row/row0ins.c:
Make use of page_rec_is_infimum() and page_rec_is_supremum().
Reduce the amount of buf_frame_align() calls.
row_ins_index_entry_low(): Disable assertion about column count
unless #ifdef UNIV_DEBUG.
innobase/row/row0mysql.c:
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp.
innobase/row/row0row.c:
Eliminate some buf_frame_align() calls.
Make use of page_rec_is_infimum().
innobase/row/row0sel.c:
Make use of page_rec_is_supremum() and page_rec_is_infimum().
Turn some assertions into debug assertions.
Add UNIV_LIKELY and UNIV_UNLIKELY hints.
row_search_for_mysql(): Eliminate local variables "moved",
"cons_read_requires_clust_rec", "was_lock_wait", "shortcut",
"success" and "comp". Replace some of them with goto's.
Disable variable "cnt" unless #ifdef UNIV_SEARCH_DEBUG.
innobase/row/row0vers.c:
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp.
Replace index->table->comp with page_rec_is_comp().
Eliminate some buf_frame_align() calls.
2005-04-25 09:14:35 +02:00
|
|
|
rec_get_info_and_status_bits(insert_rec, comp));
|
2001-02-17 13:19:19 +01:00
|
|
|
log_ptr++;
|
|
|
|
|
|
|
|
/* Write the record origin offset */
|
|
|
|
log_ptr += mach_write_compressed(log_ptr, extra_size);
|
|
|
|
|
|
|
|
/* Write the mismatch index */
|
|
|
|
log_ptr += mach_write_compressed(log_ptr, i);
|
2002-08-02 22:16:19 +02:00
|
|
|
|
|
|
|
ut_a(i < UNIV_PAGE_SIZE);
|
|
|
|
ut_a(extra_size < UNIV_PAGE_SIZE);
|
2001-02-17 13:19:19 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Write to the log the inserted index record end segment which
|
|
|
|
differs from the cursor record */
|
|
|
|
|
2004-12-02 18:45:07 +01:00
|
|
|
rec_size -= i;
|
2002-06-22 19:41:14 +02:00
|
|
|
|
2004-12-02 18:45:07 +01:00
|
|
|
if (log_ptr + rec_size <= log_end) {
|
|
|
|
memcpy(log_ptr, ins_ptr, rec_size);
|
|
|
|
mlog_close(mtr, log_ptr + rec_size);
|
|
|
|
} else {
|
|
|
|
mlog_close(mtr, log_ptr);
|
|
|
|
ut_a(rec_size < UNIV_PAGE_SIZE);
|
|
|
|
mlog_catenate_string(mtr, ins_ptr, rec_size);
|
2001-02-17 13:19:19 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/***************************************************************
|
|
|
|
Parses a log record of a record insert on a page. */
|
|
|
|
|
|
|
|
byte*
|
|
|
|
page_cur_parse_insert_rec(
|
|
|
|
/*======================*/
|
2004-12-02 18:45:07 +01:00
|
|
|
/* out: end of log record or NULL */
|
|
|
|
ibool is_short,/* in: TRUE if short inserts */
|
|
|
|
byte* ptr, /* in: buffer */
|
|
|
|
byte* end_ptr,/* in: buffer end */
|
|
|
|
dict_index_t* index, /* in: record descriptor */
|
|
|
|
page_t* page, /* in: page or NULL */
|
|
|
|
mtr_t* mtr) /* in: mtr or NULL */
|
2001-02-17 13:19:19 +01:00
|
|
|
{
|
|
|
|
ulint extra_info_yes;
|
2001-11-05 22:48:03 +01:00
|
|
|
ulint offset = 0; /* remove warning */
|
2001-02-17 13:19:19 +01:00
|
|
|
ulint origin_offset;
|
|
|
|
ulint end_seg_len;
|
|
|
|
ulint mismatch_index;
|
|
|
|
rec_t* cursor_rec;
|
|
|
|
byte buf1[1024];
|
|
|
|
byte* buf;
|
2003-06-15 00:04:28 +02:00
|
|
|
byte* ptr2 = ptr;
|
2005-01-25 11:10:24 +01:00
|
|
|
ulint info_and_status_bits = 0; /* remove warning */
|
2001-02-17 13:19:19 +01:00
|
|
|
page_cur_t cursor;
|
2004-12-09 14:29:55 +01:00
|
|
|
mem_heap_t* heap = NULL;
|
2005-03-10 14:16:16 +01:00
|
|
|
ulint offsets_[REC_OFFS_NORMAL_SIZE];
|
2004-12-09 14:29:55 +01:00
|
|
|
ulint* offsets = offsets_;
|
2005-03-09 21:04:55 +01:00
|
|
|
*offsets_ = (sizeof offsets_) / sizeof *offsets_;
|
2001-02-17 13:19:19 +01:00
|
|
|
|
|
|
|
if (!is_short) {
|
|
|
|
/* Read the cursor rec offset as a 2-byte ulint */
|
|
|
|
|
|
|
|
if (end_ptr < ptr + 2) {
|
|
|
|
|
|
|
|
return(NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
offset = mach_read_from_2(ptr);
|
2002-08-02 22:16:19 +02:00
|
|
|
|
|
|
|
if (offset >= UNIV_PAGE_SIZE) {
|
|
|
|
|
|
|
|
recv_sys->found_corrupt_log = TRUE;
|
|
|
|
|
|
|
|
return(NULL);
|
|
|
|
}
|
2001-02-17 13:19:19 +01:00
|
|
|
|
|
|
|
ptr += 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
ptr = mach_parse_compressed(ptr, end_ptr, &end_seg_len);
|
|
|
|
|
|
|
|
if (ptr == NULL) {
|
|
|
|
|
|
|
|
return(NULL);
|
|
|
|
}
|
|
|
|
|
2003-10-07 16:28:59 +02:00
|
|
|
extra_info_yes = end_seg_len & 0x1UL;
|
InnoDB cleanup: fixing buffer overflows and quoting of quotes
innobase/dict/dict0crea.c:
Remove unneeded prototypes for static functions
Remove unused parameters from some functions
Replace some assertions with compile-time checks
dict_create_add_foreigns_to_dictionary():
allocate space dynamically for the SQL, and quote quotes
innobase/dict/dict0dict.c:
Remove unnecessary prototypes for static functions
dict_tables_have_same_db(): Remove length limitation
dict_remove_db_name(): Use strchr()
dict_get_db_name_len(): Use strchr()
Replace mem_heap_alloc()+strlen()+memcpy() with mem_heap_strdup()
Remove unnecessary strlen() calls
Allocate space dynamically for generated strings
dict_scan_id(): allow quotes within quoted strings
innobase/dict/dict0load.c:
Remove unnecessary strlen() calls
Replace mem_heap_alloc()+strlen()+memcpy() with mem_heap_strdup()
innobase/dict/dict0mem.c:
Replace mem_heap_alloc()+strlen()+memcpy() with mem_heap_strdup()
innobase/eval/eval0eval.c:
Make TO_CHAR() work with any machine word width
innobase/fil/fil0fil.c:
Replace mem_alloc()+strlen()+strcpy() with mem_strdup()
innobase/ibuf/ibuf0ibuf.c:
Make some global variables static
Add #ifdef UNIV_IBUF_DEBUG around debug statements
innobase/include/data0data.h:
Add #ifdef UNIV_DEBUG around dtuple_validate()
innobase/include/data0data.ic:
Replace = with == in ut_ad(tuple->magic_n == DATA_TUPLE_MAGIC_N)
innobase/include/dict0dict.h:
Add const qualifiers
innobase/include/lock0lock.h:
Add UL suffixes to unsigned long masks
innobase/include/log0log.h:
Remove unused parameter "type" of log_group_write_buf()
innobase/include/mem0mem.h:
Add mem_strdup(), mem_strdupl(), mem_strdupq(), mem_heap_strdup(),
and mem_heap_strdupl()
innobase/include/mem0mem.ic:
Add mem_strdup(), mem_strdupl(), mem_strdupq(), mem_heap_strdup(),
and mem_heap_strdupl()
innobase/include/row0uins.h:
Remove unused parameter "thr" of row_undo_ins()
innobase/include/row0undo.h:
Remvoe unused parameter "thr" of row_undo_search_clust_to_pcur()
innobase/include/ut0byte.h:
Add const qualifier to ut_cpy_in_lower_case()
Remove parameter "len" of ut_cmp_in_lower_case()
innobase/include/ut0mem.h:
Add ut_strlenq(), ut_strcpyq() and ut_memcpyq()
innobase/include/ut0mem.ic:
Add ut_strlenq()
innobase/include/ut0ut.h:
Declare ut_sprintf() as a printf-style function
innobase/lock/lock0lock.c:
lock_clust_rec_modify_check_and_lock(): Remove unused variable "trx"
innobase/log/log0log.c:
Remove unused parameters
innobase/log/log0recv.c:
Remove parameter "type" from log_group_write_buf()
innobase/mem/mem0mem.c:
Simplify the initialization of block->init_block
innobase/mtr/mtr0log.c:
Add a debug assertion to mlog_parse_initial_log_record()
innobase/page/page0cur.c:
Add debug assertion to page_cur_insert_rec_write_log()
Remove hard-coded buffer size in page_cur_parse_insert_rec()
innobase/page/page0page.c:
Remove unneeded variable rec
innobase/pars/pars0opt.c:
Correct a potential buffer overflow
innobase/pars/pars0pars.c:
Replace mem_heap_alloc()+strlen()+memcpy() with mem_heap_strdup()
innobase/row/row0ins.c:
Replace parameter "thr" with "trx" in row_ins_foreign_report_add_err()
Remove unnecessary strlen() call
Use strchr()
innobase/row/row0mysql.c:
Add row_mysql_is_recovered_tmp_table()
Add row_mysql_is_system_table()
Compare reserved table names with exact match
Use strstr() and strchr() and mem_strdupl()
Compute space needed for generated SQL, and allocate it dynamically
innobase/row/row0purge.c:
Remove unused parameters "thr"
innobase/row/row0row.c:
Simplify row_get_clust_rec()
innobase/row/row0uins.c:
Remove unused parameters "thr"
innobase/row/row0umod.c:
Remove unused variable "index"
row_undo_mod_del_unmark_sec_and_undo_update():
Remove parameter "node" and variable "rec"
Remove unused parameters "thr"
innobase/row/row0undo.c:
Remove unused parameters "thr"
innobase/srv/srv0srv.c:
Replace UT_NOT_USED() with __attribute__((unused))
innobase/srv/srv0start.c:
Remove unnecessary strlen() calls
Remove unused parameter "create_new_db" of open_or_create_log_file()
innobase/trx/trx0roll.c:
Replace mem_alloc()+strlen()+memcpy() with mem_strdup()
innobase/trx/trx0sys.c:
Remove unnecessary strlen() call
innobase/ut/ut0byte.c:
Add const qualifier to ut_cpy_in_lower_case()
Remove parameter "len" of ut_cmp_in_lower_case()
innobase/ut/ut0mem.c:
Add ut_strlenq() and ut_memcpyq()
sql/ha_innodb.cc:
Remove parameter "len" of ut_cmp_in_lower_case()
2004-04-01 15:51:34 +02:00
|
|
|
end_seg_len >>= 1;
|
2002-08-02 22:16:19 +02:00
|
|
|
|
|
|
|
if (end_seg_len >= UNIV_PAGE_SIZE) {
|
|
|
|
recv_sys->found_corrupt_log = TRUE;
|
|
|
|
|
|
|
|
return(NULL);
|
|
|
|
}
|
2001-02-17 13:19:19 +01:00
|
|
|
|
|
|
|
if (extra_info_yes) {
|
|
|
|
/* Read the info bits */
|
|
|
|
|
|
|
|
if (end_ptr < ptr + 1) {
|
|
|
|
|
|
|
|
return(NULL);
|
|
|
|
}
|
|
|
|
|
2005-01-25 11:10:24 +01:00
|
|
|
info_and_status_bits = mach_read_from_1(ptr);
|
2001-02-17 13:19:19 +01:00
|
|
|
ptr++;
|
|
|
|
|
|
|
|
ptr = mach_parse_compressed(ptr, end_ptr, &origin_offset);
|
|
|
|
|
|
|
|
if (ptr == NULL) {
|
|
|
|
|
|
|
|
return(NULL);
|
|
|
|
}
|
|
|
|
|
2002-08-02 22:16:19 +02:00
|
|
|
ut_a(origin_offset < UNIV_PAGE_SIZE);
|
|
|
|
|
2001-02-17 13:19:19 +01:00
|
|
|
ptr = mach_parse_compressed(ptr, end_ptr, &mismatch_index);
|
|
|
|
|
|
|
|
if (ptr == NULL) {
|
|
|
|
|
|
|
|
return(NULL);
|
|
|
|
}
|
2002-08-02 22:16:19 +02:00
|
|
|
|
|
|
|
ut_a(mismatch_index < UNIV_PAGE_SIZE);
|
2001-02-17 13:19:19 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
if (end_ptr < ptr + end_seg_len) {
|
|
|
|
|
|
|
|
return(NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (page == NULL) {
|
|
|
|
|
|
|
|
return(ptr + end_seg_len);
|
|
|
|
}
|
|
|
|
|
InnoDB: Performance optimizations based on OProfile analysis
innobase/btr/btr0btr.c:
Eliminate some buf_frame_align() calls.
Make use of the page_rec_is_infimum(), page_rec_is_supremum()
and page_rec_is_user_rec() functions.
Replace some index->table->comp with page_is_comp().
Eliminate some variables to reduce register spilling on x86.
Note that page_is_comp() may return nonzero instead of TRUE.
Note that rec_offs_comp() may return nonzero instead of TRUE.
innobase/btr/btr0cur.c:
Eliminate some buf_frame_align() calls.
Replace some index->table->comp with
page_is_comp() or rec_offs_comp().
Eliminate some variables to reduce register spilling on x86.
Note that page_is_comp() may return nonzero instead of TRUE.
Note that rec_offs_comp() may return nonzero instead of TRUE.
Remove an extra mem_heap_create() call from btr_cur_update_in_place().
Add "page" parameter to lock_rec_store_on_page_infimum().
Add some UNIV_LIKELY() and UNIV_UNLIKELY() hints.
btr_estimate_number_of_different_key_vals(): Rename the
offsets_* variables to be more descriptive and eliminate one
rec_get_offsets() and one page_rec_get_next() call in the loop.
innobase/btr/btr0pcur.c:
Eliminate some buf_frame_align() calls.
Make use of the page_rec_is_infimum(), page_rec_is_supremum()
and page_rec_is_user_rec() functions.
Replace some index->table->comp with page_is_comp().
Eliminate some variables to reduce register spilling on x86.
Note that page_is_comp() may return nonzero instead of TRUE.
Make some ut_a() assertions ut_ad() ones to improve performance.
Add some UNIV_LIKELY() and UNIV_UNLIKELY() hints.
innobase/btr/btr0sea.c:
Make use of page_rec_is_infimum() and page_rec_is_supremum().
Eliminate some buf_frame_align() calls.
Add some UNIV_UNLIKELY and UNIV_LIKELY hints.
Turn some assertions into debug assertions.
innobase/dict/dict0crea.c:
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp
innobase/ibuf/ibuf0ibuf.c:
Make use of page_rec_is_infimum() and page_rec_is_supremum().
Add some UNIV_UNLIKELY and UNIV_LIKELY hints.
ibuf_get_merge_page_nos(): Rename parameter "first_rec" to "rec"
and eliminate local variable "rec".
innobase/include/btr0btr.h:
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp
innobase/include/buf0buf.h:
Rename buf_frame_get_modify_clock()
to buf_block_get_modify_clock().
innobase/include/buf0buf.ic:
Rename buf_frame_get_modify_clock()
to buf_block_get_modify_clock() and
remove the buf_block_align() call.
innobase/include/lock0lock.h:
lock_rec_store_on_page_infimum(): Add parameter "page"
innobase/include/mach0data.h:
Add mach_encode_2() and mach_decode_2().
innobase/include/mach0data.ic:
Add mach_encode_2() and mach_decode_2().
innobase/include/page0cur.h:
Add const qualifier to page_cur_is_before_first()
and page_cur_is_after_last().
innobase/include/page0cur.ic:
Make use of page_rec_is_infimum() and page_rec_is_supremum().
innobase/include/page0page.h:
Remove page_rec_is_first_user_rec() and page_rec_is_last_user_rec().
Add page_rec_is_infimum() and page_rec_is_supremum().
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp.
innobase/include/page0page.ic:
Remove page_rec_is_first_user_rec() and page_rec_is_last_user_rec().
Add page_rec_is_infimum() and page_rec_is_supremum().
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp.
Add UNIV_UNLIKELY, UNIV_LIKELY and UNIV_EXPECT hints.
Reduce the number of buf_frame_align() calls.
innobase/include/rem0rec.ic:
rec_offs_comp(): Return zero or nonzero instead of FALSE or TRUE.
innobase/include/row0mysql.h:
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp.
innobase/lock/lock0lock.c:
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp.
Remove parameter "comp" from lock_rec_get_next(),
lock_rec_has_expl() and lock_rec_other_has_expl_req().
Add parameter "page" to lock_rec_store_on_page_infimum().
Add UNIV_UNLIKELY hints.
Reduce the number of buf_frame_align() calls.
Make use of page_rec_is_infimum(), page_rec_is_supremum() and
page_rec_is_user_rec().
Move the "comp" flag outside some loops.
innobase/mtr/mtr0log.c:
Replace index->table->comp with page_rec_is_comp().
innobase/page/page0cur.c:
Replace index->table->comp with page_is_comp() or page_rec_is_comp().
Eliminate some buf_frame_align() calls.
Add some debug assertions.
innobase/page/page0page.c:
Optimize page_dir_find_owner_slot(). Compare the record offset
16 bits at a time, because that seems to be the only way to avoid
register spilling on x86.
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp.
Remove parameter "page" of page_delete_rec_list_write_log().
Make use of page_rec_is_infimum().
innobase/rem/rem0cmp.c:
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp.
innobase/row/row0ins.c:
Make use of page_rec_is_infimum() and page_rec_is_supremum().
Reduce the amount of buf_frame_align() calls.
row_ins_index_entry_low(): Disable assertion about column count
unless #ifdef UNIV_DEBUG.
innobase/row/row0mysql.c:
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp.
innobase/row/row0row.c:
Eliminate some buf_frame_align() calls.
Make use of page_rec_is_infimum().
innobase/row/row0sel.c:
Make use of page_rec_is_supremum() and page_rec_is_infimum().
Turn some assertions into debug assertions.
Add UNIV_LIKELY and UNIV_UNLIKELY hints.
row_search_for_mysql(): Eliminate local variables "moved",
"cons_read_requires_clust_rec", "was_lock_wait", "shortcut",
"success" and "comp". Replace some of them with goto's.
Disable variable "cnt" unless #ifdef UNIV_SEARCH_DEBUG.
innobase/row/row0vers.c:
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp.
Replace index->table->comp with page_rec_is_comp().
Eliminate some buf_frame_align() calls.
2005-04-25 09:14:35 +02:00
|
|
|
ut_ad(!!page_is_comp(page) == index->table->comp);
|
|
|
|
|
2001-02-17 13:19:19 +01:00
|
|
|
/* Read from the log the inserted index record end segment which
|
|
|
|
differs from the cursor record */
|
|
|
|
|
|
|
|
if (is_short) {
|
|
|
|
cursor_rec = page_rec_get_prev(page_get_supremum_rec(page));
|
|
|
|
} else {
|
|
|
|
cursor_rec = page + offset;
|
|
|
|
}
|
|
|
|
|
2004-12-09 14:29:55 +01:00
|
|
|
offsets = rec_get_offsets(cursor_rec, index, offsets,
|
|
|
|
ULINT_UNDEFINED, &heap);
|
2004-12-02 18:45:07 +01:00
|
|
|
|
2001-02-17 13:19:19 +01:00
|
|
|
if (extra_info_yes == 0) {
|
2005-01-25 11:10:24 +01:00
|
|
|
info_and_status_bits = rec_get_info_and_status_bits(
|
InnoDB: Performance optimizations based on OProfile analysis
innobase/btr/btr0btr.c:
Eliminate some buf_frame_align() calls.
Make use of the page_rec_is_infimum(), page_rec_is_supremum()
and page_rec_is_user_rec() functions.
Replace some index->table->comp with page_is_comp().
Eliminate some variables to reduce register spilling on x86.
Note that page_is_comp() may return nonzero instead of TRUE.
Note that rec_offs_comp() may return nonzero instead of TRUE.
innobase/btr/btr0cur.c:
Eliminate some buf_frame_align() calls.
Replace some index->table->comp with
page_is_comp() or rec_offs_comp().
Eliminate some variables to reduce register spilling on x86.
Note that page_is_comp() may return nonzero instead of TRUE.
Note that rec_offs_comp() may return nonzero instead of TRUE.
Remove an extra mem_heap_create() call from btr_cur_update_in_place().
Add "page" parameter to lock_rec_store_on_page_infimum().
Add some UNIV_LIKELY() and UNIV_UNLIKELY() hints.
btr_estimate_number_of_different_key_vals(): Rename the
offsets_* variables to be more descriptive and eliminate one
rec_get_offsets() and one page_rec_get_next() call in the loop.
innobase/btr/btr0pcur.c:
Eliminate some buf_frame_align() calls.
Make use of the page_rec_is_infimum(), page_rec_is_supremum()
and page_rec_is_user_rec() functions.
Replace some index->table->comp with page_is_comp().
Eliminate some variables to reduce register spilling on x86.
Note that page_is_comp() may return nonzero instead of TRUE.
Make some ut_a() assertions ut_ad() ones to improve performance.
Add some UNIV_LIKELY() and UNIV_UNLIKELY() hints.
innobase/btr/btr0sea.c:
Make use of page_rec_is_infimum() and page_rec_is_supremum().
Eliminate some buf_frame_align() calls.
Add some UNIV_UNLIKELY and UNIV_LIKELY hints.
Turn some assertions into debug assertions.
innobase/dict/dict0crea.c:
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp
innobase/ibuf/ibuf0ibuf.c:
Make use of page_rec_is_infimum() and page_rec_is_supremum().
Add some UNIV_UNLIKELY and UNIV_LIKELY hints.
ibuf_get_merge_page_nos(): Rename parameter "first_rec" to "rec"
and eliminate local variable "rec".
innobase/include/btr0btr.h:
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp
innobase/include/buf0buf.h:
Rename buf_frame_get_modify_clock()
to buf_block_get_modify_clock().
innobase/include/buf0buf.ic:
Rename buf_frame_get_modify_clock()
to buf_block_get_modify_clock() and
remove the buf_block_align() call.
innobase/include/lock0lock.h:
lock_rec_store_on_page_infimum(): Add parameter "page"
innobase/include/mach0data.h:
Add mach_encode_2() and mach_decode_2().
innobase/include/mach0data.ic:
Add mach_encode_2() and mach_decode_2().
innobase/include/page0cur.h:
Add const qualifier to page_cur_is_before_first()
and page_cur_is_after_last().
innobase/include/page0cur.ic:
Make use of page_rec_is_infimum() and page_rec_is_supremum().
innobase/include/page0page.h:
Remove page_rec_is_first_user_rec() and page_rec_is_last_user_rec().
Add page_rec_is_infimum() and page_rec_is_supremum().
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp.
innobase/include/page0page.ic:
Remove page_rec_is_first_user_rec() and page_rec_is_last_user_rec().
Add page_rec_is_infimum() and page_rec_is_supremum().
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp.
Add UNIV_UNLIKELY, UNIV_LIKELY and UNIV_EXPECT hints.
Reduce the number of buf_frame_align() calls.
innobase/include/rem0rec.ic:
rec_offs_comp(): Return zero or nonzero instead of FALSE or TRUE.
innobase/include/row0mysql.h:
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp.
innobase/lock/lock0lock.c:
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp.
Remove parameter "comp" from lock_rec_get_next(),
lock_rec_has_expl() and lock_rec_other_has_expl_req().
Add parameter "page" to lock_rec_store_on_page_infimum().
Add UNIV_UNLIKELY hints.
Reduce the number of buf_frame_align() calls.
Make use of page_rec_is_infimum(), page_rec_is_supremum() and
page_rec_is_user_rec().
Move the "comp" flag outside some loops.
innobase/mtr/mtr0log.c:
Replace index->table->comp with page_rec_is_comp().
innobase/page/page0cur.c:
Replace index->table->comp with page_is_comp() or page_rec_is_comp().
Eliminate some buf_frame_align() calls.
Add some debug assertions.
innobase/page/page0page.c:
Optimize page_dir_find_owner_slot(). Compare the record offset
16 bits at a time, because that seems to be the only way to avoid
register spilling on x86.
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp.
Remove parameter "page" of page_delete_rec_list_write_log().
Make use of page_rec_is_infimum().
innobase/rem/rem0cmp.c:
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp.
innobase/row/row0ins.c:
Make use of page_rec_is_infimum() and page_rec_is_supremum().
Reduce the amount of buf_frame_align() calls.
row_ins_index_entry_low(): Disable assertion about column count
unless #ifdef UNIV_DEBUG.
innobase/row/row0mysql.c:
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp.
innobase/row/row0row.c:
Eliminate some buf_frame_align() calls.
Make use of page_rec_is_infimum().
innobase/row/row0sel.c:
Make use of page_rec_is_supremum() and page_rec_is_infimum().
Turn some assertions into debug assertions.
Add UNIV_LIKELY and UNIV_UNLIKELY hints.
row_search_for_mysql(): Eliminate local variables "moved",
"cons_read_requires_clust_rec", "was_lock_wait", "shortcut",
"success" and "comp". Replace some of them with goto's.
Disable variable "cnt" unless #ifdef UNIV_SEARCH_DEBUG.
innobase/row/row0vers.c:
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp.
Replace index->table->comp with page_rec_is_comp().
Eliminate some buf_frame_align() calls.
2005-04-25 09:14:35 +02:00
|
|
|
cursor_rec, page_is_comp(page));
|
2004-12-02 18:45:07 +01:00
|
|
|
origin_offset = rec_offs_extra_size(offsets);
|
|
|
|
mismatch_index = rec_offs_size(offsets) - end_seg_len;
|
|
|
|
}
|
2001-02-17 13:19:19 +01:00
|
|
|
|
InnoDB cleanup: fixing buffer overflows and quoting of quotes
innobase/dict/dict0crea.c:
Remove unneeded prototypes for static functions
Remove unused parameters from some functions
Replace some assertions with compile-time checks
dict_create_add_foreigns_to_dictionary():
allocate space dynamically for the SQL, and quote quotes
innobase/dict/dict0dict.c:
Remove unnecessary prototypes for static functions
dict_tables_have_same_db(): Remove length limitation
dict_remove_db_name(): Use strchr()
dict_get_db_name_len(): Use strchr()
Replace mem_heap_alloc()+strlen()+memcpy() with mem_heap_strdup()
Remove unnecessary strlen() calls
Allocate space dynamically for generated strings
dict_scan_id(): allow quotes within quoted strings
innobase/dict/dict0load.c:
Remove unnecessary strlen() calls
Replace mem_heap_alloc()+strlen()+memcpy() with mem_heap_strdup()
innobase/dict/dict0mem.c:
Replace mem_heap_alloc()+strlen()+memcpy() with mem_heap_strdup()
innobase/eval/eval0eval.c:
Make TO_CHAR() work with any machine word width
innobase/fil/fil0fil.c:
Replace mem_alloc()+strlen()+strcpy() with mem_strdup()
innobase/ibuf/ibuf0ibuf.c:
Make some global variables static
Add #ifdef UNIV_IBUF_DEBUG around debug statements
innobase/include/data0data.h:
Add #ifdef UNIV_DEBUG around dtuple_validate()
innobase/include/data0data.ic:
Replace = with == in ut_ad(tuple->magic_n == DATA_TUPLE_MAGIC_N)
innobase/include/dict0dict.h:
Add const qualifiers
innobase/include/lock0lock.h:
Add UL suffixes to unsigned long masks
innobase/include/log0log.h:
Remove unused parameter "type" of log_group_write_buf()
innobase/include/mem0mem.h:
Add mem_strdup(), mem_strdupl(), mem_strdupq(), mem_heap_strdup(),
and mem_heap_strdupl()
innobase/include/mem0mem.ic:
Add mem_strdup(), mem_strdupl(), mem_strdupq(), mem_heap_strdup(),
and mem_heap_strdupl()
innobase/include/row0uins.h:
Remove unused parameter "thr" of row_undo_ins()
innobase/include/row0undo.h:
Remvoe unused parameter "thr" of row_undo_search_clust_to_pcur()
innobase/include/ut0byte.h:
Add const qualifier to ut_cpy_in_lower_case()
Remove parameter "len" of ut_cmp_in_lower_case()
innobase/include/ut0mem.h:
Add ut_strlenq(), ut_strcpyq() and ut_memcpyq()
innobase/include/ut0mem.ic:
Add ut_strlenq()
innobase/include/ut0ut.h:
Declare ut_sprintf() as a printf-style function
innobase/lock/lock0lock.c:
lock_clust_rec_modify_check_and_lock(): Remove unused variable "trx"
innobase/log/log0log.c:
Remove unused parameters
innobase/log/log0recv.c:
Remove parameter "type" from log_group_write_buf()
innobase/mem/mem0mem.c:
Simplify the initialization of block->init_block
innobase/mtr/mtr0log.c:
Add a debug assertion to mlog_parse_initial_log_record()
innobase/page/page0cur.c:
Add debug assertion to page_cur_insert_rec_write_log()
Remove hard-coded buffer size in page_cur_parse_insert_rec()
innobase/page/page0page.c:
Remove unneeded variable rec
innobase/pars/pars0opt.c:
Correct a potential buffer overflow
innobase/pars/pars0pars.c:
Replace mem_heap_alloc()+strlen()+memcpy() with mem_heap_strdup()
innobase/row/row0ins.c:
Replace parameter "thr" with "trx" in row_ins_foreign_report_add_err()
Remove unnecessary strlen() call
Use strchr()
innobase/row/row0mysql.c:
Add row_mysql_is_recovered_tmp_table()
Add row_mysql_is_system_table()
Compare reserved table names with exact match
Use strstr() and strchr() and mem_strdupl()
Compute space needed for generated SQL, and allocate it dynamically
innobase/row/row0purge.c:
Remove unused parameters "thr"
innobase/row/row0row.c:
Simplify row_get_clust_rec()
innobase/row/row0uins.c:
Remove unused parameters "thr"
innobase/row/row0umod.c:
Remove unused variable "index"
row_undo_mod_del_unmark_sec_and_undo_update():
Remove parameter "node" and variable "rec"
Remove unused parameters "thr"
innobase/row/row0undo.c:
Remove unused parameters "thr"
innobase/srv/srv0srv.c:
Replace UT_NOT_USED() with __attribute__((unused))
innobase/srv/srv0start.c:
Remove unnecessary strlen() calls
Remove unused parameter "create_new_db" of open_or_create_log_file()
innobase/trx/trx0roll.c:
Replace mem_alloc()+strlen()+memcpy() with mem_strdup()
innobase/trx/trx0sys.c:
Remove unnecessary strlen() call
innobase/ut/ut0byte.c:
Add const qualifier to ut_cpy_in_lower_case()
Remove parameter "len" of ut_cmp_in_lower_case()
innobase/ut/ut0mem.c:
Add ut_strlenq() and ut_memcpyq()
sql/ha_innodb.cc:
Remove parameter "len" of ut_cmp_in_lower_case()
2004-04-01 15:51:34 +02:00
|
|
|
if (mismatch_index + end_seg_len < sizeof buf1) {
|
2001-02-17 13:19:19 +01:00
|
|
|
buf = buf1;
|
|
|
|
} else {
|
|
|
|
buf = mem_alloc(mismatch_index + end_seg_len);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Build the inserted record to buf */
|
|
|
|
|
2003-06-15 00:04:28 +02:00
|
|
|
if (mismatch_index >= UNIV_PAGE_SIZE) {
|
InnoDB: send diagnostic output to stderr or files
instead of stdout or fixed-size memory buffers
innobase/btr/btr0btr.c:
Output to stderr; quote table and index names
innobase/btr/btr0cur.c:
Output to stderr; quote table and index names
innobase/btr/btr0sea.c:
Output to stderr
innobase/buf/buf0buf.c:
Output to stderr; quote table and index names
innobase/buf/buf0flu.c:
Output to stderr
innobase/buf/buf0lru.c:
Output to stderr
innobase/buf/buf0rea.c:
Output to stderr
innobase/data/data0data.c:
Remove dtuple_validate() unless #ifdef UNIV_DEBUG
Remove unnecessary sprintf() calls
Output to stderr
innobase/data/data0type.c:
Output to stderr
innobase/dict/dict0boot.c:
Remove dummy call to printf()
innobase/dict/dict0crea.c:
Output diagnostic information to stream, not to memory
innobase/dict/dict0dict.c:
Output diagnostics to a file, not to a memory buffer
innobase/dict/dict0load.c:
Output to stderr; quote table and index names
innobase/eval/eval0eval.c:
Output to stderr
innobase/fil/fil0fil.c:
Output to stderr
innobase/fsp/fsp0fsp.c:
Output to stderr
Avoid sprintf()
innobase/fut/fut0lst.c:
Output to stderr
innobase/ha/ha0ha.c:
Output to stream, not to memory buffer
innobase/ibuf/ibuf0ibuf.c:
Output to stderr
Avoid sprintf()
innobase/include/buf0buf.h:
Output to stream, not to memory buffer
innobase/include/buf0buf.ic:
Use %p for displaying pointers
innobase/include/data0data.h:
Remove dtuple_sprintf()
innobase/include/dict0dict.h:
Output to stream, not to memory buffer
innobase/include/ha0ha.h:
Output to stream, not to memory buffer
innobase/include/ibuf0ibuf.h:
Output to stream, not to memory buffer
innobase/include/lock0lock.h:
Output to stream, not to memory buffer
innobase/include/log0log.h:
Output to stream, not to memory buffer
innobase/include/mtr0log.ic:
Output to stderr
Display pointers with %p
innobase/include/os0file.h:
Output to stream, not to memory buffer
innobase/include/rem0rec.h:
Remove rec_sprintf()
innobase/include/rem0rec.ic:
Output to stderr
innobase/include/row0sel.ic:
Output to stderr
innobase/include/row0upd.ic:
Quote table and index names
innobase/include/srv0srv.h:
Remove srv_sprintf_innodb_monitor()
innobase/include/sync0arr.h:
Output to stream, not to memory buffer
innobase/include/sync0sync.h:
Output to stream, not to memory buffer
innobase/include/trx0sys.h:
Output to stderr
innobase/include/trx0trx.h:
Output to stream, not to memory buffer
innobase/include/ut0ut.h:
Remove ut_sprintf_buf()
Add ut_print_name(), ut_print_namel() and ut_copy_file()
innobase/lock/lock0lock.c:
Output to stream, not to memory buffer
innobase/log/log0log.c:
Output to stderr
innobase/log/log0recv.c:
Output to stderr
innobase/mem/mem0dbg.c:
Output to stderr
innobase/mtr/mtr0log.c:
Display pointers with %p
innobase/mtr/mtr0mtr.c:
Output to stderr
innobase/os/os0file.c:
Output to stream, not to memory buffer
innobase/os/os0proc.c:
Output to stderr
innobase/os/os0thread.c:
Output to stderr
innobase/page/page0cur.c:
Output to stderr
innobase/page/page0page.c:
Avoid sprintf()
Output to stderr instead of stdout
innobase/pars/pars0opt.c:
Output to stderr instead of stdout
innobase/rem/rem0rec.c:
Remove rec_sprintf()
Output to stderr instead of stdout
innobase/row/row0ins.c:
Output diagnostics to stream instead of memory buffer
innobase/row/row0mysql.c:
Output to stderr instead of stdout
Quote table and index names
innobase/row/row0purge.c:
Output to stderr instead of stdout
innobase/row/row0row.c:
Quote table and index names
innobase/row/row0sel.c:
Output to stderr instead of stdout
Quote table and index names
innobase/row/row0umod.c:
Avoid sprintf()
Quote table and index names
innobase/row/row0undo.c:
Output to stderr instead of stdout
innobase/row/row0upd.c:
Avoid sprintf()
innobase/srv/srv0srv.c:
Output to stderr instead of stdout
innobase/srv/srv0start.c:
Handle srv_monitor_file
Make some global variables static
innobase/sync/sync0arr.c:
Output to stderr instead of stdout
Output to stream instead of memory buffer
innobase/sync/sync0rw.c:
Output to stderr instead of stdout
innobase/sync/sync0sync.c:
Output to stderr instead of stdout
Output to stream instead of memory buffer
innobase/trx/trx0purge.c:
Output to stderr instead of stdout
innobase/trx/trx0rec.c:
Quote index and table names
Avoid sprintf()
innobase/trx/trx0roll.c:
Quote identifier names
Output to stderr instead of stdout
innobase/trx/trx0sys.c:
Output to stderr instead of stdout
innobase/trx/trx0trx.c:
Output to stream instead of memory buffer
innobase/trx/trx0undo.c:
Output to stderr instead of stdout
innobase/ut/ut0ut.c:
Declare mysql_get_identifier_quote_char()
Remove ut_sprintf_buf()
Add ut_print_name() and ut_print_namel()
Add ut_copy_file()
sql/ha_innodb.cc:
innobase_mysql_print_thd(): output to stream, not to memory buffer
Add mysql_get_identifier_quote_char()
Remove unused function innobase_print_error()
Display pointers with %p
Buffer InnoDB output via files, not via statically allocated memory
2004-04-06 15:14:43 +02:00
|
|
|
fprintf(stderr,
|
2005-01-25 11:10:24 +01:00
|
|
|
"Is short %lu, info_and_status_bits %lu, offset %lu, "
|
InnoDB: send diagnostic output to stderr or files
instead of stdout or fixed-size memory buffers
innobase/btr/btr0btr.c:
Output to stderr; quote table and index names
innobase/btr/btr0cur.c:
Output to stderr; quote table and index names
innobase/btr/btr0sea.c:
Output to stderr
innobase/buf/buf0buf.c:
Output to stderr; quote table and index names
innobase/buf/buf0flu.c:
Output to stderr
innobase/buf/buf0lru.c:
Output to stderr
innobase/buf/buf0rea.c:
Output to stderr
innobase/data/data0data.c:
Remove dtuple_validate() unless #ifdef UNIV_DEBUG
Remove unnecessary sprintf() calls
Output to stderr
innobase/data/data0type.c:
Output to stderr
innobase/dict/dict0boot.c:
Remove dummy call to printf()
innobase/dict/dict0crea.c:
Output diagnostic information to stream, not to memory
innobase/dict/dict0dict.c:
Output diagnostics to a file, not to a memory buffer
innobase/dict/dict0load.c:
Output to stderr; quote table and index names
innobase/eval/eval0eval.c:
Output to stderr
innobase/fil/fil0fil.c:
Output to stderr
innobase/fsp/fsp0fsp.c:
Output to stderr
Avoid sprintf()
innobase/fut/fut0lst.c:
Output to stderr
innobase/ha/ha0ha.c:
Output to stream, not to memory buffer
innobase/ibuf/ibuf0ibuf.c:
Output to stderr
Avoid sprintf()
innobase/include/buf0buf.h:
Output to stream, not to memory buffer
innobase/include/buf0buf.ic:
Use %p for displaying pointers
innobase/include/data0data.h:
Remove dtuple_sprintf()
innobase/include/dict0dict.h:
Output to stream, not to memory buffer
innobase/include/ha0ha.h:
Output to stream, not to memory buffer
innobase/include/ibuf0ibuf.h:
Output to stream, not to memory buffer
innobase/include/lock0lock.h:
Output to stream, not to memory buffer
innobase/include/log0log.h:
Output to stream, not to memory buffer
innobase/include/mtr0log.ic:
Output to stderr
Display pointers with %p
innobase/include/os0file.h:
Output to stream, not to memory buffer
innobase/include/rem0rec.h:
Remove rec_sprintf()
innobase/include/rem0rec.ic:
Output to stderr
innobase/include/row0sel.ic:
Output to stderr
innobase/include/row0upd.ic:
Quote table and index names
innobase/include/srv0srv.h:
Remove srv_sprintf_innodb_monitor()
innobase/include/sync0arr.h:
Output to stream, not to memory buffer
innobase/include/sync0sync.h:
Output to stream, not to memory buffer
innobase/include/trx0sys.h:
Output to stderr
innobase/include/trx0trx.h:
Output to stream, not to memory buffer
innobase/include/ut0ut.h:
Remove ut_sprintf_buf()
Add ut_print_name(), ut_print_namel() and ut_copy_file()
innobase/lock/lock0lock.c:
Output to stream, not to memory buffer
innobase/log/log0log.c:
Output to stderr
innobase/log/log0recv.c:
Output to stderr
innobase/mem/mem0dbg.c:
Output to stderr
innobase/mtr/mtr0log.c:
Display pointers with %p
innobase/mtr/mtr0mtr.c:
Output to stderr
innobase/os/os0file.c:
Output to stream, not to memory buffer
innobase/os/os0proc.c:
Output to stderr
innobase/os/os0thread.c:
Output to stderr
innobase/page/page0cur.c:
Output to stderr
innobase/page/page0page.c:
Avoid sprintf()
Output to stderr instead of stdout
innobase/pars/pars0opt.c:
Output to stderr instead of stdout
innobase/rem/rem0rec.c:
Remove rec_sprintf()
Output to stderr instead of stdout
innobase/row/row0ins.c:
Output diagnostics to stream instead of memory buffer
innobase/row/row0mysql.c:
Output to stderr instead of stdout
Quote table and index names
innobase/row/row0purge.c:
Output to stderr instead of stdout
innobase/row/row0row.c:
Quote table and index names
innobase/row/row0sel.c:
Output to stderr instead of stdout
Quote table and index names
innobase/row/row0umod.c:
Avoid sprintf()
Quote table and index names
innobase/row/row0undo.c:
Output to stderr instead of stdout
innobase/row/row0upd.c:
Avoid sprintf()
innobase/srv/srv0srv.c:
Output to stderr instead of stdout
innobase/srv/srv0start.c:
Handle srv_monitor_file
Make some global variables static
innobase/sync/sync0arr.c:
Output to stderr instead of stdout
Output to stream instead of memory buffer
innobase/sync/sync0rw.c:
Output to stderr instead of stdout
innobase/sync/sync0sync.c:
Output to stderr instead of stdout
Output to stream instead of memory buffer
innobase/trx/trx0purge.c:
Output to stderr instead of stdout
innobase/trx/trx0rec.c:
Quote index and table names
Avoid sprintf()
innobase/trx/trx0roll.c:
Quote identifier names
Output to stderr instead of stdout
innobase/trx/trx0sys.c:
Output to stderr instead of stdout
innobase/trx/trx0trx.c:
Output to stream instead of memory buffer
innobase/trx/trx0undo.c:
Output to stderr instead of stdout
innobase/ut/ut0ut.c:
Declare mysql_get_identifier_quote_char()
Remove ut_sprintf_buf()
Add ut_print_name() and ut_print_namel()
Add ut_copy_file()
sql/ha_innodb.cc:
innobase_mysql_print_thd(): output to stream, not to memory buffer
Add mysql_get_identifier_quote_char()
Remove unused function innobase_print_error()
Display pointers with %p
Buffer InnoDB output via files, not via statically allocated memory
2004-04-06 15:14:43 +02:00
|
|
|
"o_offset %lu\n"
|
2003-06-15 00:04:28 +02:00
|
|
|
"mismatch index %lu, end_seg_len %lu\n"
|
|
|
|
"parsed len %lu\n",
|
2005-01-25 11:10:24 +01:00
|
|
|
(ulong) is_short, (ulong) info_and_status_bits,
|
|
|
|
(ulong) offset,
|
2003-12-20 02:41:04 +01:00
|
|
|
(ulong) origin_offset,
|
|
|
|
(ulong) mismatch_index, (ulong) end_seg_len,
|
|
|
|
(ulong) (ptr - ptr2));
|
2003-06-15 00:04:28 +02:00
|
|
|
|
InnoDB: send diagnostic output to stderr or files
instead of stdout or fixed-size memory buffers
innobase/btr/btr0btr.c:
Output to stderr; quote table and index names
innobase/btr/btr0cur.c:
Output to stderr; quote table and index names
innobase/btr/btr0sea.c:
Output to stderr
innobase/buf/buf0buf.c:
Output to stderr; quote table and index names
innobase/buf/buf0flu.c:
Output to stderr
innobase/buf/buf0lru.c:
Output to stderr
innobase/buf/buf0rea.c:
Output to stderr
innobase/data/data0data.c:
Remove dtuple_validate() unless #ifdef UNIV_DEBUG
Remove unnecessary sprintf() calls
Output to stderr
innobase/data/data0type.c:
Output to stderr
innobase/dict/dict0boot.c:
Remove dummy call to printf()
innobase/dict/dict0crea.c:
Output diagnostic information to stream, not to memory
innobase/dict/dict0dict.c:
Output diagnostics to a file, not to a memory buffer
innobase/dict/dict0load.c:
Output to stderr; quote table and index names
innobase/eval/eval0eval.c:
Output to stderr
innobase/fil/fil0fil.c:
Output to stderr
innobase/fsp/fsp0fsp.c:
Output to stderr
Avoid sprintf()
innobase/fut/fut0lst.c:
Output to stderr
innobase/ha/ha0ha.c:
Output to stream, not to memory buffer
innobase/ibuf/ibuf0ibuf.c:
Output to stderr
Avoid sprintf()
innobase/include/buf0buf.h:
Output to stream, not to memory buffer
innobase/include/buf0buf.ic:
Use %p for displaying pointers
innobase/include/data0data.h:
Remove dtuple_sprintf()
innobase/include/dict0dict.h:
Output to stream, not to memory buffer
innobase/include/ha0ha.h:
Output to stream, not to memory buffer
innobase/include/ibuf0ibuf.h:
Output to stream, not to memory buffer
innobase/include/lock0lock.h:
Output to stream, not to memory buffer
innobase/include/log0log.h:
Output to stream, not to memory buffer
innobase/include/mtr0log.ic:
Output to stderr
Display pointers with %p
innobase/include/os0file.h:
Output to stream, not to memory buffer
innobase/include/rem0rec.h:
Remove rec_sprintf()
innobase/include/rem0rec.ic:
Output to stderr
innobase/include/row0sel.ic:
Output to stderr
innobase/include/row0upd.ic:
Quote table and index names
innobase/include/srv0srv.h:
Remove srv_sprintf_innodb_monitor()
innobase/include/sync0arr.h:
Output to stream, not to memory buffer
innobase/include/sync0sync.h:
Output to stream, not to memory buffer
innobase/include/trx0sys.h:
Output to stderr
innobase/include/trx0trx.h:
Output to stream, not to memory buffer
innobase/include/ut0ut.h:
Remove ut_sprintf_buf()
Add ut_print_name(), ut_print_namel() and ut_copy_file()
innobase/lock/lock0lock.c:
Output to stream, not to memory buffer
innobase/log/log0log.c:
Output to stderr
innobase/log/log0recv.c:
Output to stderr
innobase/mem/mem0dbg.c:
Output to stderr
innobase/mtr/mtr0log.c:
Display pointers with %p
innobase/mtr/mtr0mtr.c:
Output to stderr
innobase/os/os0file.c:
Output to stream, not to memory buffer
innobase/os/os0proc.c:
Output to stderr
innobase/os/os0thread.c:
Output to stderr
innobase/page/page0cur.c:
Output to stderr
innobase/page/page0page.c:
Avoid sprintf()
Output to stderr instead of stdout
innobase/pars/pars0opt.c:
Output to stderr instead of stdout
innobase/rem/rem0rec.c:
Remove rec_sprintf()
Output to stderr instead of stdout
innobase/row/row0ins.c:
Output diagnostics to stream instead of memory buffer
innobase/row/row0mysql.c:
Output to stderr instead of stdout
Quote table and index names
innobase/row/row0purge.c:
Output to stderr instead of stdout
innobase/row/row0row.c:
Quote table and index names
innobase/row/row0sel.c:
Output to stderr instead of stdout
Quote table and index names
innobase/row/row0umod.c:
Avoid sprintf()
Quote table and index names
innobase/row/row0undo.c:
Output to stderr instead of stdout
innobase/row/row0upd.c:
Avoid sprintf()
innobase/srv/srv0srv.c:
Output to stderr instead of stdout
innobase/srv/srv0start.c:
Handle srv_monitor_file
Make some global variables static
innobase/sync/sync0arr.c:
Output to stderr instead of stdout
Output to stream instead of memory buffer
innobase/sync/sync0rw.c:
Output to stderr instead of stdout
innobase/sync/sync0sync.c:
Output to stderr instead of stdout
Output to stream instead of memory buffer
innobase/trx/trx0purge.c:
Output to stderr instead of stdout
innobase/trx/trx0rec.c:
Quote index and table names
Avoid sprintf()
innobase/trx/trx0roll.c:
Quote identifier names
Output to stderr instead of stdout
innobase/trx/trx0sys.c:
Output to stderr instead of stdout
innobase/trx/trx0trx.c:
Output to stream instead of memory buffer
innobase/trx/trx0undo.c:
Output to stderr instead of stdout
innobase/ut/ut0ut.c:
Declare mysql_get_identifier_quote_char()
Remove ut_sprintf_buf()
Add ut_print_name() and ut_print_namel()
Add ut_copy_file()
sql/ha_innodb.cc:
innobase_mysql_print_thd(): output to stream, not to memory buffer
Add mysql_get_identifier_quote_char()
Remove unused function innobase_print_error()
Display pointers with %p
Buffer InnoDB output via files, not via statically allocated memory
2004-04-06 15:14:43 +02:00
|
|
|
fputs("Dump of 300 bytes of log:\n", stderr);
|
|
|
|
ut_print_buf(stderr, ptr2, 300);
|
2003-06-15 00:04:28 +02:00
|
|
|
|
|
|
|
buf_page_print(page);
|
|
|
|
|
2004-03-13 21:48:00 +01:00
|
|
|
ut_error;
|
2003-06-15 00:04:28 +02:00
|
|
|
}
|
2002-06-22 19:41:14 +02:00
|
|
|
|
2004-12-02 18:45:07 +01:00
|
|
|
ut_memcpy(buf, rec_get_start(cursor_rec, offsets), mismatch_index);
|
2001-02-17 13:19:19 +01:00
|
|
|
ut_memcpy(buf + mismatch_index, ptr, end_seg_len);
|
|
|
|
|
InnoDB: Performance optimizations based on OProfile analysis
innobase/btr/btr0btr.c:
Eliminate some buf_frame_align() calls.
Make use of the page_rec_is_infimum(), page_rec_is_supremum()
and page_rec_is_user_rec() functions.
Replace some index->table->comp with page_is_comp().
Eliminate some variables to reduce register spilling on x86.
Note that page_is_comp() may return nonzero instead of TRUE.
Note that rec_offs_comp() may return nonzero instead of TRUE.
innobase/btr/btr0cur.c:
Eliminate some buf_frame_align() calls.
Replace some index->table->comp with
page_is_comp() or rec_offs_comp().
Eliminate some variables to reduce register spilling on x86.
Note that page_is_comp() may return nonzero instead of TRUE.
Note that rec_offs_comp() may return nonzero instead of TRUE.
Remove an extra mem_heap_create() call from btr_cur_update_in_place().
Add "page" parameter to lock_rec_store_on_page_infimum().
Add some UNIV_LIKELY() and UNIV_UNLIKELY() hints.
btr_estimate_number_of_different_key_vals(): Rename the
offsets_* variables to be more descriptive and eliminate one
rec_get_offsets() and one page_rec_get_next() call in the loop.
innobase/btr/btr0pcur.c:
Eliminate some buf_frame_align() calls.
Make use of the page_rec_is_infimum(), page_rec_is_supremum()
and page_rec_is_user_rec() functions.
Replace some index->table->comp with page_is_comp().
Eliminate some variables to reduce register spilling on x86.
Note that page_is_comp() may return nonzero instead of TRUE.
Make some ut_a() assertions ut_ad() ones to improve performance.
Add some UNIV_LIKELY() and UNIV_UNLIKELY() hints.
innobase/btr/btr0sea.c:
Make use of page_rec_is_infimum() and page_rec_is_supremum().
Eliminate some buf_frame_align() calls.
Add some UNIV_UNLIKELY and UNIV_LIKELY hints.
Turn some assertions into debug assertions.
innobase/dict/dict0crea.c:
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp
innobase/ibuf/ibuf0ibuf.c:
Make use of page_rec_is_infimum() and page_rec_is_supremum().
Add some UNIV_UNLIKELY and UNIV_LIKELY hints.
ibuf_get_merge_page_nos(): Rename parameter "first_rec" to "rec"
and eliminate local variable "rec".
innobase/include/btr0btr.h:
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp
innobase/include/buf0buf.h:
Rename buf_frame_get_modify_clock()
to buf_block_get_modify_clock().
innobase/include/buf0buf.ic:
Rename buf_frame_get_modify_clock()
to buf_block_get_modify_clock() and
remove the buf_block_align() call.
innobase/include/lock0lock.h:
lock_rec_store_on_page_infimum(): Add parameter "page"
innobase/include/mach0data.h:
Add mach_encode_2() and mach_decode_2().
innobase/include/mach0data.ic:
Add mach_encode_2() and mach_decode_2().
innobase/include/page0cur.h:
Add const qualifier to page_cur_is_before_first()
and page_cur_is_after_last().
innobase/include/page0cur.ic:
Make use of page_rec_is_infimum() and page_rec_is_supremum().
innobase/include/page0page.h:
Remove page_rec_is_first_user_rec() and page_rec_is_last_user_rec().
Add page_rec_is_infimum() and page_rec_is_supremum().
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp.
innobase/include/page0page.ic:
Remove page_rec_is_first_user_rec() and page_rec_is_last_user_rec().
Add page_rec_is_infimum() and page_rec_is_supremum().
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp.
Add UNIV_UNLIKELY, UNIV_LIKELY and UNIV_EXPECT hints.
Reduce the number of buf_frame_align() calls.
innobase/include/rem0rec.ic:
rec_offs_comp(): Return zero or nonzero instead of FALSE or TRUE.
innobase/include/row0mysql.h:
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp.
innobase/lock/lock0lock.c:
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp.
Remove parameter "comp" from lock_rec_get_next(),
lock_rec_has_expl() and lock_rec_other_has_expl_req().
Add parameter "page" to lock_rec_store_on_page_infimum().
Add UNIV_UNLIKELY hints.
Reduce the number of buf_frame_align() calls.
Make use of page_rec_is_infimum(), page_rec_is_supremum() and
page_rec_is_user_rec().
Move the "comp" flag outside some loops.
innobase/mtr/mtr0log.c:
Replace index->table->comp with page_rec_is_comp().
innobase/page/page0cur.c:
Replace index->table->comp with page_is_comp() or page_rec_is_comp().
Eliminate some buf_frame_align() calls.
Add some debug assertions.
innobase/page/page0page.c:
Optimize page_dir_find_owner_slot(). Compare the record offset
16 bits at a time, because that seems to be the only way to avoid
register spilling on x86.
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp.
Remove parameter "page" of page_delete_rec_list_write_log().
Make use of page_rec_is_infimum().
innobase/rem/rem0cmp.c:
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp.
innobase/row/row0ins.c:
Make use of page_rec_is_infimum() and page_rec_is_supremum().
Reduce the amount of buf_frame_align() calls.
row_ins_index_entry_low(): Disable assertion about column count
unless #ifdef UNIV_DEBUG.
innobase/row/row0mysql.c:
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp.
innobase/row/row0row.c:
Eliminate some buf_frame_align() calls.
Make use of page_rec_is_infimum().
innobase/row/row0sel.c:
Make use of page_rec_is_supremum() and page_rec_is_infimum().
Turn some assertions into debug assertions.
Add UNIV_LIKELY and UNIV_UNLIKELY hints.
row_search_for_mysql(): Eliminate local variables "moved",
"cons_read_requires_clust_rec", "was_lock_wait", "shortcut",
"success" and "comp". Replace some of them with goto's.
Disable variable "cnt" unless #ifdef UNIV_SEARCH_DEBUG.
innobase/row/row0vers.c:
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp.
Replace index->table->comp with page_rec_is_comp().
Eliminate some buf_frame_align() calls.
2005-04-25 09:14:35 +02:00
|
|
|
rec_set_info_and_status_bits(buf + origin_offset, page_is_comp(page),
|
2005-01-25 11:10:24 +01:00
|
|
|
info_and_status_bits);
|
2001-02-17 13:19:19 +01:00
|
|
|
|
|
|
|
page_cur_position(cursor_rec, &cursor);
|
|
|
|
|
2005-01-25 11:10:24 +01:00
|
|
|
offsets = rec_get_offsets(buf + origin_offset, index, offsets,
|
|
|
|
ULINT_UNDEFINED, &heap);
|
|
|
|
page_cur_rec_insert(&cursor, buf + origin_offset, index, offsets, mtr);
|
2001-02-17 13:19:19 +01:00
|
|
|
|
InnoDB cleanup: fixing buffer overflows and quoting of quotes
innobase/dict/dict0crea.c:
Remove unneeded prototypes for static functions
Remove unused parameters from some functions
Replace some assertions with compile-time checks
dict_create_add_foreigns_to_dictionary():
allocate space dynamically for the SQL, and quote quotes
innobase/dict/dict0dict.c:
Remove unnecessary prototypes for static functions
dict_tables_have_same_db(): Remove length limitation
dict_remove_db_name(): Use strchr()
dict_get_db_name_len(): Use strchr()
Replace mem_heap_alloc()+strlen()+memcpy() with mem_heap_strdup()
Remove unnecessary strlen() calls
Allocate space dynamically for generated strings
dict_scan_id(): allow quotes within quoted strings
innobase/dict/dict0load.c:
Remove unnecessary strlen() calls
Replace mem_heap_alloc()+strlen()+memcpy() with mem_heap_strdup()
innobase/dict/dict0mem.c:
Replace mem_heap_alloc()+strlen()+memcpy() with mem_heap_strdup()
innobase/eval/eval0eval.c:
Make TO_CHAR() work with any machine word width
innobase/fil/fil0fil.c:
Replace mem_alloc()+strlen()+strcpy() with mem_strdup()
innobase/ibuf/ibuf0ibuf.c:
Make some global variables static
Add #ifdef UNIV_IBUF_DEBUG around debug statements
innobase/include/data0data.h:
Add #ifdef UNIV_DEBUG around dtuple_validate()
innobase/include/data0data.ic:
Replace = with == in ut_ad(tuple->magic_n == DATA_TUPLE_MAGIC_N)
innobase/include/dict0dict.h:
Add const qualifiers
innobase/include/lock0lock.h:
Add UL suffixes to unsigned long masks
innobase/include/log0log.h:
Remove unused parameter "type" of log_group_write_buf()
innobase/include/mem0mem.h:
Add mem_strdup(), mem_strdupl(), mem_strdupq(), mem_heap_strdup(),
and mem_heap_strdupl()
innobase/include/mem0mem.ic:
Add mem_strdup(), mem_strdupl(), mem_strdupq(), mem_heap_strdup(),
and mem_heap_strdupl()
innobase/include/row0uins.h:
Remove unused parameter "thr" of row_undo_ins()
innobase/include/row0undo.h:
Remvoe unused parameter "thr" of row_undo_search_clust_to_pcur()
innobase/include/ut0byte.h:
Add const qualifier to ut_cpy_in_lower_case()
Remove parameter "len" of ut_cmp_in_lower_case()
innobase/include/ut0mem.h:
Add ut_strlenq(), ut_strcpyq() and ut_memcpyq()
innobase/include/ut0mem.ic:
Add ut_strlenq()
innobase/include/ut0ut.h:
Declare ut_sprintf() as a printf-style function
innobase/lock/lock0lock.c:
lock_clust_rec_modify_check_and_lock(): Remove unused variable "trx"
innobase/log/log0log.c:
Remove unused parameters
innobase/log/log0recv.c:
Remove parameter "type" from log_group_write_buf()
innobase/mem/mem0mem.c:
Simplify the initialization of block->init_block
innobase/mtr/mtr0log.c:
Add a debug assertion to mlog_parse_initial_log_record()
innobase/page/page0cur.c:
Add debug assertion to page_cur_insert_rec_write_log()
Remove hard-coded buffer size in page_cur_parse_insert_rec()
innobase/page/page0page.c:
Remove unneeded variable rec
innobase/pars/pars0opt.c:
Correct a potential buffer overflow
innobase/pars/pars0pars.c:
Replace mem_heap_alloc()+strlen()+memcpy() with mem_heap_strdup()
innobase/row/row0ins.c:
Replace parameter "thr" with "trx" in row_ins_foreign_report_add_err()
Remove unnecessary strlen() call
Use strchr()
innobase/row/row0mysql.c:
Add row_mysql_is_recovered_tmp_table()
Add row_mysql_is_system_table()
Compare reserved table names with exact match
Use strstr() and strchr() and mem_strdupl()
Compute space needed for generated SQL, and allocate it dynamically
innobase/row/row0purge.c:
Remove unused parameters "thr"
innobase/row/row0row.c:
Simplify row_get_clust_rec()
innobase/row/row0uins.c:
Remove unused parameters "thr"
innobase/row/row0umod.c:
Remove unused variable "index"
row_undo_mod_del_unmark_sec_and_undo_update():
Remove parameter "node" and variable "rec"
Remove unused parameters "thr"
innobase/row/row0undo.c:
Remove unused parameters "thr"
innobase/srv/srv0srv.c:
Replace UT_NOT_USED() with __attribute__((unused))
innobase/srv/srv0start.c:
Remove unnecessary strlen() calls
Remove unused parameter "create_new_db" of open_or_create_log_file()
innobase/trx/trx0roll.c:
Replace mem_alloc()+strlen()+memcpy() with mem_strdup()
innobase/trx/trx0sys.c:
Remove unnecessary strlen() call
innobase/ut/ut0byte.c:
Add const qualifier to ut_cpy_in_lower_case()
Remove parameter "len" of ut_cmp_in_lower_case()
innobase/ut/ut0mem.c:
Add ut_strlenq() and ut_memcpyq()
sql/ha_innodb.cc:
Remove parameter "len" of ut_cmp_in_lower_case()
2004-04-01 15:51:34 +02:00
|
|
|
if (buf != buf1) {
|
2001-02-17 13:19:19 +01:00
|
|
|
|
|
|
|
mem_free(buf);
|
|
|
|
}
|
|
|
|
|
2005-04-21 13:23:26 +02:00
|
|
|
if (UNIV_LIKELY_NULL(heap)) {
|
2004-12-09 14:29:55 +01:00
|
|
|
mem_heap_free(heap);
|
|
|
|
}
|
|
|
|
|
2001-02-17 13:19:19 +01:00
|
|
|
return(ptr + end_seg_len);
|
|
|
|
}
|
|
|
|
|
|
|
|
/***************************************************************
|
|
|
|
Inserts a record next to page cursor. Returns pointer to inserted record if
|
|
|
|
succeed, i.e., enough space available, NULL otherwise. The record to be
|
|
|
|
inserted can be in a data tuple or as a physical record. The other parameter
|
|
|
|
must then be NULL. The cursor stays at the same position. */
|
|
|
|
|
|
|
|
rec_t*
|
|
|
|
page_cur_insert_rec_low(
|
|
|
|
/*====================*/
|
|
|
|
/* out: pointer to record if succeed, NULL
|
|
|
|
otherwise */
|
|
|
|
page_cur_t* cursor, /* in: a page cursor */
|
2004-12-02 18:45:07 +01:00
|
|
|
dtuple_t* tuple, /* in: pointer to a data tuple or NULL */
|
|
|
|
dict_index_t* index, /* in: record descriptor */
|
|
|
|
rec_t* rec, /* in: pointer to a physical record or NULL */
|
2005-01-25 11:10:24 +01:00
|
|
|
ulint* offsets,/* in: rec_get_offsets(rec, index) or NULL */
|
2001-02-17 13:19:19 +01:00
|
|
|
mtr_t* mtr) /* in: mini-transaction handle */
|
|
|
|
{
|
2004-12-02 18:45:07 +01:00
|
|
|
byte* insert_buf = NULL;
|
|
|
|
ulint rec_size;
|
|
|
|
byte* page; /* the relevant page */
|
|
|
|
rec_t* last_insert; /* cursor position at previous insert */
|
|
|
|
rec_t* insert_rec; /* inserted record */
|
|
|
|
ulint heap_no; /* heap number of the inserted record */
|
|
|
|
rec_t* current_rec; /* current record after which the
|
|
|
|
new record is inserted */
|
|
|
|
rec_t* next_rec; /* next record after current before
|
|
|
|
the insertion */
|
|
|
|
ulint owner_slot; /* the slot which owns the
|
|
|
|
inserted record */
|
|
|
|
rec_t* owner_rec;
|
|
|
|
ulint n_owned;
|
2004-12-09 14:29:55 +01:00
|
|
|
mem_heap_t* heap = NULL;
|
InnoDB: Performance optimizations based on OProfile analysis
innobase/btr/btr0btr.c:
Eliminate some buf_frame_align() calls.
Make use of the page_rec_is_infimum(), page_rec_is_supremum()
and page_rec_is_user_rec() functions.
Replace some index->table->comp with page_is_comp().
Eliminate some variables to reduce register spilling on x86.
Note that page_is_comp() may return nonzero instead of TRUE.
Note that rec_offs_comp() may return nonzero instead of TRUE.
innobase/btr/btr0cur.c:
Eliminate some buf_frame_align() calls.
Replace some index->table->comp with
page_is_comp() or rec_offs_comp().
Eliminate some variables to reduce register spilling on x86.
Note that page_is_comp() may return nonzero instead of TRUE.
Note that rec_offs_comp() may return nonzero instead of TRUE.
Remove an extra mem_heap_create() call from btr_cur_update_in_place().
Add "page" parameter to lock_rec_store_on_page_infimum().
Add some UNIV_LIKELY() and UNIV_UNLIKELY() hints.
btr_estimate_number_of_different_key_vals(): Rename the
offsets_* variables to be more descriptive and eliminate one
rec_get_offsets() and one page_rec_get_next() call in the loop.
innobase/btr/btr0pcur.c:
Eliminate some buf_frame_align() calls.
Make use of the page_rec_is_infimum(), page_rec_is_supremum()
and page_rec_is_user_rec() functions.
Replace some index->table->comp with page_is_comp().
Eliminate some variables to reduce register spilling on x86.
Note that page_is_comp() may return nonzero instead of TRUE.
Make some ut_a() assertions ut_ad() ones to improve performance.
Add some UNIV_LIKELY() and UNIV_UNLIKELY() hints.
innobase/btr/btr0sea.c:
Make use of page_rec_is_infimum() and page_rec_is_supremum().
Eliminate some buf_frame_align() calls.
Add some UNIV_UNLIKELY and UNIV_LIKELY hints.
Turn some assertions into debug assertions.
innobase/dict/dict0crea.c:
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp
innobase/ibuf/ibuf0ibuf.c:
Make use of page_rec_is_infimum() and page_rec_is_supremum().
Add some UNIV_UNLIKELY and UNIV_LIKELY hints.
ibuf_get_merge_page_nos(): Rename parameter "first_rec" to "rec"
and eliminate local variable "rec".
innobase/include/btr0btr.h:
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp
innobase/include/buf0buf.h:
Rename buf_frame_get_modify_clock()
to buf_block_get_modify_clock().
innobase/include/buf0buf.ic:
Rename buf_frame_get_modify_clock()
to buf_block_get_modify_clock() and
remove the buf_block_align() call.
innobase/include/lock0lock.h:
lock_rec_store_on_page_infimum(): Add parameter "page"
innobase/include/mach0data.h:
Add mach_encode_2() and mach_decode_2().
innobase/include/mach0data.ic:
Add mach_encode_2() and mach_decode_2().
innobase/include/page0cur.h:
Add const qualifier to page_cur_is_before_first()
and page_cur_is_after_last().
innobase/include/page0cur.ic:
Make use of page_rec_is_infimum() and page_rec_is_supremum().
innobase/include/page0page.h:
Remove page_rec_is_first_user_rec() and page_rec_is_last_user_rec().
Add page_rec_is_infimum() and page_rec_is_supremum().
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp.
innobase/include/page0page.ic:
Remove page_rec_is_first_user_rec() and page_rec_is_last_user_rec().
Add page_rec_is_infimum() and page_rec_is_supremum().
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp.
Add UNIV_UNLIKELY, UNIV_LIKELY and UNIV_EXPECT hints.
Reduce the number of buf_frame_align() calls.
innobase/include/rem0rec.ic:
rec_offs_comp(): Return zero or nonzero instead of FALSE or TRUE.
innobase/include/row0mysql.h:
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp.
innobase/lock/lock0lock.c:
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp.
Remove parameter "comp" from lock_rec_get_next(),
lock_rec_has_expl() and lock_rec_other_has_expl_req().
Add parameter "page" to lock_rec_store_on_page_infimum().
Add UNIV_UNLIKELY hints.
Reduce the number of buf_frame_align() calls.
Make use of page_rec_is_infimum(), page_rec_is_supremum() and
page_rec_is_user_rec().
Move the "comp" flag outside some loops.
innobase/mtr/mtr0log.c:
Replace index->table->comp with page_rec_is_comp().
innobase/page/page0cur.c:
Replace index->table->comp with page_is_comp() or page_rec_is_comp().
Eliminate some buf_frame_align() calls.
Add some debug assertions.
innobase/page/page0page.c:
Optimize page_dir_find_owner_slot(). Compare the record offset
16 bits at a time, because that seems to be the only way to avoid
register spilling on x86.
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp.
Remove parameter "page" of page_delete_rec_list_write_log().
Make use of page_rec_is_infimum().
innobase/rem/rem0cmp.c:
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp.
innobase/row/row0ins.c:
Make use of page_rec_is_infimum() and page_rec_is_supremum().
Reduce the amount of buf_frame_align() calls.
row_ins_index_entry_low(): Disable assertion about column count
unless #ifdef UNIV_DEBUG.
innobase/row/row0mysql.c:
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp.
innobase/row/row0row.c:
Eliminate some buf_frame_align() calls.
Make use of page_rec_is_infimum().
innobase/row/row0sel.c:
Make use of page_rec_is_supremum() and page_rec_is_infimum().
Turn some assertions into debug assertions.
Add UNIV_LIKELY and UNIV_UNLIKELY hints.
row_search_for_mysql(): Eliminate local variables "moved",
"cons_read_requires_clust_rec", "was_lock_wait", "shortcut",
"success" and "comp". Replace some of them with goto's.
Disable variable "cnt" unless #ifdef UNIV_SEARCH_DEBUG.
innobase/row/row0vers.c:
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp.
Replace index->table->comp with page_rec_is_comp().
Eliminate some buf_frame_align() calls.
2005-04-25 09:14:35 +02:00
|
|
|
ulint comp;
|
2004-12-02 18:45:07 +01:00
|
|
|
|
2001-02-17 13:19:19 +01:00
|
|
|
ut_ad(cursor && mtr);
|
|
|
|
ut_ad(tuple || rec);
|
|
|
|
ut_ad(!(tuple && rec));
|
|
|
|
ut_ad(rec || dtuple_check_typed(tuple));
|
|
|
|
|
|
|
|
page = page_cur_get_page(cursor);
|
InnoDB: Performance optimizations based on OProfile analysis
innobase/btr/btr0btr.c:
Eliminate some buf_frame_align() calls.
Make use of the page_rec_is_infimum(), page_rec_is_supremum()
and page_rec_is_user_rec() functions.
Replace some index->table->comp with page_is_comp().
Eliminate some variables to reduce register spilling on x86.
Note that page_is_comp() may return nonzero instead of TRUE.
Note that rec_offs_comp() may return nonzero instead of TRUE.
innobase/btr/btr0cur.c:
Eliminate some buf_frame_align() calls.
Replace some index->table->comp with
page_is_comp() or rec_offs_comp().
Eliminate some variables to reduce register spilling on x86.
Note that page_is_comp() may return nonzero instead of TRUE.
Note that rec_offs_comp() may return nonzero instead of TRUE.
Remove an extra mem_heap_create() call from btr_cur_update_in_place().
Add "page" parameter to lock_rec_store_on_page_infimum().
Add some UNIV_LIKELY() and UNIV_UNLIKELY() hints.
btr_estimate_number_of_different_key_vals(): Rename the
offsets_* variables to be more descriptive and eliminate one
rec_get_offsets() and one page_rec_get_next() call in the loop.
innobase/btr/btr0pcur.c:
Eliminate some buf_frame_align() calls.
Make use of the page_rec_is_infimum(), page_rec_is_supremum()
and page_rec_is_user_rec() functions.
Replace some index->table->comp with page_is_comp().
Eliminate some variables to reduce register spilling on x86.
Note that page_is_comp() may return nonzero instead of TRUE.
Make some ut_a() assertions ut_ad() ones to improve performance.
Add some UNIV_LIKELY() and UNIV_UNLIKELY() hints.
innobase/btr/btr0sea.c:
Make use of page_rec_is_infimum() and page_rec_is_supremum().
Eliminate some buf_frame_align() calls.
Add some UNIV_UNLIKELY and UNIV_LIKELY hints.
Turn some assertions into debug assertions.
innobase/dict/dict0crea.c:
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp
innobase/ibuf/ibuf0ibuf.c:
Make use of page_rec_is_infimum() and page_rec_is_supremum().
Add some UNIV_UNLIKELY and UNIV_LIKELY hints.
ibuf_get_merge_page_nos(): Rename parameter "first_rec" to "rec"
and eliminate local variable "rec".
innobase/include/btr0btr.h:
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp
innobase/include/buf0buf.h:
Rename buf_frame_get_modify_clock()
to buf_block_get_modify_clock().
innobase/include/buf0buf.ic:
Rename buf_frame_get_modify_clock()
to buf_block_get_modify_clock() and
remove the buf_block_align() call.
innobase/include/lock0lock.h:
lock_rec_store_on_page_infimum(): Add parameter "page"
innobase/include/mach0data.h:
Add mach_encode_2() and mach_decode_2().
innobase/include/mach0data.ic:
Add mach_encode_2() and mach_decode_2().
innobase/include/page0cur.h:
Add const qualifier to page_cur_is_before_first()
and page_cur_is_after_last().
innobase/include/page0cur.ic:
Make use of page_rec_is_infimum() and page_rec_is_supremum().
innobase/include/page0page.h:
Remove page_rec_is_first_user_rec() and page_rec_is_last_user_rec().
Add page_rec_is_infimum() and page_rec_is_supremum().
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp.
innobase/include/page0page.ic:
Remove page_rec_is_first_user_rec() and page_rec_is_last_user_rec().
Add page_rec_is_infimum() and page_rec_is_supremum().
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp.
Add UNIV_UNLIKELY, UNIV_LIKELY and UNIV_EXPECT hints.
Reduce the number of buf_frame_align() calls.
innobase/include/rem0rec.ic:
rec_offs_comp(): Return zero or nonzero instead of FALSE or TRUE.
innobase/include/row0mysql.h:
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp.
innobase/lock/lock0lock.c:
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp.
Remove parameter "comp" from lock_rec_get_next(),
lock_rec_has_expl() and lock_rec_other_has_expl_req().
Add parameter "page" to lock_rec_store_on_page_infimum().
Add UNIV_UNLIKELY hints.
Reduce the number of buf_frame_align() calls.
Make use of page_rec_is_infimum(), page_rec_is_supremum() and
page_rec_is_user_rec().
Move the "comp" flag outside some loops.
innobase/mtr/mtr0log.c:
Replace index->table->comp with page_rec_is_comp().
innobase/page/page0cur.c:
Replace index->table->comp with page_is_comp() or page_rec_is_comp().
Eliminate some buf_frame_align() calls.
Add some debug assertions.
innobase/page/page0page.c:
Optimize page_dir_find_owner_slot(). Compare the record offset
16 bits at a time, because that seems to be the only way to avoid
register spilling on x86.
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp.
Remove parameter "page" of page_delete_rec_list_write_log().
Make use of page_rec_is_infimum().
innobase/rem/rem0cmp.c:
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp.
innobase/row/row0ins.c:
Make use of page_rec_is_infimum() and page_rec_is_supremum().
Reduce the amount of buf_frame_align() calls.
row_ins_index_entry_low(): Disable assertion about column count
unless #ifdef UNIV_DEBUG.
innobase/row/row0mysql.c:
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp.
innobase/row/row0row.c:
Eliminate some buf_frame_align() calls.
Make use of page_rec_is_infimum().
innobase/row/row0sel.c:
Make use of page_rec_is_supremum() and page_rec_is_infimum().
Turn some assertions into debug assertions.
Add UNIV_LIKELY and UNIV_UNLIKELY hints.
row_search_for_mysql(): Eliminate local variables "moved",
"cons_read_requires_clust_rec", "was_lock_wait", "shortcut",
"success" and "comp". Replace some of them with goto's.
Disable variable "cnt" unless #ifdef UNIV_SEARCH_DEBUG.
innobase/row/row0vers.c:
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp.
Replace index->table->comp with page_rec_is_comp().
Eliminate some buf_frame_align() calls.
2005-04-25 09:14:35 +02:00
|
|
|
comp = page_is_comp(page);
|
|
|
|
ut_ad(index->table->comp == !!comp);
|
2004-12-02 18:45:07 +01:00
|
|
|
|
2001-02-17 13:19:19 +01:00
|
|
|
ut_ad(cursor->rec != page_get_supremum_rec(page));
|
|
|
|
|
|
|
|
/* 1. Get the size of the physical record in the page */
|
|
|
|
if (tuple != NULL) {
|
2004-12-02 18:45:07 +01:00
|
|
|
rec_size = rec_get_converted_size(index, tuple);
|
2001-02-17 13:19:19 +01:00
|
|
|
} else {
|
2005-01-25 11:10:24 +01:00
|
|
|
if (!offsets) {
|
|
|
|
offsets = rec_get_offsets(rec, index, offsets,
|
2004-12-09 14:29:55 +01:00
|
|
|
ULINT_UNDEFINED, &heap);
|
2005-01-25 11:10:24 +01:00
|
|
|
}
|
|
|
|
ut_ad(rec_offs_validate(rec, index, offsets));
|
2004-12-02 18:45:07 +01:00
|
|
|
rec_size = rec_offs_size(offsets);
|
2001-02-17 13:19:19 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/* 2. Try to find suitable space from page memory management */
|
2004-12-02 18:45:07 +01:00
|
|
|
insert_buf = page_mem_alloc(page, rec_size, index, &heap_no);
|
2001-02-17 13:19:19 +01:00
|
|
|
|
|
|
|
if (insert_buf == NULL) {
|
2005-04-21 13:23:26 +02:00
|
|
|
if (UNIV_LIKELY_NULL(heap)) {
|
2004-12-09 14:29:55 +01:00
|
|
|
mem_heap_free(heap);
|
|
|
|
}
|
2001-02-17 13:19:19 +01:00
|
|
|
return(NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* 3. Create the record */
|
|
|
|
if (tuple != NULL) {
|
2004-12-02 18:45:07 +01:00
|
|
|
insert_rec = rec_convert_dtuple_to_rec(insert_buf,
|
|
|
|
index, tuple);
|
2004-12-09 14:29:55 +01:00
|
|
|
offsets = rec_get_offsets(insert_rec, index, offsets,
|
|
|
|
ULINT_UNDEFINED, &heap);
|
2001-02-17 13:19:19 +01:00
|
|
|
} else {
|
2004-12-02 18:45:07 +01:00
|
|
|
insert_rec = rec_copy(insert_buf, rec, offsets);
|
2004-12-09 14:29:55 +01:00
|
|
|
ut_ad(rec_offs_validate(rec, index, offsets));
|
|
|
|
rec_offs_make_valid(insert_rec, index, offsets);
|
2001-02-17 13:19:19 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
ut_ad(insert_rec);
|
2004-12-02 18:45:07 +01:00
|
|
|
ut_ad(rec_size == rec_offs_size(offsets));
|
2001-02-17 13:19:19 +01:00
|
|
|
|
|
|
|
/* 4. Insert the record in the linked list of records */
|
|
|
|
current_rec = cursor->rec;
|
|
|
|
|
2004-12-02 18:45:07 +01:00
|
|
|
ut_ad(!comp || rec_get_status(current_rec) <= REC_STATUS_INFIMUM);
|
|
|
|
ut_ad(!comp || rec_get_status(insert_rec) < REC_STATUS_INFIMUM);
|
|
|
|
|
2001-02-17 13:19:19 +01:00
|
|
|
next_rec = page_rec_get_next(current_rec);
|
2004-12-02 18:45:07 +01:00
|
|
|
ut_ad(!comp || rec_get_status(next_rec) != REC_STATUS_INFIMUM);
|
2001-02-17 13:19:19 +01:00
|
|
|
page_rec_set_next(insert_rec, next_rec);
|
|
|
|
page_rec_set_next(current_rec, insert_rec);
|
|
|
|
|
|
|
|
page_header_set_field(page, PAGE_N_RECS, 1 + page_get_n_recs(page));
|
|
|
|
|
|
|
|
/* 5. Set the n_owned field in the inserted record to zero,
|
|
|
|
and set the heap_no field */
|
|
|
|
|
2004-12-02 18:45:07 +01:00
|
|
|
rec_set_n_owned(insert_rec, comp, 0);
|
|
|
|
rec_set_heap_no(insert_rec, comp, heap_no);
|
2001-02-17 13:19:19 +01:00
|
|
|
|
|
|
|
/* 6. Update the last insertion info in page header */
|
|
|
|
|
|
|
|
last_insert = page_header_get_ptr(page, PAGE_LAST_INSERT);
|
2004-12-02 18:45:07 +01:00
|
|
|
ut_ad(!last_insert || !comp
|
|
|
|
|| rec_get_node_ptr_flag(last_insert)
|
|
|
|
== rec_get_node_ptr_flag(insert_rec));
|
2001-02-17 13:19:19 +01:00
|
|
|
|
|
|
|
if (last_insert == NULL) {
|
|
|
|
page_header_set_field(page, PAGE_DIRECTION, PAGE_NO_DIRECTION);
|
|
|
|
page_header_set_field(page, PAGE_N_DIRECTION, 0);
|
|
|
|
|
|
|
|
} else if ((last_insert == current_rec)
|
|
|
|
&& (page_header_get_field(page, PAGE_DIRECTION) != PAGE_LEFT)) {
|
|
|
|
|
|
|
|
page_header_set_field(page, PAGE_DIRECTION, PAGE_RIGHT);
|
|
|
|
page_header_set_field(page, PAGE_N_DIRECTION,
|
|
|
|
page_header_get_field(page, PAGE_N_DIRECTION) + 1);
|
|
|
|
|
|
|
|
} else if ((page_rec_get_next(insert_rec) == last_insert)
|
|
|
|
&& (page_header_get_field(page, PAGE_DIRECTION) != PAGE_RIGHT)) {
|
|
|
|
|
|
|
|
page_header_set_field(page, PAGE_DIRECTION, PAGE_LEFT);
|
|
|
|
page_header_set_field(page, PAGE_N_DIRECTION,
|
|
|
|
page_header_get_field(page, PAGE_N_DIRECTION) + 1);
|
|
|
|
} else {
|
|
|
|
page_header_set_field(page, PAGE_DIRECTION, PAGE_NO_DIRECTION);
|
|
|
|
page_header_set_field(page, PAGE_N_DIRECTION, 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
page_header_set_ptr(page, PAGE_LAST_INSERT, insert_rec);
|
|
|
|
|
|
|
|
/* 7. It remains to update the owner record. */
|
|
|
|
|
|
|
|
owner_rec = page_rec_find_owner_rec(insert_rec);
|
2004-12-02 18:45:07 +01:00
|
|
|
n_owned = rec_get_n_owned(owner_rec, comp);
|
|
|
|
rec_set_n_owned(owner_rec, comp, n_owned + 1);
|
2001-02-17 13:19:19 +01:00
|
|
|
|
|
|
|
/* 8. Now we have incremented the n_owned field of the owner
|
|
|
|
record. If the number exceeds PAGE_DIR_SLOT_MAX_N_OWNED,
|
|
|
|
we have to split the corresponding directory slot in two. */
|
|
|
|
|
|
|
|
if (n_owned == PAGE_DIR_SLOT_MAX_N_OWNED) {
|
|
|
|
owner_slot = page_dir_find_owner_slot(owner_rec);
|
|
|
|
page_dir_split_slot(page, owner_slot);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* 9. Write log record of the insert */
|
2004-12-02 18:45:07 +01:00
|
|
|
page_cur_insert_rec_write_log(insert_rec, rec_size, current_rec,
|
|
|
|
index, mtr);
|
2001-02-17 13:19:19 +01:00
|
|
|
|
2005-04-21 13:23:26 +02:00
|
|
|
if (UNIV_LIKELY_NULL(heap)) {
|
2004-12-09 14:29:55 +01:00
|
|
|
mem_heap_free(heap);
|
|
|
|
}
|
2001-02-17 13:19:19 +01:00
|
|
|
return(insert_rec);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**************************************************************
|
|
|
|
Writes a log record of copying a record list end to a new created page. */
|
|
|
|
UNIV_INLINE
|
|
|
|
byte*
|
|
|
|
page_copy_rec_list_to_created_page_write_log(
|
|
|
|
/*=========================================*/
|
2004-12-02 18:45:07 +01:00
|
|
|
/* out: 4-byte field where to
|
|
|
|
write the log data length */
|
|
|
|
page_t* page, /* in: index page */
|
|
|
|
dict_index_t* index, /* in: record descriptor */
|
|
|
|
mtr_t* mtr) /* in: mtr */
|
2001-02-17 13:19:19 +01:00
|
|
|
{
|
|
|
|
byte* log_ptr;
|
|
|
|
|
InnoDB: Performance optimizations based on OProfile analysis
innobase/btr/btr0btr.c:
Eliminate some buf_frame_align() calls.
Make use of the page_rec_is_infimum(), page_rec_is_supremum()
and page_rec_is_user_rec() functions.
Replace some index->table->comp with page_is_comp().
Eliminate some variables to reduce register spilling on x86.
Note that page_is_comp() may return nonzero instead of TRUE.
Note that rec_offs_comp() may return nonzero instead of TRUE.
innobase/btr/btr0cur.c:
Eliminate some buf_frame_align() calls.
Replace some index->table->comp with
page_is_comp() or rec_offs_comp().
Eliminate some variables to reduce register spilling on x86.
Note that page_is_comp() may return nonzero instead of TRUE.
Note that rec_offs_comp() may return nonzero instead of TRUE.
Remove an extra mem_heap_create() call from btr_cur_update_in_place().
Add "page" parameter to lock_rec_store_on_page_infimum().
Add some UNIV_LIKELY() and UNIV_UNLIKELY() hints.
btr_estimate_number_of_different_key_vals(): Rename the
offsets_* variables to be more descriptive and eliminate one
rec_get_offsets() and one page_rec_get_next() call in the loop.
innobase/btr/btr0pcur.c:
Eliminate some buf_frame_align() calls.
Make use of the page_rec_is_infimum(), page_rec_is_supremum()
and page_rec_is_user_rec() functions.
Replace some index->table->comp with page_is_comp().
Eliminate some variables to reduce register spilling on x86.
Note that page_is_comp() may return nonzero instead of TRUE.
Make some ut_a() assertions ut_ad() ones to improve performance.
Add some UNIV_LIKELY() and UNIV_UNLIKELY() hints.
innobase/btr/btr0sea.c:
Make use of page_rec_is_infimum() and page_rec_is_supremum().
Eliminate some buf_frame_align() calls.
Add some UNIV_UNLIKELY and UNIV_LIKELY hints.
Turn some assertions into debug assertions.
innobase/dict/dict0crea.c:
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp
innobase/ibuf/ibuf0ibuf.c:
Make use of page_rec_is_infimum() and page_rec_is_supremum().
Add some UNIV_UNLIKELY and UNIV_LIKELY hints.
ibuf_get_merge_page_nos(): Rename parameter "first_rec" to "rec"
and eliminate local variable "rec".
innobase/include/btr0btr.h:
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp
innobase/include/buf0buf.h:
Rename buf_frame_get_modify_clock()
to buf_block_get_modify_clock().
innobase/include/buf0buf.ic:
Rename buf_frame_get_modify_clock()
to buf_block_get_modify_clock() and
remove the buf_block_align() call.
innobase/include/lock0lock.h:
lock_rec_store_on_page_infimum(): Add parameter "page"
innobase/include/mach0data.h:
Add mach_encode_2() and mach_decode_2().
innobase/include/mach0data.ic:
Add mach_encode_2() and mach_decode_2().
innobase/include/page0cur.h:
Add const qualifier to page_cur_is_before_first()
and page_cur_is_after_last().
innobase/include/page0cur.ic:
Make use of page_rec_is_infimum() and page_rec_is_supremum().
innobase/include/page0page.h:
Remove page_rec_is_first_user_rec() and page_rec_is_last_user_rec().
Add page_rec_is_infimum() and page_rec_is_supremum().
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp.
innobase/include/page0page.ic:
Remove page_rec_is_first_user_rec() and page_rec_is_last_user_rec().
Add page_rec_is_infimum() and page_rec_is_supremum().
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp.
Add UNIV_UNLIKELY, UNIV_LIKELY and UNIV_EXPECT hints.
Reduce the number of buf_frame_align() calls.
innobase/include/rem0rec.ic:
rec_offs_comp(): Return zero or nonzero instead of FALSE or TRUE.
innobase/include/row0mysql.h:
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp.
innobase/lock/lock0lock.c:
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp.
Remove parameter "comp" from lock_rec_get_next(),
lock_rec_has_expl() and lock_rec_other_has_expl_req().
Add parameter "page" to lock_rec_store_on_page_infimum().
Add UNIV_UNLIKELY hints.
Reduce the number of buf_frame_align() calls.
Make use of page_rec_is_infimum(), page_rec_is_supremum() and
page_rec_is_user_rec().
Move the "comp" flag outside some loops.
innobase/mtr/mtr0log.c:
Replace index->table->comp with page_rec_is_comp().
innobase/page/page0cur.c:
Replace index->table->comp with page_is_comp() or page_rec_is_comp().
Eliminate some buf_frame_align() calls.
Add some debug assertions.
innobase/page/page0page.c:
Optimize page_dir_find_owner_slot(). Compare the record offset
16 bits at a time, because that seems to be the only way to avoid
register spilling on x86.
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp.
Remove parameter "page" of page_delete_rec_list_write_log().
Make use of page_rec_is_infimum().
innobase/rem/rem0cmp.c:
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp.
innobase/row/row0ins.c:
Make use of page_rec_is_infimum() and page_rec_is_supremum().
Reduce the amount of buf_frame_align() calls.
row_ins_index_entry_low(): Disable assertion about column count
unless #ifdef UNIV_DEBUG.
innobase/row/row0mysql.c:
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp.
innobase/row/row0row.c:
Eliminate some buf_frame_align() calls.
Make use of page_rec_is_infimum().
innobase/row/row0sel.c:
Make use of page_rec_is_supremum() and page_rec_is_infimum().
Turn some assertions into debug assertions.
Add UNIV_LIKELY and UNIV_UNLIKELY hints.
row_search_for_mysql(): Eliminate local variables "moved",
"cons_read_requires_clust_rec", "was_lock_wait", "shortcut",
"success" and "comp". Replace some of them with goto's.
Disable variable "cnt" unless #ifdef UNIV_SEARCH_DEBUG.
innobase/row/row0vers.c:
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp.
Replace index->table->comp with page_rec_is_comp().
Eliminate some buf_frame_align() calls.
2005-04-25 09:14:35 +02:00
|
|
|
ut_ad(!!page_is_comp(page) == index->table->comp);
|
|
|
|
|
2004-12-02 18:45:07 +01:00
|
|
|
log_ptr = mlog_open_and_write_index(mtr, page, index,
|
InnoDB: Performance optimizations based on OProfile analysis
innobase/btr/btr0btr.c:
Eliminate some buf_frame_align() calls.
Make use of the page_rec_is_infimum(), page_rec_is_supremum()
and page_rec_is_user_rec() functions.
Replace some index->table->comp with page_is_comp().
Eliminate some variables to reduce register spilling on x86.
Note that page_is_comp() may return nonzero instead of TRUE.
Note that rec_offs_comp() may return nonzero instead of TRUE.
innobase/btr/btr0cur.c:
Eliminate some buf_frame_align() calls.
Replace some index->table->comp with
page_is_comp() or rec_offs_comp().
Eliminate some variables to reduce register spilling on x86.
Note that page_is_comp() may return nonzero instead of TRUE.
Note that rec_offs_comp() may return nonzero instead of TRUE.
Remove an extra mem_heap_create() call from btr_cur_update_in_place().
Add "page" parameter to lock_rec_store_on_page_infimum().
Add some UNIV_LIKELY() and UNIV_UNLIKELY() hints.
btr_estimate_number_of_different_key_vals(): Rename the
offsets_* variables to be more descriptive and eliminate one
rec_get_offsets() and one page_rec_get_next() call in the loop.
innobase/btr/btr0pcur.c:
Eliminate some buf_frame_align() calls.
Make use of the page_rec_is_infimum(), page_rec_is_supremum()
and page_rec_is_user_rec() functions.
Replace some index->table->comp with page_is_comp().
Eliminate some variables to reduce register spilling on x86.
Note that page_is_comp() may return nonzero instead of TRUE.
Make some ut_a() assertions ut_ad() ones to improve performance.
Add some UNIV_LIKELY() and UNIV_UNLIKELY() hints.
innobase/btr/btr0sea.c:
Make use of page_rec_is_infimum() and page_rec_is_supremum().
Eliminate some buf_frame_align() calls.
Add some UNIV_UNLIKELY and UNIV_LIKELY hints.
Turn some assertions into debug assertions.
innobase/dict/dict0crea.c:
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp
innobase/ibuf/ibuf0ibuf.c:
Make use of page_rec_is_infimum() and page_rec_is_supremum().
Add some UNIV_UNLIKELY and UNIV_LIKELY hints.
ibuf_get_merge_page_nos(): Rename parameter "first_rec" to "rec"
and eliminate local variable "rec".
innobase/include/btr0btr.h:
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp
innobase/include/buf0buf.h:
Rename buf_frame_get_modify_clock()
to buf_block_get_modify_clock().
innobase/include/buf0buf.ic:
Rename buf_frame_get_modify_clock()
to buf_block_get_modify_clock() and
remove the buf_block_align() call.
innobase/include/lock0lock.h:
lock_rec_store_on_page_infimum(): Add parameter "page"
innobase/include/mach0data.h:
Add mach_encode_2() and mach_decode_2().
innobase/include/mach0data.ic:
Add mach_encode_2() and mach_decode_2().
innobase/include/page0cur.h:
Add const qualifier to page_cur_is_before_first()
and page_cur_is_after_last().
innobase/include/page0cur.ic:
Make use of page_rec_is_infimum() and page_rec_is_supremum().
innobase/include/page0page.h:
Remove page_rec_is_first_user_rec() and page_rec_is_last_user_rec().
Add page_rec_is_infimum() and page_rec_is_supremum().
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp.
innobase/include/page0page.ic:
Remove page_rec_is_first_user_rec() and page_rec_is_last_user_rec().
Add page_rec_is_infimum() and page_rec_is_supremum().
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp.
Add UNIV_UNLIKELY, UNIV_LIKELY and UNIV_EXPECT hints.
Reduce the number of buf_frame_align() calls.
innobase/include/rem0rec.ic:
rec_offs_comp(): Return zero or nonzero instead of FALSE or TRUE.
innobase/include/row0mysql.h:
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp.
innobase/lock/lock0lock.c:
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp.
Remove parameter "comp" from lock_rec_get_next(),
lock_rec_has_expl() and lock_rec_other_has_expl_req().
Add parameter "page" to lock_rec_store_on_page_infimum().
Add UNIV_UNLIKELY hints.
Reduce the number of buf_frame_align() calls.
Make use of page_rec_is_infimum(), page_rec_is_supremum() and
page_rec_is_user_rec().
Move the "comp" flag outside some loops.
innobase/mtr/mtr0log.c:
Replace index->table->comp with page_rec_is_comp().
innobase/page/page0cur.c:
Replace index->table->comp with page_is_comp() or page_rec_is_comp().
Eliminate some buf_frame_align() calls.
Add some debug assertions.
innobase/page/page0page.c:
Optimize page_dir_find_owner_slot(). Compare the record offset
16 bits at a time, because that seems to be the only way to avoid
register spilling on x86.
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp.
Remove parameter "page" of page_delete_rec_list_write_log().
Make use of page_rec_is_infimum().
innobase/rem/rem0cmp.c:
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp.
innobase/row/row0ins.c:
Make use of page_rec_is_infimum() and page_rec_is_supremum().
Reduce the amount of buf_frame_align() calls.
row_ins_index_entry_low(): Disable assertion about column count
unless #ifdef UNIV_DEBUG.
innobase/row/row0mysql.c:
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp.
innobase/row/row0row.c:
Eliminate some buf_frame_align() calls.
Make use of page_rec_is_infimum().
innobase/row/row0sel.c:
Make use of page_rec_is_supremum() and page_rec_is_infimum().
Turn some assertions into debug assertions.
Add UNIV_LIKELY and UNIV_UNLIKELY hints.
row_search_for_mysql(): Eliminate local variables "moved",
"cons_read_requires_clust_rec", "was_lock_wait", "shortcut",
"success" and "comp". Replace some of them with goto's.
Disable variable "cnt" unless #ifdef UNIV_SEARCH_DEBUG.
innobase/row/row0vers.c:
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp.
Replace index->table->comp with page_rec_is_comp().
Eliminate some buf_frame_align() calls.
2005-04-25 09:14:35 +02:00
|
|
|
page_is_comp(page)
|
2004-12-02 18:45:07 +01:00
|
|
|
? MLOG_COMP_LIST_END_COPY_CREATED
|
|
|
|
: MLOG_LIST_END_COPY_CREATED, 4);
|
|
|
|
ut_a(log_ptr);
|
2001-02-17 13:19:19 +01:00
|
|
|
mlog_close(mtr, log_ptr + 4);
|
|
|
|
|
|
|
|
return(log_ptr);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**************************************************************
|
|
|
|
Parses a log record of copying a record list end to a new created page. */
|
|
|
|
|
|
|
|
byte*
|
|
|
|
page_parse_copy_rec_list_to_created_page(
|
|
|
|
/*=====================================*/
|
2004-12-02 18:45:07 +01:00
|
|
|
/* out: end of log record or NULL */
|
|
|
|
byte* ptr, /* in: buffer */
|
|
|
|
byte* end_ptr,/* in: buffer end */
|
|
|
|
dict_index_t* index, /* in: record descriptor */
|
|
|
|
page_t* page, /* in: page or NULL */
|
|
|
|
mtr_t* mtr) /* in: mtr or NULL */
|
2001-02-17 13:19:19 +01:00
|
|
|
{
|
|
|
|
byte* rec_end;
|
|
|
|
ulint log_data_len;
|
|
|
|
|
|
|
|
if (ptr + 4 > end_ptr) {
|
|
|
|
|
|
|
|
return(NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
log_data_len = mach_read_from_4(ptr);
|
|
|
|
ptr += 4;
|
|
|
|
|
|
|
|
rec_end = ptr + log_data_len;
|
|
|
|
|
|
|
|
if (rec_end > end_ptr) {
|
|
|
|
|
|
|
|
return(NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!page) {
|
|
|
|
|
|
|
|
return(rec_end);
|
|
|
|
}
|
|
|
|
|
|
|
|
while (ptr < rec_end) {
|
2004-12-02 18:45:07 +01:00
|
|
|
ptr = page_cur_parse_insert_rec(TRUE, ptr, end_ptr,
|
|
|
|
index, page, mtr);
|
2001-02-17 13:19:19 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
ut_a(ptr == rec_end);
|
|
|
|
|
|
|
|
page_header_set_ptr(page, PAGE_LAST_INSERT, NULL);
|
|
|
|
page_header_set_field(page, PAGE_DIRECTION, PAGE_NO_DIRECTION);
|
|
|
|
page_header_set_field(page, PAGE_N_DIRECTION, 0);
|
|
|
|
|
|
|
|
return(rec_end);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*****************************************************************
|
|
|
|
Copies records from page to a newly created page, from a given record onward,
|
|
|
|
including that record. Infimum and supremum records are not copied. */
|
|
|
|
|
|
|
|
void
|
|
|
|
page_copy_rec_list_end_to_created_page(
|
|
|
|
/*===================================*/
|
2004-12-02 18:45:07 +01:00
|
|
|
page_t* new_page, /* in: index page to copy to */
|
|
|
|
page_t* page, /* in: index page */
|
|
|
|
rec_t* rec, /* in: first record to copy */
|
|
|
|
dict_index_t* index, /* in: record descriptor */
|
|
|
|
mtr_t* mtr) /* in: mtr */
|
2001-02-17 13:19:19 +01:00
|
|
|
{
|
2001-11-05 22:48:03 +01:00
|
|
|
page_dir_slot_t* slot = 0; /* remove warning */
|
2001-02-17 13:19:19 +01:00
|
|
|
byte* heap_top;
|
2001-11-05 22:48:03 +01:00
|
|
|
rec_t* insert_rec = 0; /* remove warning */
|
2001-02-17 13:19:19 +01:00
|
|
|
rec_t* prev_rec;
|
|
|
|
ulint count;
|
|
|
|
ulint n_recs;
|
|
|
|
ulint slot_index;
|
|
|
|
ulint rec_size;
|
|
|
|
ulint log_mode;
|
|
|
|
byte* log_ptr;
|
|
|
|
ulint log_data_len;
|
InnoDB: Performance optimizations based on OProfile analysis
innobase/btr/btr0btr.c:
Eliminate some buf_frame_align() calls.
Make use of the page_rec_is_infimum(), page_rec_is_supremum()
and page_rec_is_user_rec() functions.
Replace some index->table->comp with page_is_comp().
Eliminate some variables to reduce register spilling on x86.
Note that page_is_comp() may return nonzero instead of TRUE.
Note that rec_offs_comp() may return nonzero instead of TRUE.
innobase/btr/btr0cur.c:
Eliminate some buf_frame_align() calls.
Replace some index->table->comp with
page_is_comp() or rec_offs_comp().
Eliminate some variables to reduce register spilling on x86.
Note that page_is_comp() may return nonzero instead of TRUE.
Note that rec_offs_comp() may return nonzero instead of TRUE.
Remove an extra mem_heap_create() call from btr_cur_update_in_place().
Add "page" parameter to lock_rec_store_on_page_infimum().
Add some UNIV_LIKELY() and UNIV_UNLIKELY() hints.
btr_estimate_number_of_different_key_vals(): Rename the
offsets_* variables to be more descriptive and eliminate one
rec_get_offsets() and one page_rec_get_next() call in the loop.
innobase/btr/btr0pcur.c:
Eliminate some buf_frame_align() calls.
Make use of the page_rec_is_infimum(), page_rec_is_supremum()
and page_rec_is_user_rec() functions.
Replace some index->table->comp with page_is_comp().
Eliminate some variables to reduce register spilling on x86.
Note that page_is_comp() may return nonzero instead of TRUE.
Make some ut_a() assertions ut_ad() ones to improve performance.
Add some UNIV_LIKELY() and UNIV_UNLIKELY() hints.
innobase/btr/btr0sea.c:
Make use of page_rec_is_infimum() and page_rec_is_supremum().
Eliminate some buf_frame_align() calls.
Add some UNIV_UNLIKELY and UNIV_LIKELY hints.
Turn some assertions into debug assertions.
innobase/dict/dict0crea.c:
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp
innobase/ibuf/ibuf0ibuf.c:
Make use of page_rec_is_infimum() and page_rec_is_supremum().
Add some UNIV_UNLIKELY and UNIV_LIKELY hints.
ibuf_get_merge_page_nos(): Rename parameter "first_rec" to "rec"
and eliminate local variable "rec".
innobase/include/btr0btr.h:
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp
innobase/include/buf0buf.h:
Rename buf_frame_get_modify_clock()
to buf_block_get_modify_clock().
innobase/include/buf0buf.ic:
Rename buf_frame_get_modify_clock()
to buf_block_get_modify_clock() and
remove the buf_block_align() call.
innobase/include/lock0lock.h:
lock_rec_store_on_page_infimum(): Add parameter "page"
innobase/include/mach0data.h:
Add mach_encode_2() and mach_decode_2().
innobase/include/mach0data.ic:
Add mach_encode_2() and mach_decode_2().
innobase/include/page0cur.h:
Add const qualifier to page_cur_is_before_first()
and page_cur_is_after_last().
innobase/include/page0cur.ic:
Make use of page_rec_is_infimum() and page_rec_is_supremum().
innobase/include/page0page.h:
Remove page_rec_is_first_user_rec() and page_rec_is_last_user_rec().
Add page_rec_is_infimum() and page_rec_is_supremum().
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp.
innobase/include/page0page.ic:
Remove page_rec_is_first_user_rec() and page_rec_is_last_user_rec().
Add page_rec_is_infimum() and page_rec_is_supremum().
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp.
Add UNIV_UNLIKELY, UNIV_LIKELY and UNIV_EXPECT hints.
Reduce the number of buf_frame_align() calls.
innobase/include/rem0rec.ic:
rec_offs_comp(): Return zero or nonzero instead of FALSE or TRUE.
innobase/include/row0mysql.h:
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp.
innobase/lock/lock0lock.c:
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp.
Remove parameter "comp" from lock_rec_get_next(),
lock_rec_has_expl() and lock_rec_other_has_expl_req().
Add parameter "page" to lock_rec_store_on_page_infimum().
Add UNIV_UNLIKELY hints.
Reduce the number of buf_frame_align() calls.
Make use of page_rec_is_infimum(), page_rec_is_supremum() and
page_rec_is_user_rec().
Move the "comp" flag outside some loops.
innobase/mtr/mtr0log.c:
Replace index->table->comp with page_rec_is_comp().
innobase/page/page0cur.c:
Replace index->table->comp with page_is_comp() or page_rec_is_comp().
Eliminate some buf_frame_align() calls.
Add some debug assertions.
innobase/page/page0page.c:
Optimize page_dir_find_owner_slot(). Compare the record offset
16 bits at a time, because that seems to be the only way to avoid
register spilling on x86.
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp.
Remove parameter "page" of page_delete_rec_list_write_log().
Make use of page_rec_is_infimum().
innobase/rem/rem0cmp.c:
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp.
innobase/row/row0ins.c:
Make use of page_rec_is_infimum() and page_rec_is_supremum().
Reduce the amount of buf_frame_align() calls.
row_ins_index_entry_low(): Disable assertion about column count
unless #ifdef UNIV_DEBUG.
innobase/row/row0mysql.c:
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp.
innobase/row/row0row.c:
Eliminate some buf_frame_align() calls.
Make use of page_rec_is_infimum().
innobase/row/row0sel.c:
Make use of page_rec_is_supremum() and page_rec_is_infimum().
Turn some assertions into debug assertions.
Add UNIV_LIKELY and UNIV_UNLIKELY hints.
row_search_for_mysql(): Eliminate local variables "moved",
"cons_read_requires_clust_rec", "was_lock_wait", "shortcut",
"success" and "comp". Replace some of them with goto's.
Disable variable "cnt" unless #ifdef UNIV_SEARCH_DEBUG.
innobase/row/row0vers.c:
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp.
Replace index->table->comp with page_rec_is_comp().
Eliminate some buf_frame_align() calls.
2005-04-25 09:14:35 +02:00
|
|
|
ulint comp = page_is_comp(page);
|
2004-12-09 14:29:55 +01:00
|
|
|
mem_heap_t* heap = NULL;
|
2005-03-10 14:16:16 +01:00
|
|
|
ulint offsets_[REC_OFFS_NORMAL_SIZE];
|
2004-12-09 14:29:55 +01:00
|
|
|
ulint* offsets = offsets_;
|
2005-03-09 21:04:55 +01:00
|
|
|
*offsets_ = (sizeof offsets_) / sizeof *offsets_;
|
2001-02-17 13:19:19 +01:00
|
|
|
|
2004-12-02 18:45:07 +01:00
|
|
|
ut_ad(page_dir_get_n_heap(new_page) == 2);
|
2001-02-17 13:19:19 +01:00
|
|
|
ut_ad(page != new_page);
|
2004-12-02 18:45:07 +01:00
|
|
|
ut_ad(comp == page_is_comp(new_page));
|
2001-02-17 13:19:19 +01:00
|
|
|
|
|
|
|
if (rec == page_get_infimum_rec(page)) {
|
|
|
|
|
|
|
|
rec = page_rec_get_next(rec);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (rec == page_get_supremum_rec(page)) {
|
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
#ifdef UNIV_DEBUG
|
|
|
|
/* To pass the debug tests we have to set these dummy values
|
|
|
|
in the debug version */
|
2004-12-02 18:45:07 +01:00
|
|
|
page_dir_set_n_slots(new_page, UNIV_PAGE_SIZE / 2);
|
2001-02-17 13:19:19 +01:00
|
|
|
page_header_set_ptr(new_page, PAGE_HEAP_TOP,
|
|
|
|
new_page + UNIV_PAGE_SIZE - 1);
|
|
|
|
#endif
|
|
|
|
|
2004-12-02 18:45:07 +01:00
|
|
|
log_ptr = page_copy_rec_list_to_created_page_write_log(new_page,
|
|
|
|
index, mtr);
|
2001-02-17 13:19:19 +01:00
|
|
|
|
|
|
|
log_data_len = dyn_array_get_data_size(&(mtr->log));
|
|
|
|
|
|
|
|
/* Individual inserts are logged in a shorter form */
|
|
|
|
|
|
|
|
log_mode = mtr_set_log_mode(mtr, MTR_LOG_SHORT_INSERTS);
|
|
|
|
|
|
|
|
prev_rec = page_get_infimum_rec(new_page);
|
2004-12-02 18:45:07 +01:00
|
|
|
if (comp) {
|
|
|
|
heap_top = new_page + PAGE_NEW_SUPREMUM_END;
|
|
|
|
} else {
|
|
|
|
heap_top = new_page + PAGE_OLD_SUPREMUM_END;
|
|
|
|
}
|
2001-02-17 13:19:19 +01:00
|
|
|
count = 0;
|
|
|
|
slot_index = 0;
|
|
|
|
n_recs = 0;
|
|
|
|
|
2001-11-05 22:48:03 +01:00
|
|
|
/* should be do ... until, comment by Jani */
|
2001-02-17 13:19:19 +01:00
|
|
|
while (rec != page_get_supremum_rec(page)) {
|
2004-12-09 14:29:55 +01:00
|
|
|
offsets = rec_get_offsets(rec, index, offsets,
|
|
|
|
ULINT_UNDEFINED, &heap);
|
2004-12-02 18:45:07 +01:00
|
|
|
insert_rec = rec_copy(heap_top, rec, offsets);
|
2001-02-17 13:19:19 +01:00
|
|
|
|
2004-12-02 18:45:07 +01:00
|
|
|
rec_set_next_offs(prev_rec, comp, insert_rec - new_page);
|
2001-02-17 13:19:19 +01:00
|
|
|
|
2004-12-02 18:45:07 +01:00
|
|
|
rec_set_n_owned(insert_rec, comp, 0);
|
|
|
|
rec_set_heap_no(insert_rec, comp, 2 + n_recs);
|
2001-02-17 13:19:19 +01:00
|
|
|
|
2004-12-02 18:45:07 +01:00
|
|
|
rec_size = rec_offs_size(offsets);
|
2001-02-17 13:19:19 +01:00
|
|
|
|
|
|
|
heap_top = heap_top + rec_size;
|
|
|
|
|
|
|
|
ut_ad(heap_top < new_page + UNIV_PAGE_SIZE);
|
|
|
|
|
|
|
|
count++;
|
|
|
|
n_recs++;
|
|
|
|
|
|
|
|
if (count == (PAGE_DIR_SLOT_MAX_N_OWNED + 1) / 2) {
|
|
|
|
|
|
|
|
slot_index++;
|
|
|
|
|
|
|
|
slot = page_dir_get_nth_slot(new_page, slot_index);
|
|
|
|
|
|
|
|
page_dir_slot_set_rec(slot, insert_rec);
|
|
|
|
page_dir_slot_set_n_owned(slot, count);
|
|
|
|
|
|
|
|
count = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
page_cur_insert_rec_write_log(insert_rec, rec_size, prev_rec,
|
2004-12-02 18:45:07 +01:00
|
|
|
index, mtr);
|
2001-02-17 13:19:19 +01:00
|
|
|
prev_rec = insert_rec;
|
|
|
|
rec = page_rec_get_next(rec);
|
|
|
|
}
|
|
|
|
|
|
|
|
if ((slot_index > 0) && (count + 1
|
|
|
|
+ (PAGE_DIR_SLOT_MAX_N_OWNED + 1) / 2
|
|
|
|
<= PAGE_DIR_SLOT_MAX_N_OWNED)) {
|
|
|
|
/* We can merge the two last dir slots. This operation is
|
|
|
|
here to make this function imitate exactly the equivalent
|
|
|
|
task made using page_cur_insert_rec, which we use in database
|
|
|
|
recovery to reproduce the task performed by this function.
|
|
|
|
To be able to check the correctness of recovery, it is good
|
|
|
|
that it imitates exactly. */
|
|
|
|
|
|
|
|
count += (PAGE_DIR_SLOT_MAX_N_OWNED + 1) / 2;
|
|
|
|
|
|
|
|
page_dir_slot_set_n_owned(slot, 0);
|
|
|
|
|
|
|
|
slot_index--;
|
|
|
|
}
|
|
|
|
|
2005-04-21 13:23:26 +02:00
|
|
|
if (UNIV_LIKELY_NULL(heap)) {
|
2004-12-09 14:29:55 +01:00
|
|
|
mem_heap_free(heap);
|
|
|
|
}
|
2004-12-02 18:45:07 +01:00
|
|
|
|
2001-02-17 13:19:19 +01:00
|
|
|
log_data_len = dyn_array_get_data_size(&(mtr->log)) - log_data_len;
|
|
|
|
|
2002-06-22 19:41:14 +02:00
|
|
|
ut_a(log_data_len < 100 * UNIV_PAGE_SIZE);
|
|
|
|
|
2001-02-17 13:19:19 +01:00
|
|
|
mach_write_to_4(log_ptr, log_data_len);
|
|
|
|
|
2004-12-02 18:45:07 +01:00
|
|
|
rec_set_next_offs(insert_rec, comp,
|
|
|
|
comp ? PAGE_NEW_SUPREMUM : PAGE_OLD_SUPREMUM);
|
2001-02-17 13:19:19 +01:00
|
|
|
|
|
|
|
slot = page_dir_get_nth_slot(new_page, 1 + slot_index);
|
|
|
|
|
|
|
|
page_dir_slot_set_rec(slot, page_get_supremum_rec(new_page));
|
|
|
|
page_dir_slot_set_n_owned(slot, count + 1);
|
|
|
|
|
2004-12-02 18:45:07 +01:00
|
|
|
page_dir_set_n_slots(new_page, 2 + slot_index);
|
2001-02-17 13:19:19 +01:00
|
|
|
page_header_set_ptr(new_page, PAGE_HEAP_TOP, heap_top);
|
2004-12-02 18:45:07 +01:00
|
|
|
page_dir_set_n_heap(new_page, 2 + n_recs);
|
2001-02-17 13:19:19 +01:00
|
|
|
page_header_set_field(new_page, PAGE_N_RECS, n_recs);
|
|
|
|
|
|
|
|
page_header_set_ptr(new_page, PAGE_LAST_INSERT, NULL);
|
|
|
|
page_header_set_field(new_page, PAGE_DIRECTION, PAGE_NO_DIRECTION);
|
|
|
|
page_header_set_field(new_page, PAGE_N_DIRECTION, 0);
|
|
|
|
|
|
|
|
/* Restore the log mode */
|
|
|
|
|
|
|
|
mtr_set_log_mode(mtr, log_mode);
|
|
|
|
}
|
|
|
|
|
|
|
|
/***************************************************************
|
|
|
|
Writes log record of a record delete on a page. */
|
|
|
|
UNIV_INLINE
|
|
|
|
void
|
|
|
|
page_cur_delete_rec_write_log(
|
|
|
|
/*==========================*/
|
2004-12-02 18:45:07 +01:00
|
|
|
rec_t* rec, /* in: record to be deleted */
|
|
|
|
dict_index_t* index, /* in: record descriptor */
|
|
|
|
mtr_t* mtr) /* in: mini-transaction handle */
|
2001-02-17 13:19:19 +01:00
|
|
|
{
|
2004-12-02 18:45:07 +01:00
|
|
|
byte* log_ptr;
|
|
|
|
|
InnoDB: Performance optimizations based on OProfile analysis
innobase/btr/btr0btr.c:
Eliminate some buf_frame_align() calls.
Make use of the page_rec_is_infimum(), page_rec_is_supremum()
and page_rec_is_user_rec() functions.
Replace some index->table->comp with page_is_comp().
Eliminate some variables to reduce register spilling on x86.
Note that page_is_comp() may return nonzero instead of TRUE.
Note that rec_offs_comp() may return nonzero instead of TRUE.
innobase/btr/btr0cur.c:
Eliminate some buf_frame_align() calls.
Replace some index->table->comp with
page_is_comp() or rec_offs_comp().
Eliminate some variables to reduce register spilling on x86.
Note that page_is_comp() may return nonzero instead of TRUE.
Note that rec_offs_comp() may return nonzero instead of TRUE.
Remove an extra mem_heap_create() call from btr_cur_update_in_place().
Add "page" parameter to lock_rec_store_on_page_infimum().
Add some UNIV_LIKELY() and UNIV_UNLIKELY() hints.
btr_estimate_number_of_different_key_vals(): Rename the
offsets_* variables to be more descriptive and eliminate one
rec_get_offsets() and one page_rec_get_next() call in the loop.
innobase/btr/btr0pcur.c:
Eliminate some buf_frame_align() calls.
Make use of the page_rec_is_infimum(), page_rec_is_supremum()
and page_rec_is_user_rec() functions.
Replace some index->table->comp with page_is_comp().
Eliminate some variables to reduce register spilling on x86.
Note that page_is_comp() may return nonzero instead of TRUE.
Make some ut_a() assertions ut_ad() ones to improve performance.
Add some UNIV_LIKELY() and UNIV_UNLIKELY() hints.
innobase/btr/btr0sea.c:
Make use of page_rec_is_infimum() and page_rec_is_supremum().
Eliminate some buf_frame_align() calls.
Add some UNIV_UNLIKELY and UNIV_LIKELY hints.
Turn some assertions into debug assertions.
innobase/dict/dict0crea.c:
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp
innobase/ibuf/ibuf0ibuf.c:
Make use of page_rec_is_infimum() and page_rec_is_supremum().
Add some UNIV_UNLIKELY and UNIV_LIKELY hints.
ibuf_get_merge_page_nos(): Rename parameter "first_rec" to "rec"
and eliminate local variable "rec".
innobase/include/btr0btr.h:
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp
innobase/include/buf0buf.h:
Rename buf_frame_get_modify_clock()
to buf_block_get_modify_clock().
innobase/include/buf0buf.ic:
Rename buf_frame_get_modify_clock()
to buf_block_get_modify_clock() and
remove the buf_block_align() call.
innobase/include/lock0lock.h:
lock_rec_store_on_page_infimum(): Add parameter "page"
innobase/include/mach0data.h:
Add mach_encode_2() and mach_decode_2().
innobase/include/mach0data.ic:
Add mach_encode_2() and mach_decode_2().
innobase/include/page0cur.h:
Add const qualifier to page_cur_is_before_first()
and page_cur_is_after_last().
innobase/include/page0cur.ic:
Make use of page_rec_is_infimum() and page_rec_is_supremum().
innobase/include/page0page.h:
Remove page_rec_is_first_user_rec() and page_rec_is_last_user_rec().
Add page_rec_is_infimum() and page_rec_is_supremum().
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp.
innobase/include/page0page.ic:
Remove page_rec_is_first_user_rec() and page_rec_is_last_user_rec().
Add page_rec_is_infimum() and page_rec_is_supremum().
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp.
Add UNIV_UNLIKELY, UNIV_LIKELY and UNIV_EXPECT hints.
Reduce the number of buf_frame_align() calls.
innobase/include/rem0rec.ic:
rec_offs_comp(): Return zero or nonzero instead of FALSE or TRUE.
innobase/include/row0mysql.h:
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp.
innobase/lock/lock0lock.c:
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp.
Remove parameter "comp" from lock_rec_get_next(),
lock_rec_has_expl() and lock_rec_other_has_expl_req().
Add parameter "page" to lock_rec_store_on_page_infimum().
Add UNIV_UNLIKELY hints.
Reduce the number of buf_frame_align() calls.
Make use of page_rec_is_infimum(), page_rec_is_supremum() and
page_rec_is_user_rec().
Move the "comp" flag outside some loops.
innobase/mtr/mtr0log.c:
Replace index->table->comp with page_rec_is_comp().
innobase/page/page0cur.c:
Replace index->table->comp with page_is_comp() or page_rec_is_comp().
Eliminate some buf_frame_align() calls.
Add some debug assertions.
innobase/page/page0page.c:
Optimize page_dir_find_owner_slot(). Compare the record offset
16 bits at a time, because that seems to be the only way to avoid
register spilling on x86.
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp.
Remove parameter "page" of page_delete_rec_list_write_log().
Make use of page_rec_is_infimum().
innobase/rem/rem0cmp.c:
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp.
innobase/row/row0ins.c:
Make use of page_rec_is_infimum() and page_rec_is_supremum().
Reduce the amount of buf_frame_align() calls.
row_ins_index_entry_low(): Disable assertion about column count
unless #ifdef UNIV_DEBUG.
innobase/row/row0mysql.c:
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp.
innobase/row/row0row.c:
Eliminate some buf_frame_align() calls.
Make use of page_rec_is_infimum().
innobase/row/row0sel.c:
Make use of page_rec_is_supremum() and page_rec_is_infimum().
Turn some assertions into debug assertions.
Add UNIV_LIKELY and UNIV_UNLIKELY hints.
row_search_for_mysql(): Eliminate local variables "moved",
"cons_read_requires_clust_rec", "was_lock_wait", "shortcut",
"success" and "comp". Replace some of them with goto's.
Disable variable "cnt" unless #ifdef UNIV_SEARCH_DEBUG.
innobase/row/row0vers.c:
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp.
Replace index->table->comp with page_rec_is_comp().
Eliminate some buf_frame_align() calls.
2005-04-25 09:14:35 +02:00
|
|
|
ut_ad(!!page_rec_is_comp(rec) == index->table->comp);
|
|
|
|
|
2004-12-02 18:45:07 +01:00
|
|
|
log_ptr = mlog_open_and_write_index(mtr, rec, index,
|
InnoDB: Performance optimizations based on OProfile analysis
innobase/btr/btr0btr.c:
Eliminate some buf_frame_align() calls.
Make use of the page_rec_is_infimum(), page_rec_is_supremum()
and page_rec_is_user_rec() functions.
Replace some index->table->comp with page_is_comp().
Eliminate some variables to reduce register spilling on x86.
Note that page_is_comp() may return nonzero instead of TRUE.
Note that rec_offs_comp() may return nonzero instead of TRUE.
innobase/btr/btr0cur.c:
Eliminate some buf_frame_align() calls.
Replace some index->table->comp with
page_is_comp() or rec_offs_comp().
Eliminate some variables to reduce register spilling on x86.
Note that page_is_comp() may return nonzero instead of TRUE.
Note that rec_offs_comp() may return nonzero instead of TRUE.
Remove an extra mem_heap_create() call from btr_cur_update_in_place().
Add "page" parameter to lock_rec_store_on_page_infimum().
Add some UNIV_LIKELY() and UNIV_UNLIKELY() hints.
btr_estimate_number_of_different_key_vals(): Rename the
offsets_* variables to be more descriptive and eliminate one
rec_get_offsets() and one page_rec_get_next() call in the loop.
innobase/btr/btr0pcur.c:
Eliminate some buf_frame_align() calls.
Make use of the page_rec_is_infimum(), page_rec_is_supremum()
and page_rec_is_user_rec() functions.
Replace some index->table->comp with page_is_comp().
Eliminate some variables to reduce register spilling on x86.
Note that page_is_comp() may return nonzero instead of TRUE.
Make some ut_a() assertions ut_ad() ones to improve performance.
Add some UNIV_LIKELY() and UNIV_UNLIKELY() hints.
innobase/btr/btr0sea.c:
Make use of page_rec_is_infimum() and page_rec_is_supremum().
Eliminate some buf_frame_align() calls.
Add some UNIV_UNLIKELY and UNIV_LIKELY hints.
Turn some assertions into debug assertions.
innobase/dict/dict0crea.c:
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp
innobase/ibuf/ibuf0ibuf.c:
Make use of page_rec_is_infimum() and page_rec_is_supremum().
Add some UNIV_UNLIKELY and UNIV_LIKELY hints.
ibuf_get_merge_page_nos(): Rename parameter "first_rec" to "rec"
and eliminate local variable "rec".
innobase/include/btr0btr.h:
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp
innobase/include/buf0buf.h:
Rename buf_frame_get_modify_clock()
to buf_block_get_modify_clock().
innobase/include/buf0buf.ic:
Rename buf_frame_get_modify_clock()
to buf_block_get_modify_clock() and
remove the buf_block_align() call.
innobase/include/lock0lock.h:
lock_rec_store_on_page_infimum(): Add parameter "page"
innobase/include/mach0data.h:
Add mach_encode_2() and mach_decode_2().
innobase/include/mach0data.ic:
Add mach_encode_2() and mach_decode_2().
innobase/include/page0cur.h:
Add const qualifier to page_cur_is_before_first()
and page_cur_is_after_last().
innobase/include/page0cur.ic:
Make use of page_rec_is_infimum() and page_rec_is_supremum().
innobase/include/page0page.h:
Remove page_rec_is_first_user_rec() and page_rec_is_last_user_rec().
Add page_rec_is_infimum() and page_rec_is_supremum().
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp.
innobase/include/page0page.ic:
Remove page_rec_is_first_user_rec() and page_rec_is_last_user_rec().
Add page_rec_is_infimum() and page_rec_is_supremum().
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp.
Add UNIV_UNLIKELY, UNIV_LIKELY and UNIV_EXPECT hints.
Reduce the number of buf_frame_align() calls.
innobase/include/rem0rec.ic:
rec_offs_comp(): Return zero or nonzero instead of FALSE or TRUE.
innobase/include/row0mysql.h:
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp.
innobase/lock/lock0lock.c:
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp.
Remove parameter "comp" from lock_rec_get_next(),
lock_rec_has_expl() and lock_rec_other_has_expl_req().
Add parameter "page" to lock_rec_store_on_page_infimum().
Add UNIV_UNLIKELY hints.
Reduce the number of buf_frame_align() calls.
Make use of page_rec_is_infimum(), page_rec_is_supremum() and
page_rec_is_user_rec().
Move the "comp" flag outside some loops.
innobase/mtr/mtr0log.c:
Replace index->table->comp with page_rec_is_comp().
innobase/page/page0cur.c:
Replace index->table->comp with page_is_comp() or page_rec_is_comp().
Eliminate some buf_frame_align() calls.
Add some debug assertions.
innobase/page/page0page.c:
Optimize page_dir_find_owner_slot(). Compare the record offset
16 bits at a time, because that seems to be the only way to avoid
register spilling on x86.
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp.
Remove parameter "page" of page_delete_rec_list_write_log().
Make use of page_rec_is_infimum().
innobase/rem/rem0cmp.c:
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp.
innobase/row/row0ins.c:
Make use of page_rec_is_infimum() and page_rec_is_supremum().
Reduce the amount of buf_frame_align() calls.
row_ins_index_entry_low(): Disable assertion about column count
unless #ifdef UNIV_DEBUG.
innobase/row/row0mysql.c:
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp.
innobase/row/row0row.c:
Eliminate some buf_frame_align() calls.
Make use of page_rec_is_infimum().
innobase/row/row0sel.c:
Make use of page_rec_is_supremum() and page_rec_is_infimum().
Turn some assertions into debug assertions.
Add UNIV_LIKELY and UNIV_UNLIKELY hints.
row_search_for_mysql(): Eliminate local variables "moved",
"cons_read_requires_clust_rec", "was_lock_wait", "shortcut",
"success" and "comp". Replace some of them with goto's.
Disable variable "cnt" unless #ifdef UNIV_SEARCH_DEBUG.
innobase/row/row0vers.c:
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp.
Replace index->table->comp with page_rec_is_comp().
Eliminate some buf_frame_align() calls.
2005-04-25 09:14:35 +02:00
|
|
|
page_rec_is_comp(rec)
|
2004-12-02 18:45:07 +01:00
|
|
|
? MLOG_COMP_REC_DELETE
|
|
|
|
: MLOG_REC_DELETE, 2);
|
|
|
|
|
|
|
|
if (!log_ptr) {
|
|
|
|
/* Logging in mtr is switched off during crash recovery:
|
|
|
|
in that case mlog_open returns NULL */
|
|
|
|
return;
|
|
|
|
}
|
2001-02-17 13:19:19 +01:00
|
|
|
|
|
|
|
/* Write the cursor rec offset as a 2-byte ulint */
|
InnoDB: Performance optimizations based on OProfile analysis
innobase/btr/btr0btr.c:
Eliminate some buf_frame_align() calls.
Make use of the page_rec_is_infimum(), page_rec_is_supremum()
and page_rec_is_user_rec() functions.
Replace some index->table->comp with page_is_comp().
Eliminate some variables to reduce register spilling on x86.
Note that page_is_comp() may return nonzero instead of TRUE.
Note that rec_offs_comp() may return nonzero instead of TRUE.
innobase/btr/btr0cur.c:
Eliminate some buf_frame_align() calls.
Replace some index->table->comp with
page_is_comp() or rec_offs_comp().
Eliminate some variables to reduce register spilling on x86.
Note that page_is_comp() may return nonzero instead of TRUE.
Note that rec_offs_comp() may return nonzero instead of TRUE.
Remove an extra mem_heap_create() call from btr_cur_update_in_place().
Add "page" parameter to lock_rec_store_on_page_infimum().
Add some UNIV_LIKELY() and UNIV_UNLIKELY() hints.
btr_estimate_number_of_different_key_vals(): Rename the
offsets_* variables to be more descriptive and eliminate one
rec_get_offsets() and one page_rec_get_next() call in the loop.
innobase/btr/btr0pcur.c:
Eliminate some buf_frame_align() calls.
Make use of the page_rec_is_infimum(), page_rec_is_supremum()
and page_rec_is_user_rec() functions.
Replace some index->table->comp with page_is_comp().
Eliminate some variables to reduce register spilling on x86.
Note that page_is_comp() may return nonzero instead of TRUE.
Make some ut_a() assertions ut_ad() ones to improve performance.
Add some UNIV_LIKELY() and UNIV_UNLIKELY() hints.
innobase/btr/btr0sea.c:
Make use of page_rec_is_infimum() and page_rec_is_supremum().
Eliminate some buf_frame_align() calls.
Add some UNIV_UNLIKELY and UNIV_LIKELY hints.
Turn some assertions into debug assertions.
innobase/dict/dict0crea.c:
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp
innobase/ibuf/ibuf0ibuf.c:
Make use of page_rec_is_infimum() and page_rec_is_supremum().
Add some UNIV_UNLIKELY and UNIV_LIKELY hints.
ibuf_get_merge_page_nos(): Rename parameter "first_rec" to "rec"
and eliminate local variable "rec".
innobase/include/btr0btr.h:
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp
innobase/include/buf0buf.h:
Rename buf_frame_get_modify_clock()
to buf_block_get_modify_clock().
innobase/include/buf0buf.ic:
Rename buf_frame_get_modify_clock()
to buf_block_get_modify_clock() and
remove the buf_block_align() call.
innobase/include/lock0lock.h:
lock_rec_store_on_page_infimum(): Add parameter "page"
innobase/include/mach0data.h:
Add mach_encode_2() and mach_decode_2().
innobase/include/mach0data.ic:
Add mach_encode_2() and mach_decode_2().
innobase/include/page0cur.h:
Add const qualifier to page_cur_is_before_first()
and page_cur_is_after_last().
innobase/include/page0cur.ic:
Make use of page_rec_is_infimum() and page_rec_is_supremum().
innobase/include/page0page.h:
Remove page_rec_is_first_user_rec() and page_rec_is_last_user_rec().
Add page_rec_is_infimum() and page_rec_is_supremum().
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp.
innobase/include/page0page.ic:
Remove page_rec_is_first_user_rec() and page_rec_is_last_user_rec().
Add page_rec_is_infimum() and page_rec_is_supremum().
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp.
Add UNIV_UNLIKELY, UNIV_LIKELY and UNIV_EXPECT hints.
Reduce the number of buf_frame_align() calls.
innobase/include/rem0rec.ic:
rec_offs_comp(): Return zero or nonzero instead of FALSE or TRUE.
innobase/include/row0mysql.h:
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp.
innobase/lock/lock0lock.c:
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp.
Remove parameter "comp" from lock_rec_get_next(),
lock_rec_has_expl() and lock_rec_other_has_expl_req().
Add parameter "page" to lock_rec_store_on_page_infimum().
Add UNIV_UNLIKELY hints.
Reduce the number of buf_frame_align() calls.
Make use of page_rec_is_infimum(), page_rec_is_supremum() and
page_rec_is_user_rec().
Move the "comp" flag outside some loops.
innobase/mtr/mtr0log.c:
Replace index->table->comp with page_rec_is_comp().
innobase/page/page0cur.c:
Replace index->table->comp with page_is_comp() or page_rec_is_comp().
Eliminate some buf_frame_align() calls.
Add some debug assertions.
innobase/page/page0page.c:
Optimize page_dir_find_owner_slot(). Compare the record offset
16 bits at a time, because that seems to be the only way to avoid
register spilling on x86.
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp.
Remove parameter "page" of page_delete_rec_list_write_log().
Make use of page_rec_is_infimum().
innobase/rem/rem0cmp.c:
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp.
innobase/row/row0ins.c:
Make use of page_rec_is_infimum() and page_rec_is_supremum().
Reduce the amount of buf_frame_align() calls.
row_ins_index_entry_low(): Disable assertion about column count
unless #ifdef UNIV_DEBUG.
innobase/row/row0mysql.c:
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp.
innobase/row/row0row.c:
Eliminate some buf_frame_align() calls.
Make use of page_rec_is_infimum().
innobase/row/row0sel.c:
Make use of page_rec_is_supremum() and page_rec_is_infimum().
Turn some assertions into debug assertions.
Add UNIV_LIKELY and UNIV_UNLIKELY hints.
row_search_for_mysql(): Eliminate local variables "moved",
"cons_read_requires_clust_rec", "was_lock_wait", "shortcut",
"success" and "comp". Replace some of them with goto's.
Disable variable "cnt" unless #ifdef UNIV_SEARCH_DEBUG.
innobase/row/row0vers.c:
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp.
Replace index->table->comp with page_rec_is_comp().
Eliminate some buf_frame_align() calls.
2005-04-25 09:14:35 +02:00
|
|
|
mach_write_to_2(log_ptr, ut_align_offset(rec, UNIV_PAGE_SIZE));
|
2004-12-02 18:45:07 +01:00
|
|
|
|
|
|
|
mlog_close(mtr, log_ptr + 2);
|
2001-02-17 13:19:19 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/***************************************************************
|
|
|
|
Parses log record of a record delete on a page. */
|
|
|
|
|
|
|
|
byte*
|
|
|
|
page_cur_parse_delete_rec(
|
|
|
|
/*======================*/
|
2004-12-02 18:45:07 +01:00
|
|
|
/* out: pointer to record end or NULL */
|
|
|
|
byte* ptr, /* in: buffer */
|
|
|
|
byte* end_ptr,/* in: buffer end */
|
|
|
|
dict_index_t* index, /* in: record descriptor */
|
|
|
|
page_t* page, /* in: page or NULL */
|
|
|
|
mtr_t* mtr) /* in: mtr or NULL */
|
2001-02-17 13:19:19 +01:00
|
|
|
{
|
|
|
|
ulint offset;
|
|
|
|
page_cur_t cursor;
|
|
|
|
|
|
|
|
if (end_ptr < ptr + 2) {
|
|
|
|
|
|
|
|
return(NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Read the cursor rec offset as a 2-byte ulint */
|
|
|
|
offset = mach_read_from_2(ptr);
|
|
|
|
ptr += 2;
|
|
|
|
|
2002-08-02 22:16:19 +02:00
|
|
|
ut_a(offset <= UNIV_PAGE_SIZE);
|
|
|
|
|
2001-02-17 13:19:19 +01:00
|
|
|
if (page) {
|
2005-03-01 12:54:48 +01:00
|
|
|
mem_heap_t* heap = NULL;
|
2005-03-10 14:16:16 +01:00
|
|
|
ulint offsets_[REC_OFFS_NORMAL_SIZE];
|
2005-03-01 12:54:48 +01:00
|
|
|
rec_t* rec = page + offset;
|
2005-03-09 21:04:55 +01:00
|
|
|
*offsets_ = (sizeof offsets_) / sizeof *offsets_;
|
2005-03-01 12:54:48 +01:00
|
|
|
|
|
|
|
page_cur_position(rec, &cursor);
|
2001-02-17 13:19:19 +01:00
|
|
|
|
2005-03-01 12:54:48 +01:00
|
|
|
page_cur_delete_rec(&cursor, index,
|
|
|
|
rec_get_offsets(rec, index, offsets_,
|
|
|
|
ULINT_UNDEFINED, &heap), mtr);
|
2005-04-21 13:23:26 +02:00
|
|
|
if (UNIV_LIKELY_NULL(heap)) {
|
2005-03-01 12:54:48 +01:00
|
|
|
mem_heap_free(heap);
|
|
|
|
}
|
2001-02-17 13:19:19 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
return(ptr);
|
|
|
|
}
|
|
|
|
|
|
|
|
/***************************************************************
|
|
|
|
Deletes a record at the page cursor. The cursor is moved to the next
|
|
|
|
record after the deleted one. */
|
|
|
|
|
|
|
|
void
|
|
|
|
page_cur_delete_rec(
|
|
|
|
/*================*/
|
|
|
|
page_cur_t* cursor, /* in: a page cursor */
|
2004-12-02 18:45:07 +01:00
|
|
|
dict_index_t* index, /* in: record descriptor */
|
2005-03-01 12:54:48 +01:00
|
|
|
const ulint* offsets,/* in: rec_get_offsets(cursor->rec, index) */
|
2001-02-17 13:19:19 +01:00
|
|
|
mtr_t* mtr) /* in: mini-transaction handle */
|
|
|
|
{
|
srv0srv.h Support raw disk partitions as data files
srv0start.c Support raw disk partitions as data files
srv0srv.c Support raw disk partitions as data files
row0purge.c < 4 GB rows, doublewrite, hang fixes
row0row.c < 4 GB rows, doublewrite, hang fixes
row0sel.c < 4 GB rows, doublewrite, hang fixes
row0uins.c < 4 GB rows, doublewrite, hang fixes
row0umod.c < 4 GB rows, doublewrite, hang fixes
row0undo.c < 4 GB rows, doublewrite, hang fixes
row0upd.c < 4 GB rows, doublewrite, hang fixes
srv0srv.c < 4 GB rows, doublewrite, hang fixes
srv0start.c < 4 GB rows, doublewrite, hang fixes
sync0rw.c < 4 GB rows, doublewrite, hang fixes
sync0sync.c < 4 GB rows, doublewrite, hang fixes
trx0purge.c < 4 GB rows, doublewrite, hang fixes
trx0rec.c < 4 GB rows, doublewrite, hang fixes
trx0sys.c < 4 GB rows, doublewrite, hang fixes
btr0btr.c < 4 GB rows, doublewrite, hang fixes
btr0cur.c < 4 GB rows, doublewrite, hang fixes
buf0buf.c < 4 GB rows, doublewrite, hang fixes
buf0flu.c < 4 GB rows, doublewrite, hang fixes
buf0rea.c < 4 GB rows, doublewrite, hang fixes
data0data.c < 4 GB rows, doublewrite, hang fixes
fil0fil.c < 4 GB rows, doublewrite, hang fixes
fsp0fsp.c < 4 GB rows, doublewrite, hang fixes
ibuf0ibuf.c < 4 GB rows, doublewrite, hang fixes
lock0lock.c < 4 GB rows, doublewrite, hang fixes
log0log.c < 4 GB rows, doublewrite, hang fixes
log0recv.c < 4 GB rows, doublewrite, hang fixes
os0file.c < 4 GB rows, doublewrite, hang fixes
page0cur.c < 4 GB rows, doublewrite, hang fixes
pars0pars.c < 4 GB rows, doublewrite, hang fixes
rem0cmp.c < 4 GB rows, doublewrite, hang fixes
rem0rec.c < 4 GB rows, doublewrite, hang fixes
row0ins.c < 4 GB rows, doublewrite, hang fixes
row0mysql.c < 4 GB rows, doublewrite, hang fixes
univ.i < 4 GB rows, doublewrite, hang fixes
data0data.ic < 4 GB rows, doublewrite, hang fixes
mach0data.ic < 4 GB rows, doublewrite, hang fixes
rem0rec.ic < 4 GB rows, doublewrite, hang fixes
row0upd.ic < 4 GB rows, doublewrite, hang fixes
trx0rec.ic < 4 GB rows, doublewrite, hang fixes
rem0cmp.h < 4 GB rows, doublewrite, hang fixes
rem0rec.h < 4 GB rows, doublewrite, hang fixes
row0ins.h < 4 GB rows, doublewrite, hang fixes
row0mysql.h < 4 GB rows, doublewrite, hang fixes
row0row.h < 4 GB rows, doublewrite, hang fixes
row0upd.h < 4 GB rows, doublewrite, hang fixes
srv0srv.h < 4 GB rows, doublewrite, hang fixes
sync0sync.h < 4 GB rows, doublewrite, hang fixes
trx0rec.h < 4 GB rows, doublewrite, hang fixes
trx0sys.h < 4 GB rows, doublewrite, hang fixes
trx0types.h < 4 GB rows, doublewrite, hang fixes
trx0undo.h < 4 GB rows, doublewrite, hang fixes
ut0dbg.h < 4 GB rows, doublewrite, hang fixes
ut0ut.h < 4 GB rows, doublewrite, hang fixes
btr0btr.h < 4 GB rows, doublewrite, hang fixes
btr0cur.h < 4 GB rows, doublewrite, hang fixes
buf0buf.h < 4 GB rows, doublewrite, hang fixes
buf0flu.h < 4 GB rows, doublewrite, hang fixes
data0data.h < 4 GB rows, doublewrite, hang fixes
dict0mem.h < 4 GB rows, doublewrite, hang fixes
fil0fil.h < 4 GB rows, doublewrite, hang fixes
fsp0fsp.h < 4 GB rows, doublewrite, hang fixes
os0file.h < 4 GB rows, doublewrite, hang fixes
innobase/include/btr0btr.h:
< 4 GB rows, doublewrite, hang fixes
innobase/include/btr0cur.h:
< 4 GB rows, doublewrite, hang fixes
innobase/include/buf0buf.h:
< 4 GB rows, doublewrite, hang fixes
innobase/include/buf0flu.h:
< 4 GB rows, doublewrite, hang fixes
innobase/include/data0data.h:
< 4 GB rows, doublewrite, hang fixes
innobase/include/dict0mem.h:
< 4 GB rows, doublewrite, hang fixes
innobase/include/fil0fil.h:
< 4 GB rows, doublewrite, hang fixes
innobase/include/fsp0fsp.h:
< 4 GB rows, doublewrite, hang fixes
innobase/include/os0file.h:
< 4 GB rows, doublewrite, hang fixes
innobase/include/rem0cmp.h:
< 4 GB rows, doublewrite, hang fixes
innobase/include/rem0rec.h:
< 4 GB rows, doublewrite, hang fixes
innobase/include/row0ins.h:
< 4 GB rows, doublewrite, hang fixes
innobase/include/row0mysql.h:
< 4 GB rows, doublewrite, hang fixes
innobase/include/row0row.h:
< 4 GB rows, doublewrite, hang fixes
innobase/include/row0upd.h:
< 4 GB rows, doublewrite, hang fixes
innobase/include/sync0sync.h:
< 4 GB rows, doublewrite, hang fixes
innobase/include/trx0rec.h:
< 4 GB rows, doublewrite, hang fixes
innobase/include/trx0sys.h:
< 4 GB rows, doublewrite, hang fixes
innobase/include/trx0types.h:
< 4 GB rows, doublewrite, hang fixes
innobase/include/trx0undo.h:
< 4 GB rows, doublewrite, hang fixes
innobase/include/ut0dbg.h:
< 4 GB rows, doublewrite, hang fixes
innobase/include/ut0ut.h:
< 4 GB rows, doublewrite, hang fixes
innobase/include/data0data.ic:
< 4 GB rows, doublewrite, hang fixes
innobase/include/mach0data.ic:
< 4 GB rows, doublewrite, hang fixes
innobase/include/rem0rec.ic:
< 4 GB rows, doublewrite, hang fixes
innobase/include/row0upd.ic:
< 4 GB rows, doublewrite, hang fixes
innobase/include/trx0rec.ic:
< 4 GB rows, doublewrite, hang fixes
innobase/include/univ.i:
< 4 GB rows, doublewrite, hang fixes
innobase/btr/btr0btr.c:
< 4 GB rows, doublewrite, hang fixes
innobase/btr/btr0cur.c:
< 4 GB rows, doublewrite, hang fixes
innobase/buf/buf0buf.c:
< 4 GB rows, doublewrite, hang fixes
innobase/buf/buf0flu.c:
< 4 GB rows, doublewrite, hang fixes
innobase/buf/buf0rea.c:
< 4 GB rows, doublewrite, hang fixes
innobase/data/data0data.c:
< 4 GB rows, doublewrite, hang fixes
innobase/fil/fil0fil.c:
< 4 GB rows, doublewrite, hang fixes
innobase/fsp/fsp0fsp.c:
< 4 GB rows, doublewrite, hang fixes
innobase/ibuf/ibuf0ibuf.c:
< 4 GB rows, doublewrite, hang fixes
innobase/lock/lock0lock.c:
< 4 GB rows, doublewrite, hang fixes
innobase/log/log0log.c:
< 4 GB rows, doublewrite, hang fixes
innobase/log/log0recv.c:
< 4 GB rows, doublewrite, hang fixes
innobase/os/os0file.c:
< 4 GB rows, doublewrite, hang fixes
innobase/page/page0cur.c:
< 4 GB rows, doublewrite, hang fixes
innobase/pars/pars0pars.c:
< 4 GB rows, doublewrite, hang fixes
innobase/rem/rem0cmp.c:
< 4 GB rows, doublewrite, hang fixes
innobase/rem/rem0rec.c:
< 4 GB rows, doublewrite, hang fixes
innobase/row/row0ins.c:
< 4 GB rows, doublewrite, hang fixes
innobase/row/row0mysql.c:
< 4 GB rows, doublewrite, hang fixes
innobase/row/row0purge.c:
< 4 GB rows, doublewrite, hang fixes
innobase/row/row0row.c:
< 4 GB rows, doublewrite, hang fixes
innobase/row/row0sel.c:
< 4 GB rows, doublewrite, hang fixes
innobase/row/row0uins.c:
< 4 GB rows, doublewrite, hang fixes
innobase/row/row0umod.c:
< 4 GB rows, doublewrite, hang fixes
innobase/row/row0undo.c:
< 4 GB rows, doublewrite, hang fixes
innobase/row/row0upd.c:
< 4 GB rows, doublewrite, hang fixes
innobase/sync/sync0rw.c:
< 4 GB rows, doublewrite, hang fixes
innobase/sync/sync0sync.c:
< 4 GB rows, doublewrite, hang fixes
innobase/trx/trx0purge.c:
< 4 GB rows, doublewrite, hang fixes
innobase/trx/trx0rec.c:
< 4 GB rows, doublewrite, hang fixes
innobase/trx/trx0sys.c:
< 4 GB rows, doublewrite, hang fixes
innobase/srv/srv0srv.c:
Support raw disk partitions as data files
innobase/srv/srv0start.c:
Support raw disk partitions as data files
innobase/include/srv0srv.h:
Support raw disk partitions as data files
2001-08-04 18:36:14 +02:00
|
|
|
page_dir_slot_t* cur_dir_slot;
|
|
|
|
page_dir_slot_t* prev_slot;
|
2001-02-17 13:19:19 +01:00
|
|
|
page_t* page;
|
|
|
|
rec_t* current_rec;
|
|
|
|
rec_t* prev_rec = NULL;
|
|
|
|
rec_t* next_rec;
|
|
|
|
ulint cur_slot_no;
|
|
|
|
ulint cur_n_owned;
|
|
|
|
rec_t* rec;
|
srv0srv.h Support raw disk partitions as data files
srv0start.c Support raw disk partitions as data files
srv0srv.c Support raw disk partitions as data files
row0purge.c < 4 GB rows, doublewrite, hang fixes
row0row.c < 4 GB rows, doublewrite, hang fixes
row0sel.c < 4 GB rows, doublewrite, hang fixes
row0uins.c < 4 GB rows, doublewrite, hang fixes
row0umod.c < 4 GB rows, doublewrite, hang fixes
row0undo.c < 4 GB rows, doublewrite, hang fixes
row0upd.c < 4 GB rows, doublewrite, hang fixes
srv0srv.c < 4 GB rows, doublewrite, hang fixes
srv0start.c < 4 GB rows, doublewrite, hang fixes
sync0rw.c < 4 GB rows, doublewrite, hang fixes
sync0sync.c < 4 GB rows, doublewrite, hang fixes
trx0purge.c < 4 GB rows, doublewrite, hang fixes
trx0rec.c < 4 GB rows, doublewrite, hang fixes
trx0sys.c < 4 GB rows, doublewrite, hang fixes
btr0btr.c < 4 GB rows, doublewrite, hang fixes
btr0cur.c < 4 GB rows, doublewrite, hang fixes
buf0buf.c < 4 GB rows, doublewrite, hang fixes
buf0flu.c < 4 GB rows, doublewrite, hang fixes
buf0rea.c < 4 GB rows, doublewrite, hang fixes
data0data.c < 4 GB rows, doublewrite, hang fixes
fil0fil.c < 4 GB rows, doublewrite, hang fixes
fsp0fsp.c < 4 GB rows, doublewrite, hang fixes
ibuf0ibuf.c < 4 GB rows, doublewrite, hang fixes
lock0lock.c < 4 GB rows, doublewrite, hang fixes
log0log.c < 4 GB rows, doublewrite, hang fixes
log0recv.c < 4 GB rows, doublewrite, hang fixes
os0file.c < 4 GB rows, doublewrite, hang fixes
page0cur.c < 4 GB rows, doublewrite, hang fixes
pars0pars.c < 4 GB rows, doublewrite, hang fixes
rem0cmp.c < 4 GB rows, doublewrite, hang fixes
rem0rec.c < 4 GB rows, doublewrite, hang fixes
row0ins.c < 4 GB rows, doublewrite, hang fixes
row0mysql.c < 4 GB rows, doublewrite, hang fixes
univ.i < 4 GB rows, doublewrite, hang fixes
data0data.ic < 4 GB rows, doublewrite, hang fixes
mach0data.ic < 4 GB rows, doublewrite, hang fixes
rem0rec.ic < 4 GB rows, doublewrite, hang fixes
row0upd.ic < 4 GB rows, doublewrite, hang fixes
trx0rec.ic < 4 GB rows, doublewrite, hang fixes
rem0cmp.h < 4 GB rows, doublewrite, hang fixes
rem0rec.h < 4 GB rows, doublewrite, hang fixes
row0ins.h < 4 GB rows, doublewrite, hang fixes
row0mysql.h < 4 GB rows, doublewrite, hang fixes
row0row.h < 4 GB rows, doublewrite, hang fixes
row0upd.h < 4 GB rows, doublewrite, hang fixes
srv0srv.h < 4 GB rows, doublewrite, hang fixes
sync0sync.h < 4 GB rows, doublewrite, hang fixes
trx0rec.h < 4 GB rows, doublewrite, hang fixes
trx0sys.h < 4 GB rows, doublewrite, hang fixes
trx0types.h < 4 GB rows, doublewrite, hang fixes
trx0undo.h < 4 GB rows, doublewrite, hang fixes
ut0dbg.h < 4 GB rows, doublewrite, hang fixes
ut0ut.h < 4 GB rows, doublewrite, hang fixes
btr0btr.h < 4 GB rows, doublewrite, hang fixes
btr0cur.h < 4 GB rows, doublewrite, hang fixes
buf0buf.h < 4 GB rows, doublewrite, hang fixes
buf0flu.h < 4 GB rows, doublewrite, hang fixes
data0data.h < 4 GB rows, doublewrite, hang fixes
dict0mem.h < 4 GB rows, doublewrite, hang fixes
fil0fil.h < 4 GB rows, doublewrite, hang fixes
fsp0fsp.h < 4 GB rows, doublewrite, hang fixes
os0file.h < 4 GB rows, doublewrite, hang fixes
innobase/include/btr0btr.h:
< 4 GB rows, doublewrite, hang fixes
innobase/include/btr0cur.h:
< 4 GB rows, doublewrite, hang fixes
innobase/include/buf0buf.h:
< 4 GB rows, doublewrite, hang fixes
innobase/include/buf0flu.h:
< 4 GB rows, doublewrite, hang fixes
innobase/include/data0data.h:
< 4 GB rows, doublewrite, hang fixes
innobase/include/dict0mem.h:
< 4 GB rows, doublewrite, hang fixes
innobase/include/fil0fil.h:
< 4 GB rows, doublewrite, hang fixes
innobase/include/fsp0fsp.h:
< 4 GB rows, doublewrite, hang fixes
innobase/include/os0file.h:
< 4 GB rows, doublewrite, hang fixes
innobase/include/rem0cmp.h:
< 4 GB rows, doublewrite, hang fixes
innobase/include/rem0rec.h:
< 4 GB rows, doublewrite, hang fixes
innobase/include/row0ins.h:
< 4 GB rows, doublewrite, hang fixes
innobase/include/row0mysql.h:
< 4 GB rows, doublewrite, hang fixes
innobase/include/row0row.h:
< 4 GB rows, doublewrite, hang fixes
innobase/include/row0upd.h:
< 4 GB rows, doublewrite, hang fixes
innobase/include/sync0sync.h:
< 4 GB rows, doublewrite, hang fixes
innobase/include/trx0rec.h:
< 4 GB rows, doublewrite, hang fixes
innobase/include/trx0sys.h:
< 4 GB rows, doublewrite, hang fixes
innobase/include/trx0types.h:
< 4 GB rows, doublewrite, hang fixes
innobase/include/trx0undo.h:
< 4 GB rows, doublewrite, hang fixes
innobase/include/ut0dbg.h:
< 4 GB rows, doublewrite, hang fixes
innobase/include/ut0ut.h:
< 4 GB rows, doublewrite, hang fixes
innobase/include/data0data.ic:
< 4 GB rows, doublewrite, hang fixes
innobase/include/mach0data.ic:
< 4 GB rows, doublewrite, hang fixes
innobase/include/rem0rec.ic:
< 4 GB rows, doublewrite, hang fixes
innobase/include/row0upd.ic:
< 4 GB rows, doublewrite, hang fixes
innobase/include/trx0rec.ic:
< 4 GB rows, doublewrite, hang fixes
innobase/include/univ.i:
< 4 GB rows, doublewrite, hang fixes
innobase/btr/btr0btr.c:
< 4 GB rows, doublewrite, hang fixes
innobase/btr/btr0cur.c:
< 4 GB rows, doublewrite, hang fixes
innobase/buf/buf0buf.c:
< 4 GB rows, doublewrite, hang fixes
innobase/buf/buf0flu.c:
< 4 GB rows, doublewrite, hang fixes
innobase/buf/buf0rea.c:
< 4 GB rows, doublewrite, hang fixes
innobase/data/data0data.c:
< 4 GB rows, doublewrite, hang fixes
innobase/fil/fil0fil.c:
< 4 GB rows, doublewrite, hang fixes
innobase/fsp/fsp0fsp.c:
< 4 GB rows, doublewrite, hang fixes
innobase/ibuf/ibuf0ibuf.c:
< 4 GB rows, doublewrite, hang fixes
innobase/lock/lock0lock.c:
< 4 GB rows, doublewrite, hang fixes
innobase/log/log0log.c:
< 4 GB rows, doublewrite, hang fixes
innobase/log/log0recv.c:
< 4 GB rows, doublewrite, hang fixes
innobase/os/os0file.c:
< 4 GB rows, doublewrite, hang fixes
innobase/page/page0cur.c:
< 4 GB rows, doublewrite, hang fixes
innobase/pars/pars0pars.c:
< 4 GB rows, doublewrite, hang fixes
innobase/rem/rem0cmp.c:
< 4 GB rows, doublewrite, hang fixes
innobase/rem/rem0rec.c:
< 4 GB rows, doublewrite, hang fixes
innobase/row/row0ins.c:
< 4 GB rows, doublewrite, hang fixes
innobase/row/row0mysql.c:
< 4 GB rows, doublewrite, hang fixes
innobase/row/row0purge.c:
< 4 GB rows, doublewrite, hang fixes
innobase/row/row0row.c:
< 4 GB rows, doublewrite, hang fixes
innobase/row/row0sel.c:
< 4 GB rows, doublewrite, hang fixes
innobase/row/row0uins.c:
< 4 GB rows, doublewrite, hang fixes
innobase/row/row0umod.c:
< 4 GB rows, doublewrite, hang fixes
innobase/row/row0undo.c:
< 4 GB rows, doublewrite, hang fixes
innobase/row/row0upd.c:
< 4 GB rows, doublewrite, hang fixes
innobase/sync/sync0rw.c:
< 4 GB rows, doublewrite, hang fixes
innobase/sync/sync0sync.c:
< 4 GB rows, doublewrite, hang fixes
innobase/trx/trx0purge.c:
< 4 GB rows, doublewrite, hang fixes
innobase/trx/trx0rec.c:
< 4 GB rows, doublewrite, hang fixes
innobase/trx/trx0sys.c:
< 4 GB rows, doublewrite, hang fixes
innobase/srv/srv0srv.c:
Support raw disk partitions as data files
innobase/srv/srv0start.c:
Support raw disk partitions as data files
innobase/include/srv0srv.h:
Support raw disk partitions as data files
2001-08-04 18:36:14 +02:00
|
|
|
|
2001-02-17 13:19:19 +01:00
|
|
|
ut_ad(cursor && mtr);
|
|
|
|
|
|
|
|
page = page_cur_get_page(cursor);
|
|
|
|
current_rec = cursor->rec;
|
2005-03-01 12:54:48 +01:00
|
|
|
ut_ad(rec_offs_validate(current_rec, index, offsets));
|
InnoDB: Performance optimizations based on OProfile analysis
innobase/btr/btr0btr.c:
Eliminate some buf_frame_align() calls.
Make use of the page_rec_is_infimum(), page_rec_is_supremum()
and page_rec_is_user_rec() functions.
Replace some index->table->comp with page_is_comp().
Eliminate some variables to reduce register spilling on x86.
Note that page_is_comp() may return nonzero instead of TRUE.
Note that rec_offs_comp() may return nonzero instead of TRUE.
innobase/btr/btr0cur.c:
Eliminate some buf_frame_align() calls.
Replace some index->table->comp with
page_is_comp() or rec_offs_comp().
Eliminate some variables to reduce register spilling on x86.
Note that page_is_comp() may return nonzero instead of TRUE.
Note that rec_offs_comp() may return nonzero instead of TRUE.
Remove an extra mem_heap_create() call from btr_cur_update_in_place().
Add "page" parameter to lock_rec_store_on_page_infimum().
Add some UNIV_LIKELY() and UNIV_UNLIKELY() hints.
btr_estimate_number_of_different_key_vals(): Rename the
offsets_* variables to be more descriptive and eliminate one
rec_get_offsets() and one page_rec_get_next() call in the loop.
innobase/btr/btr0pcur.c:
Eliminate some buf_frame_align() calls.
Make use of the page_rec_is_infimum(), page_rec_is_supremum()
and page_rec_is_user_rec() functions.
Replace some index->table->comp with page_is_comp().
Eliminate some variables to reduce register spilling on x86.
Note that page_is_comp() may return nonzero instead of TRUE.
Make some ut_a() assertions ut_ad() ones to improve performance.
Add some UNIV_LIKELY() and UNIV_UNLIKELY() hints.
innobase/btr/btr0sea.c:
Make use of page_rec_is_infimum() and page_rec_is_supremum().
Eliminate some buf_frame_align() calls.
Add some UNIV_UNLIKELY and UNIV_LIKELY hints.
Turn some assertions into debug assertions.
innobase/dict/dict0crea.c:
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp
innobase/ibuf/ibuf0ibuf.c:
Make use of page_rec_is_infimum() and page_rec_is_supremum().
Add some UNIV_UNLIKELY and UNIV_LIKELY hints.
ibuf_get_merge_page_nos(): Rename parameter "first_rec" to "rec"
and eliminate local variable "rec".
innobase/include/btr0btr.h:
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp
innobase/include/buf0buf.h:
Rename buf_frame_get_modify_clock()
to buf_block_get_modify_clock().
innobase/include/buf0buf.ic:
Rename buf_frame_get_modify_clock()
to buf_block_get_modify_clock() and
remove the buf_block_align() call.
innobase/include/lock0lock.h:
lock_rec_store_on_page_infimum(): Add parameter "page"
innobase/include/mach0data.h:
Add mach_encode_2() and mach_decode_2().
innobase/include/mach0data.ic:
Add mach_encode_2() and mach_decode_2().
innobase/include/page0cur.h:
Add const qualifier to page_cur_is_before_first()
and page_cur_is_after_last().
innobase/include/page0cur.ic:
Make use of page_rec_is_infimum() and page_rec_is_supremum().
innobase/include/page0page.h:
Remove page_rec_is_first_user_rec() and page_rec_is_last_user_rec().
Add page_rec_is_infimum() and page_rec_is_supremum().
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp.
innobase/include/page0page.ic:
Remove page_rec_is_first_user_rec() and page_rec_is_last_user_rec().
Add page_rec_is_infimum() and page_rec_is_supremum().
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp.
Add UNIV_UNLIKELY, UNIV_LIKELY and UNIV_EXPECT hints.
Reduce the number of buf_frame_align() calls.
innobase/include/rem0rec.ic:
rec_offs_comp(): Return zero or nonzero instead of FALSE or TRUE.
innobase/include/row0mysql.h:
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp.
innobase/lock/lock0lock.c:
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp.
Remove parameter "comp" from lock_rec_get_next(),
lock_rec_has_expl() and lock_rec_other_has_expl_req().
Add parameter "page" to lock_rec_store_on_page_infimum().
Add UNIV_UNLIKELY hints.
Reduce the number of buf_frame_align() calls.
Make use of page_rec_is_infimum(), page_rec_is_supremum() and
page_rec_is_user_rec().
Move the "comp" flag outside some loops.
innobase/mtr/mtr0log.c:
Replace index->table->comp with page_rec_is_comp().
innobase/page/page0cur.c:
Replace index->table->comp with page_is_comp() or page_rec_is_comp().
Eliminate some buf_frame_align() calls.
Add some debug assertions.
innobase/page/page0page.c:
Optimize page_dir_find_owner_slot(). Compare the record offset
16 bits at a time, because that seems to be the only way to avoid
register spilling on x86.
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp.
Remove parameter "page" of page_delete_rec_list_write_log().
Make use of page_rec_is_infimum().
innobase/rem/rem0cmp.c:
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp.
innobase/row/row0ins.c:
Make use of page_rec_is_infimum() and page_rec_is_supremum().
Reduce the amount of buf_frame_align() calls.
row_ins_index_entry_low(): Disable assertion about column count
unless #ifdef UNIV_DEBUG.
innobase/row/row0mysql.c:
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp.
innobase/row/row0row.c:
Eliminate some buf_frame_align() calls.
Make use of page_rec_is_infimum().
innobase/row/row0sel.c:
Make use of page_rec_is_supremum() and page_rec_is_infimum().
Turn some assertions into debug assertions.
Add UNIV_LIKELY and UNIV_UNLIKELY hints.
row_search_for_mysql(): Eliminate local variables "moved",
"cons_read_requires_clust_rec", "was_lock_wait", "shortcut",
"success" and "comp". Replace some of them with goto's.
Disable variable "cnt" unless #ifdef UNIV_SEARCH_DEBUG.
innobase/row/row0vers.c:
Replace FALSE/TRUE ibool comp with zero/nonzero ulint comp.
Replace index->table->comp with page_rec_is_comp().
Eliminate some buf_frame_align() calls.
2005-04-25 09:14:35 +02:00
|
|
|
ut_ad(!!page_is_comp(page) == index->table->comp);
|
2001-02-17 13:19:19 +01:00
|
|
|
|
|
|
|
/* The record must not be the supremum or infimum record. */
|
|
|
|
ut_ad(current_rec != page_get_supremum_rec(page));
|
|
|
|
ut_ad(current_rec != page_get_infimum_rec(page));
|
srv0srv.h Support raw disk partitions as data files
srv0start.c Support raw disk partitions as data files
srv0srv.c Support raw disk partitions as data files
row0purge.c < 4 GB rows, doublewrite, hang fixes
row0row.c < 4 GB rows, doublewrite, hang fixes
row0sel.c < 4 GB rows, doublewrite, hang fixes
row0uins.c < 4 GB rows, doublewrite, hang fixes
row0umod.c < 4 GB rows, doublewrite, hang fixes
row0undo.c < 4 GB rows, doublewrite, hang fixes
row0upd.c < 4 GB rows, doublewrite, hang fixes
srv0srv.c < 4 GB rows, doublewrite, hang fixes
srv0start.c < 4 GB rows, doublewrite, hang fixes
sync0rw.c < 4 GB rows, doublewrite, hang fixes
sync0sync.c < 4 GB rows, doublewrite, hang fixes
trx0purge.c < 4 GB rows, doublewrite, hang fixes
trx0rec.c < 4 GB rows, doublewrite, hang fixes
trx0sys.c < 4 GB rows, doublewrite, hang fixes
btr0btr.c < 4 GB rows, doublewrite, hang fixes
btr0cur.c < 4 GB rows, doublewrite, hang fixes
buf0buf.c < 4 GB rows, doublewrite, hang fixes
buf0flu.c < 4 GB rows, doublewrite, hang fixes
buf0rea.c < 4 GB rows, doublewrite, hang fixes
data0data.c < 4 GB rows, doublewrite, hang fixes
fil0fil.c < 4 GB rows, doublewrite, hang fixes
fsp0fsp.c < 4 GB rows, doublewrite, hang fixes
ibuf0ibuf.c < 4 GB rows, doublewrite, hang fixes
lock0lock.c < 4 GB rows, doublewrite, hang fixes
log0log.c < 4 GB rows, doublewrite, hang fixes
log0recv.c < 4 GB rows, doublewrite, hang fixes
os0file.c < 4 GB rows, doublewrite, hang fixes
page0cur.c < 4 GB rows, doublewrite, hang fixes
pars0pars.c < 4 GB rows, doublewrite, hang fixes
rem0cmp.c < 4 GB rows, doublewrite, hang fixes
rem0rec.c < 4 GB rows, doublewrite, hang fixes
row0ins.c < 4 GB rows, doublewrite, hang fixes
row0mysql.c < 4 GB rows, doublewrite, hang fixes
univ.i < 4 GB rows, doublewrite, hang fixes
data0data.ic < 4 GB rows, doublewrite, hang fixes
mach0data.ic < 4 GB rows, doublewrite, hang fixes
rem0rec.ic < 4 GB rows, doublewrite, hang fixes
row0upd.ic < 4 GB rows, doublewrite, hang fixes
trx0rec.ic < 4 GB rows, doublewrite, hang fixes
rem0cmp.h < 4 GB rows, doublewrite, hang fixes
rem0rec.h < 4 GB rows, doublewrite, hang fixes
row0ins.h < 4 GB rows, doublewrite, hang fixes
row0mysql.h < 4 GB rows, doublewrite, hang fixes
row0row.h < 4 GB rows, doublewrite, hang fixes
row0upd.h < 4 GB rows, doublewrite, hang fixes
srv0srv.h < 4 GB rows, doublewrite, hang fixes
sync0sync.h < 4 GB rows, doublewrite, hang fixes
trx0rec.h < 4 GB rows, doublewrite, hang fixes
trx0sys.h < 4 GB rows, doublewrite, hang fixes
trx0types.h < 4 GB rows, doublewrite, hang fixes
trx0undo.h < 4 GB rows, doublewrite, hang fixes
ut0dbg.h < 4 GB rows, doublewrite, hang fixes
ut0ut.h < 4 GB rows, doublewrite, hang fixes
btr0btr.h < 4 GB rows, doublewrite, hang fixes
btr0cur.h < 4 GB rows, doublewrite, hang fixes
buf0buf.h < 4 GB rows, doublewrite, hang fixes
buf0flu.h < 4 GB rows, doublewrite, hang fixes
data0data.h < 4 GB rows, doublewrite, hang fixes
dict0mem.h < 4 GB rows, doublewrite, hang fixes
fil0fil.h < 4 GB rows, doublewrite, hang fixes
fsp0fsp.h < 4 GB rows, doublewrite, hang fixes
os0file.h < 4 GB rows, doublewrite, hang fixes
innobase/include/btr0btr.h:
< 4 GB rows, doublewrite, hang fixes
innobase/include/btr0cur.h:
< 4 GB rows, doublewrite, hang fixes
innobase/include/buf0buf.h:
< 4 GB rows, doublewrite, hang fixes
innobase/include/buf0flu.h:
< 4 GB rows, doublewrite, hang fixes
innobase/include/data0data.h:
< 4 GB rows, doublewrite, hang fixes
innobase/include/dict0mem.h:
< 4 GB rows, doublewrite, hang fixes
innobase/include/fil0fil.h:
< 4 GB rows, doublewrite, hang fixes
innobase/include/fsp0fsp.h:
< 4 GB rows, doublewrite, hang fixes
innobase/include/os0file.h:
< 4 GB rows, doublewrite, hang fixes
innobase/include/rem0cmp.h:
< 4 GB rows, doublewrite, hang fixes
innobase/include/rem0rec.h:
< 4 GB rows, doublewrite, hang fixes
innobase/include/row0ins.h:
< 4 GB rows, doublewrite, hang fixes
innobase/include/row0mysql.h:
< 4 GB rows, doublewrite, hang fixes
innobase/include/row0row.h:
< 4 GB rows, doublewrite, hang fixes
innobase/include/row0upd.h:
< 4 GB rows, doublewrite, hang fixes
innobase/include/sync0sync.h:
< 4 GB rows, doublewrite, hang fixes
innobase/include/trx0rec.h:
< 4 GB rows, doublewrite, hang fixes
innobase/include/trx0sys.h:
< 4 GB rows, doublewrite, hang fixes
innobase/include/trx0types.h:
< 4 GB rows, doublewrite, hang fixes
innobase/include/trx0undo.h:
< 4 GB rows, doublewrite, hang fixes
innobase/include/ut0dbg.h:
< 4 GB rows, doublewrite, hang fixes
innobase/include/ut0ut.h:
< 4 GB rows, doublewrite, hang fixes
innobase/include/data0data.ic:
< 4 GB rows, doublewrite, hang fixes
innobase/include/mach0data.ic:
< 4 GB rows, doublewrite, hang fixes
innobase/include/rem0rec.ic:
< 4 GB rows, doublewrite, hang fixes
innobase/include/row0upd.ic:
< 4 GB rows, doublewrite, hang fixes
innobase/include/trx0rec.ic:
< 4 GB rows, doublewrite, hang fixes
innobase/include/univ.i:
< 4 GB rows, doublewrite, hang fixes
innobase/btr/btr0btr.c:
< 4 GB rows, doublewrite, hang fixes
innobase/btr/btr0cur.c:
< 4 GB rows, doublewrite, hang fixes
innobase/buf/buf0buf.c:
< 4 GB rows, doublewrite, hang fixes
innobase/buf/buf0flu.c:
< 4 GB rows, doublewrite, hang fixes
innobase/buf/buf0rea.c:
< 4 GB rows, doublewrite, hang fixes
innobase/data/data0data.c:
< 4 GB rows, doublewrite, hang fixes
innobase/fil/fil0fil.c:
< 4 GB rows, doublewrite, hang fixes
innobase/fsp/fsp0fsp.c:
< 4 GB rows, doublewrite, hang fixes
innobase/ibuf/ibuf0ibuf.c:
< 4 GB rows, doublewrite, hang fixes
innobase/lock/lock0lock.c:
< 4 GB rows, doublewrite, hang fixes
innobase/log/log0log.c:
< 4 GB rows, doublewrite, hang fixes
innobase/log/log0recv.c:
< 4 GB rows, doublewrite, hang fixes
innobase/os/os0file.c:
< 4 GB rows, doublewrite, hang fixes
innobase/page/page0cur.c:
< 4 GB rows, doublewrite, hang fixes
innobase/pars/pars0pars.c:
< 4 GB rows, doublewrite, hang fixes
innobase/rem/rem0cmp.c:
< 4 GB rows, doublewrite, hang fixes
innobase/rem/rem0rec.c:
< 4 GB rows, doublewrite, hang fixes
innobase/row/row0ins.c:
< 4 GB rows, doublewrite, hang fixes
innobase/row/row0mysql.c:
< 4 GB rows, doublewrite, hang fixes
innobase/row/row0purge.c:
< 4 GB rows, doublewrite, hang fixes
innobase/row/row0row.c:
< 4 GB rows, doublewrite, hang fixes
innobase/row/row0sel.c:
< 4 GB rows, doublewrite, hang fixes
innobase/row/row0uins.c:
< 4 GB rows, doublewrite, hang fixes
innobase/row/row0umod.c:
< 4 GB rows, doublewrite, hang fixes
innobase/row/row0undo.c:
< 4 GB rows, doublewrite, hang fixes
innobase/row/row0upd.c:
< 4 GB rows, doublewrite, hang fixes
innobase/sync/sync0rw.c:
< 4 GB rows, doublewrite, hang fixes
innobase/sync/sync0sync.c:
< 4 GB rows, doublewrite, hang fixes
innobase/trx/trx0purge.c:
< 4 GB rows, doublewrite, hang fixes
innobase/trx/trx0rec.c:
< 4 GB rows, doublewrite, hang fixes
innobase/trx/trx0sys.c:
< 4 GB rows, doublewrite, hang fixes
innobase/srv/srv0srv.c:
Support raw disk partitions as data files
innobase/srv/srv0start.c:
Support raw disk partitions as data files
innobase/include/srv0srv.h:
Support raw disk partitions as data files
2001-08-04 18:36:14 +02:00
|
|
|
|
2001-02-17 13:19:19 +01:00
|
|
|
/* Save to local variables some data associated with current_rec */
|
|
|
|
cur_slot_no = page_dir_find_owner_slot(current_rec);
|
|
|
|
cur_dir_slot = page_dir_get_nth_slot(page, cur_slot_no);
|
|
|
|
cur_n_owned = page_dir_slot_get_n_owned(cur_dir_slot);
|
|
|
|
|
|
|
|
/* 0. Write the log record */
|
2004-12-02 18:45:07 +01:00
|
|
|
page_cur_delete_rec_write_log(current_rec, index, mtr);
|
2001-02-17 13:19:19 +01:00
|
|
|
|
|
|
|
/* 1. Reset the last insert info in the page header and increment
|
|
|
|
the modify clock for the frame */
|
|
|
|
|
|
|
|
page_header_set_ptr(page, PAGE_LAST_INSERT, NULL);
|
|
|
|
|
|
|
|
/* The page gets invalid for optimistic searches: increment the
|
|
|
|
frame modify clock */
|
|
|
|
|
|
|
|
buf_frame_modify_clock_inc(page);
|
|
|
|
|
|
|
|
/* 2. Find the next and the previous record. Note that the cursor is
|
|
|
|
left at the next record. */
|
|
|
|
|
|
|
|
ut_ad(cur_slot_no > 0);
|
|
|
|
prev_slot = page_dir_get_nth_slot(page, cur_slot_no - 1);
|
|
|
|
|
|
|
|
rec = page_dir_slot_get_rec(prev_slot);
|
|
|
|
|
|
|
|
/* rec now points to the record of the previous directory slot. Look
|
|
|
|
for the immediate predecessor of current_rec in a loop. */
|
|
|
|
|
|
|
|
while(current_rec != rec) {
|
|
|
|
prev_rec = rec;
|
|
|
|
rec = page_rec_get_next(rec);
|
|
|
|
}
|
|
|
|
|
|
|
|
page_cur_move_to_next(cursor);
|
|
|
|
next_rec = cursor->rec;
|
|
|
|
|
|
|
|
/* 3. Remove the record from the linked list of records */
|
|
|
|
|
|
|
|
page_rec_set_next(prev_rec, next_rec);
|
|
|
|
page_header_set_field(page, PAGE_N_RECS,
|
|
|
|
(ulint)(page_get_n_recs(page) - 1));
|
|
|
|
|
|
|
|
/* 4. If the deleted record is pointed to by a dir slot, update the
|
|
|
|
record pointer in slot. In the following if-clause we assume that
|
|
|
|
prev_rec is owned by the same slot, i.e., PAGE_DIR_SLOT_MIN_N_OWNED
|
|
|
|
>= 2. */
|
|
|
|
|
|
|
|
ut_ad(PAGE_DIR_SLOT_MIN_N_OWNED >= 2);
|
|
|
|
ut_ad(cur_n_owned > 1);
|
|
|
|
|
|
|
|
if (current_rec == page_dir_slot_get_rec(cur_dir_slot)) {
|
|
|
|
page_dir_slot_set_rec(cur_dir_slot, prev_rec);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* 5. Update the number of owned records of the slot */
|
|
|
|
|
|
|
|
page_dir_slot_set_n_owned(cur_dir_slot, cur_n_owned - 1);
|
|
|
|
|
|
|
|
/* 6. Free the memory occupied by the record */
|
2005-03-01 12:54:48 +01:00
|
|
|
page_mem_free(page, current_rec, offsets);
|
2001-02-17 13:19:19 +01:00
|
|
|
|
|
|
|
/* 7. Now we have decremented the number of owned records of the slot.
|
|
|
|
If the number drops below PAGE_DIR_SLOT_MIN_N_OWNED, we balance the
|
|
|
|
slots. */
|
|
|
|
|
|
|
|
if (cur_n_owned <= PAGE_DIR_SLOT_MIN_N_OWNED) {
|
|
|
|
page_dir_balance_slot(page, cur_slot_no);
|
|
|
|
}
|
|
|
|
}
|