48
36
row_get_rec_roll_ptr(
49
37
/*=================*/
50
38
/* out: value of the field */
51
const rec_t* rec, /* in: record */
39
rec_t* rec, /* in: record */
52
40
dict_index_t* index, /* in: clustered index */
53
41
const ulint* offsets);/* in: rec_get_offsets(rec, index) */
42
/*************************************************************************
43
Writes the trx id field to a clustered index record. */
48
rec_t* rec, /* in: record */
49
dict_index_t* index, /* in: clustered index */
50
const ulint* offsets,/* in: rec_get_offsets(rec, index) */
51
dulint trx_id);/* in: value of the field */
52
/*************************************************************************
53
Sets the roll pointer field in a clustered index record. */
58
rec_t* rec, /* in: record */
59
dict_index_t* index, /* in: clustered index */
60
const ulint* offsets,/* in: rec_get_offsets(rec, index) */
61
dulint roll_ptr);/* in: value of the field */
54
62
/*********************************************************************
55
When an insert or purge to a table is performed, this function builds
56
the entry to be inserted into or purged from an index on the table. */
63
When an insert to a table is performed, this function builds the entry which
64
has to be inserted to an index on the table. */
59
67
row_build_index_entry(
60
68
/*==================*/
61
/* out: index entry which should be
62
inserted or purged, or NULL if the
63
externally stored columns in the
64
clustered index record are unavailable
66
const dtuple_t* row, /* in: row which should be
68
row_ext_t* ext, /* in: externally stored column prefixes,
69
/* out: index entry which should be inserted */
70
dtuple_t* row, /* in: row which should be inserted to the
70
72
dict_index_t* index, /* in: index on the table */
71
73
mem_heap_t* heap); /* in: memory heap from which the memory for
72
74
the index entry is allocated */
73
75
/***********************************************************************
74
An inverse function to row_build_index_entry. Builds a row from a
76
An inverse function to dict_row_build_index_entry. Builds a row from a
75
77
record in a clustered index. */
80
/* out, own: row built;
81
see the NOTE below! */
82
ulint type, /* in: ROW_COPY_POINTERS or
83
ROW_COPY_DATA; the latter
84
copies also the data fields to
85
heap while the first only
86
places pointers to data fields
87
on the index page, and thus is
89
const dict_index_t* index, /* in: clustered index */
90
const rec_t* rec, /* in: record in the clustered
91
index; NOTE: in the case
92
ROW_COPY_POINTERS the data
93
fields in the row will point
94
directly into this record,
95
therefore, the buffer page of
96
this record must be at least
97
s-latched and the latch held
98
as long as the row dtuple is used! */
99
const ulint* offsets,/* in: rec_get_offsets(rec,index)
100
or NULL, in which case this function
101
will invoke rec_get_offsets() */
102
const dict_table_t* col_table,
103
/* in: table, to check which
104
externally stored columns
105
occur in the ordering columns
106
of an index, or NULL if
107
index->table should be
108
consulted instead; the user
109
columns in this table should be
110
the same columns as in index->table */
111
row_ext_t** ext, /* out, own: cache of
112
externally stored column
114
mem_heap_t* heap); /* in: memory heap from which
115
the memory needed is allocated */
82
/* out, own: row built; see the NOTE below! */
83
ulint type, /* in: ROW_COPY_POINTERS or ROW_COPY_DATA;
84
the latter copies also the data fields to
85
heap while the first only places pointers to
86
data fields on the index page, and thus is
88
dict_index_t* index, /* in: clustered index */
89
rec_t* rec, /* in: record in the clustered index;
90
NOTE: in the case ROW_COPY_POINTERS
91
the data fields in the row will point
92
directly into this record, therefore,
93
the buffer page of this record must be
94
at least s-latched and the latch held
95
as long as the row dtuple is used! */
96
const ulint* offsets,/* in: rec_get_offsets(rec, index)
97
or NULL, in which case this function
98
will invoke rec_get_offsets() */
99
mem_heap_t* heap); /* in: memory heap from which the memory
100
needed is allocated */
116
101
/***********************************************************************
117
102
Converts an index record to a typed data tuple. */
120
row_rec_to_index_entry_low(
121
/*=======================*/
122
/* out: index entry built; does not
123
set info_bits, and the data fields in
124
the entry will point directly to rec */
125
const rec_t* rec, /* in: record in the index */
126
const dict_index_t* index, /* in: index */
127
const ulint* offsets,/* in: rec_get_offsets(rec, index) */
128
ulint* n_ext, /* out: number of externally
130
mem_heap_t* heap); /* in: memory heap from which
131
the memory needed is allocated */
132
/***********************************************************************
133
Converts an index record to a typed data tuple. NOTE that externally
134
stored (often big) fields are NOT copied to heap. */
137
105
row_rec_to_index_entry(
138
106
/*===================*/
139
/* out, own: index entry
140
built; see the NOTE below! */
141
ulint type, /* in: ROW_COPY_DATA, or
142
ROW_COPY_POINTERS: the former
143
copies also the data fields to
144
heap as the latter only places
145
pointers to data fields on the
147
const rec_t* rec, /* in: record in the index;
149
ROW_COPY_POINTERS the data
150
fields in the row will point
151
directly into this record,
152
therefore, the buffer page of
153
this record must be at least
154
s-latched and the latch held
155
as long as the dtuple is used! */
156
const dict_index_t* index, /* in: index */
157
ulint* offsets,/* in/out: rec_get_offsets(rec) */
158
ulint* n_ext, /* out: number of externally
160
mem_heap_t* heap); /* in: memory heap from which
161
the memory needed is allocated */
107
/* out, own: index entry built; see the
109
ulint type, /* in: ROW_COPY_DATA, or ROW_COPY_POINTERS:
110
the former copies also the data fields to
111
heap as the latter only places pointers to
112
data fields on the index page */
113
dict_index_t* index, /* in: index */
114
rec_t* rec, /* in: record in the index;
115
NOTE: in the case ROW_COPY_POINTERS
116
the data fields in the row will point
117
directly into this record, therefore,
118
the buffer page of this record must be
119
at least s-latched and the latch held
120
as long as the dtuple is used! */
121
mem_heap_t* heap); /* in: memory heap from which the memory
122
needed is allocated */
162
123
/***********************************************************************
163
124
Builds from a secondary index record a row reference with which we can
164
125
search the clustered index record. */
167
128
row_build_row_ref(
168
129
/*==============*/
185
146
/***********************************************************************
186
147
Builds from a secondary index record a row reference with which we can
187
148
search the clustered index record. */
190
151
row_build_row_ref_in_tuple(
191
152
/*=======================*/
192
dtuple_t* ref, /* in/out: row reference built;
193
see the NOTE below! */
194
const rec_t* rec, /* in: record in the index;
195
NOTE: the data fields in ref
196
will point directly into this
197
record, therefore, the buffer
198
page of this record must be at
199
least s-latched and the latch
200
held as long as the row
201
reference is used! */
202
const dict_index_t* index, /* in: secondary index */
203
ulint* offsets,/* in: rec_get_offsets(rec, index)
205
trx_t* trx); /* in: transaction */
153
dtuple_t* ref, /* in/out: row reference built; see the
155
dict_index_t* index, /* in: index */
156
rec_t* rec, /* in: record in the index;
157
NOTE: the data fields in ref will point
158
directly into this record, therefore,
159
the buffer page of this record must be
160
at least s-latched and the latch held
161
as long as the row reference is used! */
162
trx_t* trx); /* in: transaction */
206
163
/***********************************************************************
207
164
From a row build a row reference with which we can search the clustered
211
168
row_build_row_ref_from_row(
212
169
/*=======================*/
213
dtuple_t* ref, /* in/out: row reference built;
215
ref must have the right number
217
const dict_table_t* table, /* in: table */
218
const dtuple_t* row); /* in: row
219
NOTE: the data fields in ref will point
220
directly into data of this row */
170
dtuple_t* ref, /* in/out: row reference built; see the
171
NOTE below! ref must have the right number
173
dict_table_t* table, /* in: table */
174
dtuple_t* row); /* in: row
175
NOTE: the data fields in ref will point
176
directly into data of this row */
221
177
/***********************************************************************
222
178
Builds from a secondary index record a row reference with which we can
223
179
search the clustered index record. */
226
182
row_build_row_ref_fast(
227
183
/*===================*/
228
dtuple_t* ref, /* in/out: typed data tuple where the
184
dtuple_t* ref, /* in: typed data tuple where the
229
185
reference is built */
230
186
const ulint* map, /* in: array of field numbers in rec
231
187
telling how ref should be built from
232
188
the fields of rec */
233
const rec_t* rec, /* in: record in the index; must be
189
rec_t* rec, /* in: record in the index; must be
234
190
preserved while ref is used, as we do
235
191
not copy field values to heap */
236
192
const ulint* offsets);/* in: array returned by rec_get_offsets() */
237
193
/*******************************************************************
238
194
Searches the clustered index record for a row, if we have the row
242
198
row_search_on_row_ref(
243
199
/*==================*/
244
/* out: TRUE if found */
245
btr_pcur_t* pcur, /* out: persistent cursor, which must
246
be closed by the caller */
247
ulint mode, /* in: BTR_MODIFY_LEAF, ... */
248
const dict_table_t* table, /* in: table */
249
const dtuple_t* ref, /* in: row reference */
250
mtr_t* mtr); /* in/out: mtr */
200
/* out: TRUE if found */
201
btr_pcur_t* pcur, /* in/out: persistent cursor, which must
202
be closed by the caller */
203
ulint mode, /* in: BTR_MODIFY_LEAF, ... */
204
dict_table_t* table, /* in: table */
205
dtuple_t* ref, /* in: row reference */
206
mtr_t* mtr); /* in: mtr */
251
207
/*************************************************************************
252
208
Fetches the clustered index record for a secondary index record. The latches
253
209
on the secondary index record are preserved. */
256
212
row_get_clust_rec(
257
213
/*==============*/
258
214
/* out: record or NULL, if no record found */
259
215
ulint mode, /* in: BTR_MODIFY_LEAF, ... */
260
const rec_t* rec, /* in: record in a secondary index */
216
rec_t* rec, /* in: record in a secondary index */
261
217
dict_index_t* index, /* in: secondary index */
262
218
dict_index_t** clust_index,/* out: clustered index */
263
219
mtr_t* mtr); /* in: mtr */
264
220
/*******************************************************************
265
221
Searches an index record. */
268
224
row_search_index_entry(
269
225
/*===================*/
270
226
/* out: TRUE if found */
271
227
dict_index_t* index, /* in: index */
272
const dtuple_t* entry, /* in: index entry */
228
dtuple_t* entry, /* in: index entry */
273
229
ulint mode, /* in: BTR_MODIFY_LEAF, ... */
274
230
btr_pcur_t* pcur, /* in/out: persistent cursor, which must
275
231
be closed by the caller */