1
/*****************************************************************************
3
Copyright (C) 1996, 2009, Innobase Oy. All Rights Reserved.
5
This program is free software; you can redistribute it and/or modify it under
6
the terms of the GNU General Public License as published by the Free Software
7
Foundation; version 2 of the License.
9
This program is distributed in the hope that it will be useful, but WITHOUT
10
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
13
You should have received a copy of the GNU General Public License along with
14
this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
15
St, Fifth Floor, Boston, MA 02110-1301 USA
17
*****************************************************************************/
19
/**************************************************//**
20
@file include/row0row.ic
23
Created 4/20/1996 Heikki Tuuri
24
*******************************************************/
26
#include "dict0dict.h"
30
/*********************************************************************//**
31
Reads the trx id field from a clustered index record.
32
@return value of the field */
37
const rec_t* rec, /*!< in: record */
38
dict_index_t* index, /*!< in: clustered index */
39
const ulint* offsets)/*!< in: rec_get_offsets(rec, index) */
43
ut_ad(dict_index_is_clust(index));
44
ut_ad(rec_offs_validate(rec, index, offsets));
46
offset = index->trx_id_offset;
49
offset = row_get_trx_id_offset(rec, index, offsets);
52
return(trx_read_trx_id(rec + offset));
55
/*********************************************************************//**
56
Reads the roll pointer field from a clustered index record.
57
@return value of the field */
62
const rec_t* rec, /*!< in: record */
63
dict_index_t* index, /*!< in: clustered index */
64
const ulint* offsets)/*!< in: rec_get_offsets(rec, index) */
68
ut_ad(dict_index_is_clust(index));
69
ut_ad(rec_offs_validate(rec, index, offsets));
71
offset = index->trx_id_offset;
74
offset = row_get_trx_id_offset(rec, index, offsets);
77
return(trx_read_roll_ptr(rec + offset + DATA_TRX_ID_LEN));
80
/*******************************************************************//**
81
Builds from a secondary index record a row reference with which we can
82
search the clustered index record. */
85
row_build_row_ref_fast(
86
/*===================*/
87
dtuple_t* ref, /*!< in/out: typed data tuple where the
89
const ulint* map, /*!< in: array of field numbers in rec
90
telling how ref should be built from
92
const rec_t* rec, /*!< in: record in the index; must be
93
preserved while ref is used, as we do
94
not copy field values to heap */
95
const ulint* offsets)/*!< in: array returned by rec_get_offsets() */
104
ut_ad(rec_offs_validate(rec, NULL, offsets));
105
ut_ad(!rec_offs_any_extern(offsets));
106
ref_len = dtuple_get_n_fields(ref);
108
for (i = 0; i < ref_len; i++) {
109
dfield = dtuple_get_nth_field(ref, i);
111
field_no = *(map + i);
113
if (field_no != ULINT_UNDEFINED) {
115
field = rec_get_nth_field(rec, offsets,
117
dfield_set_data(dfield, field, len);