Commit 44728324 authored by unknown's avatar unknown

InnoDB: Remove dependency on rem0rec.ic from dict0dict.ic (Bug #7464)


innobase/dict/dict0dict.c:
  Make dict_is_mixed_table_rec() a non-inlined function.
innobase/include/dict0dict.h:
  Make dict_is_mixed_table_rec() a non-inlined function.
  Remove dict_index_rec_get_sys_col().
innobase/include/dict0dict.ic:
  Make dict_is_mixed_table_rec() a non-inlined function.
  Remove dict_index_rec_get_sys_col().
innobase/trx/trx0rec.c:
  Replace the two calls to the removed
  function dict_index_rec_get_sys_col() with equivalent code.
parent 59b274ea
......@@ -3689,6 +3689,29 @@ dict_tree_find_index_for_tuple(
return(index);
}
/***********************************************************************
Checks if a table which is a mixed cluster member owns a record. */
ibool
dict_is_mixed_table_rec(
/*====================*/
/* out: TRUE if the record belongs to this
table */
dict_table_t* table, /* in: table in a mixed cluster */
rec_t* rec) /* in: user record in the clustered index */
{
byte* mix_id_field;
ulint len;
ut_ad(!table->comp);
mix_id_field = rec_get_nth_field_old(rec,
table->mix_len, &len);
return(len == table->mix_id_len
&& !ut_memcmp(table->mix_id_buf, mix_id_field, len));
}
/**************************************************************************
Checks that a tuple has n_fields_cmp value in a sensible range, so that
no comparison can occur with the page number field in a node pointer. */
......
......@@ -657,19 +657,6 @@ dict_index_copy_types(
dtuple_t* tuple, /* in: data tuple */
dict_index_t* index, /* in: index */
ulint n_fields); /* in: number of field types to copy */
/************************************************************************
Gets the value of a system column in a clustered index record. The clustered
index must contain the system column: if the index is unique, row id is
not contained there! */
UNIV_INLINE
dulint
dict_index_rec_get_sys_col(
/*=======================*/
/* out: system column value */
dict_index_t* index, /* in: clustered index describing the record */
const ulint* offsets,/* in: offsets returned by rec_get_offsets() */
ulint type, /* in: column type: DATA_ROLL_PTR, ... */
rec_t* rec); /* in: record */
/*************************************************************************
Gets the index tree where the index is stored. */
UNIV_INLINE
......@@ -731,7 +718,7 @@ dict_tree_find_index_for_tuple(
dtuple_t* tuple); /* in: tuple for which to find index */
/***********************************************************************
Checks if a table which is a mixed cluster member owns a record. */
UNIV_INLINE
ibool
dict_is_mixed_table_rec(
/*====================*/
......
......@@ -9,7 +9,6 @@ Created 1/8/1996 Heikki Tuuri
#include "dict0load.h"
#include "trx0undo.h"
#include "trx0sys.h"
#include "rem0rec.h"
/*************************************************************************
Gets the column data type. */
......@@ -312,51 +311,6 @@ dict_index_get_sys_col_pos(
dict_table_get_sys_col_no(index->table, type)));
}
/************************************************************************
Gets the value of a system column in a clustered index record. The clustered
index must contain the system column: if the index is unique, row id is
not contained there! */
UNIV_INLINE
dulint
dict_index_rec_get_sys_col(
/*=======================*/
/* out: system column value */
dict_index_t* index, /* in: clustered index describing the record */
const ulint* offsets,/* in: offsets returned by rec_get_offsets() */
ulint type, /* in: column type: DATA_ROLL_PTR, ... */
rec_t* rec) /* in: record */
{
ulint pos;
byte* field;
ulint len;
ut_ad(index);
ut_ad(index->type & DICT_CLUSTERED);
ut_ad(rec_offs_validate(rec, index, offsets));
pos = dict_index_get_sys_col_pos(index, type);
ut_ad(pos != ULINT_UNDEFINED);
field = rec_get_nth_field(rec, offsets, pos, &len);
if (type == DATA_ROLL_PTR) {
ut_ad(len == 7);
return(trx_read_roll_ptr(field));
} else if (type == DATA_TRX_ID) {
return(trx_read_trx_id(field));
} else if (type == DATA_MIX_ID) {
return(mach_dulint_read_compressed(field));
} else {
ut_a(type == DATA_ROW_ID);
return(mach_read_from_6(field));
}
}
/*************************************************************************
Gets the index tree where the index is stored. */
UNIV_INLINE
......@@ -664,31 +618,3 @@ dict_table_get_index(
return(index);
}
/***********************************************************************
Checks if a table which is a mixed cluster member owns a record. */
UNIV_INLINE
ibool
dict_is_mixed_table_rec(
/*====================*/
/* out: TRUE if the record belongs to this
table */
dict_table_t* table, /* in: table in a mixed cluster */
rec_t* rec) /* in: user record in the clustered index */
{
byte* mix_id_field;
ulint len;
ut_ad(!table->comp);
mix_id_field = rec_get_nth_field_old(rec,
table->mix_len, &len);
if ((len != table->mix_id_len)
|| (0 != ut_memcmp(table->mix_id_buf, mix_id_field, len))) {
return(FALSE);
}
return(TRUE);
}
......@@ -485,10 +485,15 @@ trx_undo_page_report_modify(
ptr += 1;
/* Store the values of the system columns */
trx_id = dict_index_rec_get_sys_col(index, offsets,
DATA_TRX_ID, rec);
roll_ptr = dict_index_rec_get_sys_col(index, offsets,
DATA_ROLL_PTR, rec);
field = rec_get_nth_field(rec, offsets,
dict_index_get_sys_col_pos(index, DATA_TRX_ID), &len);
ut_ad(len == DATA_TRX_ID_LEN);
trx_id = trx_read_trx_id(field);
field = rec_get_nth_field(rec, offsets,
dict_index_get_sys_col_pos(index, DATA_ROLL_PTR), &len);
ut_ad(len == DATA_ROLL_PTR_LEN);
roll_ptr = trx_read_roll_ptr(field);
len = mach_dulint_write_compressed(ptr, trx_id);
ptr += len;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment