11
11
#include "trx0undo.h"
13
13
/*************************************************************************
14
Reads the trx id or roll ptr field from a clustered index record: this function
15
is slower than the specialized inline functions. */
18
row_get_rec_sys_field(
19
/*==================*/
20
/* out: value of the field */
21
ulint type, /* in: DATA_TRX_ID or DATA_ROLL_PTR */
22
rec_t* rec, /* in: record */
23
dict_index_t* index, /* in: clustered index */
24
const ulint* offsets);/* in: rec_get_offsets(rec, index) */
25
/*************************************************************************
26
Sets the trx id or roll ptr field in a clustered index record: this function
27
is slower than the specialized inline functions. */
30
row_set_rec_sys_field(
31
/*==================*/
32
/* out: value of the field */
33
ulint type, /* in: DATA_TRX_ID or DATA_ROLL_PTR */
34
rec_t* rec, /* in: record */
35
dict_index_t* index, /* in: clustered index */
36
const ulint* offsets,/* in: rec_get_offsets(rec, index) */
37
dulint val); /* in: value to set */
39
/*************************************************************************
14
40
Reads the trx id field from a clustered index record. */
17
43
row_get_rec_trx_id(
18
44
/*===============*/
19
45
/* out: value of the field */
20
const rec_t* rec, /* in: record */
46
rec_t* rec, /* in: record */
21
47
dict_index_t* index, /* in: clustered index */
22
48
const ulint* offsets)/* in: rec_get_offsets(rec, index) */
26
ut_ad(dict_index_is_clust(index));
52
ut_ad(index->type & DICT_CLUSTERED);
27
53
ut_ad(rec_offs_validate(rec, index, offsets));
29
55
offset = index->trx_id_offset;
32
offset = row_get_trx_id_offset(rec, index, offsets);
58
return(trx_read_trx_id(rec + offset));
60
return(row_get_rec_sys_field(DATA_TRX_ID,
61
rec, index, offsets));
35
return(trx_read_trx_id(rec + offset));
38
65
/*************************************************************************
42
69
row_get_rec_roll_ptr(
43
70
/*=================*/
44
71
/* out: value of the field */
45
const rec_t* rec, /* in: record */
72
rec_t* rec, /* in: record */
46
73
dict_index_t* index, /* in: clustered index */
47
74
const ulint* offsets)/* in: rec_get_offsets(rec, index) */
51
ut_ad(dict_index_is_clust(index));
52
ut_ad(rec_offs_validate(rec, index, offsets));
54
offset = index->trx_id_offset;
57
offset = row_get_trx_id_offset(rec, index, offsets);
60
return(trx_read_roll_ptr(rec + offset + DATA_TRX_ID_LEN));
78
ut_ad(index->type & DICT_CLUSTERED);
79
ut_ad(rec_offs_validate(rec, index, offsets));
81
offset = index->trx_id_offset;
84
return(trx_read_roll_ptr(rec + offset + DATA_TRX_ID_LEN));
86
return(row_get_rec_sys_field(DATA_ROLL_PTR,
87
rec, index, offsets));
91
/*************************************************************************
92
Writes the trx id field to a clustered index record. */
97
rec_t* rec, /* in: record */
98
dict_index_t* index, /* in: clustered index */
99
const ulint* offsets,/* in: rec_get_offsets(rec, index) */
100
dulint trx_id) /* in: value of the field */
104
ut_ad(index->type & DICT_CLUSTERED);
105
ut_ad(rec_offs_validate(rec, index, offsets));
107
offset = index->trx_id_offset;
110
trx_write_trx_id(rec + offset, trx_id);
112
row_set_rec_sys_field(DATA_TRX_ID,
113
rec, index, offsets, trx_id);
117
/*************************************************************************
118
Sets the roll pointer field in a clustered index record. */
121
row_set_rec_roll_ptr(
122
/*=================*/
123
rec_t* rec, /* in: record */
124
dict_index_t* index, /* in: clustered index */
125
const ulint* offsets,/* in: rec_get_offsets(rec, index) */
126
dulint roll_ptr)/* in: value of the field */
130
ut_ad(index->type & DICT_CLUSTERED);
131
ut_ad(rec_offs_validate(rec, index, offsets));
133
offset = index->trx_id_offset;
136
trx_write_roll_ptr(rec + offset + DATA_TRX_ID_LEN, roll_ptr);
138
row_set_rec_sys_field(DATA_ROLL_PTR,
139
rec, index, offsets, roll_ptr);
63
143
/***********************************************************************
68
148
row_build_row_ref_fast(
69
149
/*===================*/
70
dtuple_t* ref, /* in/out: typed data tuple where the
150
dtuple_t* ref, /* in: typed data tuple where the
71
151
reference is built */
72
152
const ulint* map, /* in: array of field numbers in rec
73
153
telling how ref should be built from
74
154
the fields of rec */
75
const rec_t* rec, /* in: record in the index; must be
155
rec_t* rec, /* in: record in the index; must be
76
156
preserved while ref is used, as we do
77
157
not copy field values to heap */
78
158
const ulint* offsets)/* in: array returned by rec_get_offsets() */
87
167
ut_ad(rec_offs_validate(rec, NULL, offsets));
88
ut_ad(!rec_offs_any_extern(offsets));
89
168
ref_len = dtuple_get_n_fields(ref);
91
170
for (i = 0; i < ref_len; i++) {