#include "univ.i"#include "data0data.h"#include "dict0types.h"#include "trx0types.h"#include "que0types.h"#include "mtr0mtr.h"#include "rem0types.h"#include "read0types.h"#include "btr0types.h"Include dependency graph for row0row.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.
| #define ROW_COPY_ALSO_EXTERNALS 3 |
| #define ROW_COPY_DATA 1 |
Definition at line 236 of file row0row.h.
Referenced by btr_cur_optimistic_update(), btr_cur_pessimistic_update(), row_build_row_ref(), row_rec_to_index_entry(), row_scan_and_check_index(), row_undo_search_clust_to_pcur(), row_upd_check_references_constraints(), row_upd_store_row(), and trx_undo_prev_version_build().
| #define ROW_COPY_POINTERS 2 |
Definition at line 237 of file row0row.h.
Referenced by row_build(), row_get_clust_rec(), row_ins_foreign_check_on_constraint(), row_vers_impl_x_locked_off_kernel(), and row_vers_old_has_index_entry().
| dtuple_t* row_build | ( | ulint | type, | |
| dict_index_t * | index, | |||
| rec_t * | rec, | |||
| const ulint * | offsets, | |||
| mem_heap_t * | heap | |||
| ) |
Definition at line 171 of file row0row.c.
References btr_rec_copy_externally_stored_field(), buf, dfield_set_data(), DICT_CLUSTERED, dict_col_get_no(), dict_field_get_col(), dict_index_get_nth_field(), dict_table_copy_types(), dict_table_get_n_cols(), dict_table_is_comp(), dtuple_create(), dtuple_get_nth_field(), dtuple_set_info_bits(), index(), mem_heap_alloc(), NULL, dict_field_struct::prefix_len, rec_copy(), rec_get_info_bits(), rec_get_nth_field(), rec_get_offsets, rec_offs_make_valid(), rec_offs_n_fields(), REC_OFFS_NORMAL_SIZE, rec_offs_nth_extern(), rec_offs_size(), rec_offs_validate(), ROW_COPY_ALSO_EXTERNALS, ROW_COPY_POINTERS, and ut_ad.
Referenced by row_undo_search_clust_to_pcur(), row_upd_store_row(), row_vers_impl_x_locked_off_kernel(), and row_vers_old_has_index_entry().
00173 : row built; see the NOTE below! */ 00174 ulint type, /* in: ROW_COPY_POINTERS, ROW_COPY_DATA, or 00175 ROW_COPY_ALSO_EXTERNALS, 00176 the two last copy also the data fields to 00177 heap as the first only places pointers to 00178 data fields on the index page, and thus is 00179 more efficient */ 00180 dict_index_t* index, /* in: clustered index */ 00181 rec_t* rec, /* in: record in the clustered index; 00182 NOTE: in the case ROW_COPY_POINTERS 00183 the data fields in the row will point 00184 directly into this record, therefore, 00185 the buffer page of this record must be 00186 at least s-latched and the latch held 00187 as long as the row dtuple is used! */ 00188 const ulint* offsets,/* in: rec_get_offsets(rec, index) 00189 or NULL, in which case this function 00190 will invoke rec_get_offsets() */ 00191 mem_heap_t* heap) /* in: memory heap from which the memory 00192 needed is allocated */ 00193 { 00194 dtuple_t* row; 00195 dict_table_t* table; 00196 dict_field_t* ind_field; 00197 dict_col_t* col; 00198 dfield_t* dfield; 00199 ulint n_fields; 00200 byte* field; 00201 ulint len; 00202 ulint row_len; 00203 byte* buf; 00204 ulint i; 00205 mem_heap_t* tmp_heap = NULL; 00206 ulint offsets_[REC_OFFS_NORMAL_SIZE]; 00207 *offsets_ = (sizeof offsets_) / sizeof *offsets_; 00208 00209 ut_ad(index && rec && heap); 00210 ut_ad(index->type & DICT_CLUSTERED); 00211 00212 if (!offsets) { 00213 offsets = rec_get_offsets(rec, index, offsets_, 00214 ULINT_UNDEFINED, &tmp_heap); 00215 } else { 00216 ut_ad(rec_offs_validate(rec, index, offsets)); 00217 } 00218 00219 if (type != ROW_COPY_POINTERS) { 00220 /* Take a copy of rec to heap */ 00221 buf = mem_heap_alloc(heap, rec_offs_size(offsets)); 00222 rec = rec_copy(buf, rec, offsets); 00223 /* Avoid a debug assertion in rec_offs_validate(). */ 00224 rec_offs_make_valid(rec, index, (ulint*) offsets); 00225 } 00226 00227 table = index->table; 00228 row_len = dict_table_get_n_cols(table); 00229 00230 row = dtuple_create(heap, row_len); 00231 00232 dtuple_set_info_bits(row, rec_get_info_bits(rec, 00233 dict_table_is_comp(table))); 00234 00235 n_fields = rec_offs_n_fields(offsets); 00236 00237 dict_table_copy_types(row, table); 00238 00239 for (i = 0; i < n_fields; i++) { 00240 ind_field = dict_index_get_nth_field(index, i); 00241 00242 if (ind_field->prefix_len == 0) { 00243 00244 col = dict_field_get_col(ind_field); 00245 dfield = dtuple_get_nth_field(row, 00246 dict_col_get_no(col)); 00247 field = rec_get_nth_field(rec, offsets, i, &len); 00248 00249 if (type == ROW_COPY_ALSO_EXTERNALS 00250 && rec_offs_nth_extern(offsets, i)) { 00251 00252 field = btr_rec_copy_externally_stored_field( 00253 rec, offsets, i, &len, heap); 00254 } 00255 00256 dfield_set_data(dfield, field, len); 00257 } 00258 } 00259 00260 ut_ad(dtuple_check_typed(row)); 00261 00262 if (tmp_heap) { 00263 mem_heap_free(tmp_heap); 00264 } 00265 00266 return(row); 00267 }
Here is the call graph for this function:

Here is the caller graph for this function:

| dtuple_t* row_build_index_entry | ( | dtuple_t * | row, | |
| dict_index_t * | index, | |||
| mem_heap_t * | heap | |||
| ) |
Definition at line 103 of file row0row.c.
References dict_field_struct::col, dfield_struct::data, dfield_copy(), dfield_get_len(), dfield_set_len(), dict_col_get_no(), dict_col_get_type(), dict_field_get_col(), dict_index_get_n_fields(), dict_index_get_n_unique_in_tree(), dict_index_get_nth_field(), DICT_UNIVERSAL, dtuple_check_typed(), dtuple_create(), dtuple_get_nth_field(), dtuple_set_n_fields_cmp(), dtype_get_at_most_n_mbchars(), index(), dict_field_struct::prefix_len, and ut_ad.
Referenced by ins_node_create_entry_list(), row_purge_del_mark(), row_purge_upd_exist_or_extern(), row_undo_ins(), row_undo_mod_del_mark_sec(), row_undo_mod_upd_del_sec(), row_undo_mod_upd_exist_sec(), row_upd_clust_rec_by_insert(), row_upd_sec_index_entry(), row_vers_impl_x_locked_off_kernel(), and row_vers_old_has_index_entry().
00105 : index entry which should be inserted */ 00106 dtuple_t* row, /* in: row which should be inserted to the 00107 table */ 00108 dict_index_t* index, /* in: index on the table */ 00109 mem_heap_t* heap) /* in: memory heap from which the memory for 00110 the index entry is allocated */ 00111 { 00112 dtuple_t* entry; 00113 ulint entry_len; 00114 dict_field_t* ind_field; 00115 dfield_t* dfield; 00116 dfield_t* dfield2; 00117 dict_col_t* col; 00118 ulint i; 00119 ulint storage_len; 00120 dtype_t* cur_type; 00121 00122 ut_ad(row && index && heap); 00123 ut_ad(dtuple_check_typed(row)); 00124 00125 entry_len = dict_index_get_n_fields(index); 00126 entry = dtuple_create(heap, entry_len); 00127 00128 if (index->type & DICT_UNIVERSAL) { 00129 dtuple_set_n_fields_cmp(entry, entry_len); 00130 } else { 00131 dtuple_set_n_fields_cmp(entry, 00132 dict_index_get_n_unique_in_tree(index)); 00133 } 00134 00135 for (i = 0; i < entry_len; i++) { 00136 ind_field = dict_index_get_nth_field(index, i); 00137 col = ind_field->col; 00138 00139 dfield = dtuple_get_nth_field(entry, i); 00140 00141 dfield2 = dtuple_get_nth_field(row, dict_col_get_no(col)); 00142 00143 dfield_copy(dfield, dfield2); 00144 00145 /* If a column prefix index, take only the prefix */ 00146 if (ind_field->prefix_len > 0 00147 && dfield_get_len(dfield2) != UNIV_SQL_NULL) { 00148 00149 cur_type = dict_col_get_type( 00150 dict_field_get_col(ind_field)); 00151 00152 storage_len = dtype_get_at_most_n_mbchars( 00153 cur_type, 00154 ind_field->prefix_len, 00155 dfield_get_len(dfield2), dfield2->data); 00156 00157 dfield_set_len(dfield, storage_len); 00158 } 00159 } 00160 00161 ut_ad(dtuple_check_typed(entry)); 00162 00163 return(entry); 00164 }
Here is the call graph for this function:

Here is the caller graph for this function:

| dtuple_t* row_build_row_ref | ( | ulint | type, | |
| dict_index_t * | index, | |||
| rec_t * | rec, | |||
| mem_heap_t * | heap | |||
| ) |
Definition at line 352 of file row0row.c.
References buf, dfield_get_type(), dfield_set_data(), dfield_set_len(), dict_index_copy_types(), dict_index_get_n_unique(), dict_index_get_nth_field(), dict_index_get_nth_field_pos(), dict_table_get_first_index(), dtuple_check_typed(), dtuple_create(), dtuple_get_nth_field(), dtype_get_at_most_n_mbchars(), index(), mem_heap_alloc(), mem_heap_free, NULL, pos(), dict_field_struct::prefix_len, rec_copy(), rec_get_nth_field(), rec_get_offsets, rec_offs_make_valid(), REC_OFFS_NORMAL_SIZE, rec_offs_size(), ROW_COPY_DATA, ut_a, and ut_ad.
Referenced by row_get_clust_rec(), and row_ins_foreign_check_on_constraint().
00354 : row reference built; see the 00355 NOTE below! */ 00356 ulint type, /* in: ROW_COPY_DATA, or ROW_COPY_POINTERS: 00357 the former copies also the data fields to 00358 heap, whereas the latter only places pointers 00359 to data fields on the index page */ 00360 dict_index_t* index, /* in: index */ 00361 rec_t* rec, /* in: record in the index; 00362 NOTE: in the case ROW_COPY_POINTERS 00363 the data fields in the row will point 00364 directly into this record, therefore, 00365 the buffer page of this record must be 00366 at least s-latched and the latch held 00367 as long as the row reference is used! */ 00368 mem_heap_t* heap) /* in: memory heap from which the memory 00369 needed is allocated */ 00370 { 00371 dict_table_t* table; 00372 dict_index_t* clust_index; 00373 dfield_t* dfield; 00374 dtuple_t* ref; 00375 byte* field; 00376 ulint len; 00377 ulint ref_len; 00378 ulint pos; 00379 byte* buf; 00380 ulint clust_col_prefix_len; 00381 ulint i; 00382 mem_heap_t* tmp_heap = NULL; 00383 ulint offsets_[REC_OFFS_NORMAL_SIZE]; 00384 ulint* offsets = offsets_; 00385 *offsets_ = (sizeof offsets_) / sizeof *offsets_; 00386 00387 ut_ad(index && rec && heap); 00388 00389 offsets = rec_get_offsets(rec, index, offsets, 00390 ULINT_UNDEFINED, &tmp_heap); 00391 00392 if (type == ROW_COPY_DATA) { 00393 /* Take a copy of rec to heap */ 00394 00395 buf = mem_heap_alloc(heap, rec_offs_size(offsets)); 00396 00397 rec = rec_copy(buf, rec, offsets); 00398 /* Avoid a debug assertion in rec_offs_validate(). */ 00399 rec_offs_make_valid(rec, index, offsets); 00400 } 00401 00402 table = index->table; 00403 00404 clust_index = dict_table_get_first_index(table); 00405 00406 ref_len = dict_index_get_n_unique(clust_index); 00407 00408 ref = dtuple_create(heap, ref_len); 00409 00410 dict_index_copy_types(ref, clust_index, ref_len); 00411 00412 for (i = 0; i < ref_len; i++) { 00413 dfield = dtuple_get_nth_field(ref, i); 00414 00415 pos = dict_index_get_nth_field_pos(index, clust_index, i); 00416 00417 ut_a(pos != ULINT_UNDEFINED); 00418 00419 field = rec_get_nth_field(rec, offsets, pos, &len); 00420 00421 dfield_set_data(dfield, field, len); 00422 00423 /* If the primary key contains a column prefix, then the 00424 secondary index may contain a longer prefix of the same 00425 column, or the full column, and we must adjust the length 00426 accordingly. */ 00427 00428 clust_col_prefix_len = 00429 dict_index_get_nth_field(clust_index, i)->prefix_len; 00430 00431 if (clust_col_prefix_len > 0) { 00432 if (len != UNIV_SQL_NULL) { 00433 00434 dfield_set_len(dfield, 00435 dtype_get_at_most_n_mbchars( 00436 dfield_get_type(dfield), 00437 clust_col_prefix_len, len, (char*) field)); 00438 } 00439 } 00440 } 00441 00442 ut_ad(dtuple_check_typed(ref)); 00443 if (tmp_heap) { 00444 mem_heap_free(tmp_heap); 00445 } 00446 00447 return(ref); 00448 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void row_build_row_ref_from_row | ( | dtuple_t * | ref, | |
| dict_table_t * | table, | |||
| dtuple_t * | row | |||
| ) |
Definition at line 549 of file row0row.c.
References dfield_struct::data, dfield_copy(), dict_col_get_no(), dict_col_get_type(), dict_field_get_col(), dict_index_get_n_unique(), dict_index_get_nth_field(), dict_table_get_first_index(), dtuple_check_typed(), dtuple_get_n_fields(), dtuple_get_nth_field(), dtype_get_at_most_n_mbchars(), dfield_struct::len, dict_field_struct::prefix_len, and ut_ad.
00551 : row reference built; see the 00552 NOTE below! ref must have the right number 00553 of fields! */ 00554 dict_table_t* table, /* in: table */ 00555 dtuple_t* row) /* in: row 00556 NOTE: the data fields in ref will point 00557 directly into data of this row */ 00558 { 00559 dict_index_t* clust_index; 00560 dict_field_t* field; 00561 dfield_t* dfield; 00562 dfield_t* dfield2; 00563 dict_col_t* col; 00564 ulint ref_len; 00565 ulint i; 00566 dtype_t* cur_type; 00567 00568 ut_ad(ref && table && row); 00569 00570 clust_index = dict_table_get_first_index(table); 00571 00572 ref_len = dict_index_get_n_unique(clust_index); 00573 00574 ut_ad(ref_len == dtuple_get_n_fields(ref)); 00575 00576 for (i = 0; i < ref_len; i++) { 00577 dfield = dtuple_get_nth_field(ref, i); 00578 00579 field = dict_index_get_nth_field(clust_index, i); 00580 00581 col = dict_field_get_col(field); 00582 00583 dfield2 = dtuple_get_nth_field(row, dict_col_get_no(col)); 00584 00585 dfield_copy(dfield, dfield2); 00586 00587 if (field->prefix_len > 0 00588 && dfield->len != UNIV_SQL_NULL) { 00589 00590 cur_type = dict_col_get_type( 00591 dict_field_get_col(field)); 00592 00593 dfield->len = dtype_get_at_most_n_mbchars( 00594 cur_type, 00595 field->prefix_len, 00596 dfield->len, dfield->data); 00597 } 00598 } 00599 00600 ut_ad(dtuple_check_typed(ref)); 00601 }
Here is the call graph for this function:

| void row_build_row_ref_in_tuple | ( | dtuple_t * | ref, | |
| dict_index_t * | index, | |||
| rec_t * | rec, | |||
| trx_t * | trx | |||
| ) |
Definition at line 455 of file row0row.c.
References dfield_get_type(), dfield_set_data(), dfield_set_len(), dict_index_copy_types(), dict_index_get_n_unique(), dict_index_get_nth_field(), dict_index_get_nth_field_pos(), dict_table_get_first_index(), dtuple_check_typed(), dtuple_get_n_fields(), dtuple_get_nth_field(), dtype_get_at_most_n_mbchars(), FALSE, index(), mem_heap_free, NULL, pos(), dict_field_struct::prefix_len, rec_get_nth_field(), rec_get_offsets, REC_OFFS_NORMAL_SIZE, TRUE, ut_a, ut_ad, ut_error, and ut_print_name().
Referenced by row_sel_get_clust_rec_for_mysql().
00457 : row reference built; see the 00458 NOTE below! */ 00459 dict_index_t* index, /* in: index */ 00460 rec_t* rec, /* in: record in the index; 00461 NOTE: the data fields in ref will point 00462 directly into this record, therefore, 00463 the buffer page of this record must be 00464 at least s-latched and the latch held 00465 as long as the row reference is used! */ 00466 trx_t* trx) /* in: transaction */ 00467 { 00468 dict_index_t* clust_index; 00469 dfield_t* dfield; 00470 byte* field; 00471 ulint len; 00472 ulint ref_len; 00473 ulint pos; 00474 ulint clust_col_prefix_len; 00475 ulint i; 00476 mem_heap_t* heap = NULL; 00477 ulint offsets_[REC_OFFS_NORMAL_SIZE]; 00478 ulint* offsets = offsets_; 00479 *offsets_ = (sizeof offsets_) / sizeof *offsets_; 00480 00481 ut_a(ref && index && rec); 00482 00483 if (UNIV_UNLIKELY(!index->table)) { 00484 fputs("InnoDB: table ", stderr); 00485 notfound: 00486 ut_print_name(stderr, trx, TRUE, index->table_name); 00487 fputs(" for index ", stderr); 00488 ut_print_name(stderr, trx, FALSE, index->name); 00489 fputs(" not found\n", stderr); 00490 ut_error; 00491 } 00492 00493 clust_index = dict_table_get_first_index(index->table); 00494 00495 if (!clust_index) { 00496 fputs("InnoDB: clust index for table ", stderr); 00497 goto notfound; 00498 } 00499 00500 offsets = rec_get_offsets(rec, index, offsets, ULINT_UNDEFINED, &heap); 00501 00502 ref_len = dict_index_get_n_unique(clust_index); 00503 00504 ut_ad(ref_len == dtuple_get_n_fields(ref)); 00505 00506 dict_index_copy_types(ref, clust_index, ref_len); 00507 00508 for (i = 0; i < ref_len; i++) { 00509 dfield = dtuple_get_nth_field(ref, i); 00510 00511 pos = dict_index_get_nth_field_pos(index, clust_index, i); 00512 00513 ut_a(pos != ULINT_UNDEFINED); 00514 00515 field = rec_get_nth_field(rec, offsets, pos, &len); 00516 00517 dfield_set_data(dfield, field, len); 00518 00519 /* If the primary key contains a column prefix, then the 00520 secondary index may contain a longer prefix of the same 00521 column, or the full column, and we must adjust the length 00522 accordingly. */ 00523 00524 clust_col_prefix_len = 00525 dict_index_get_nth_field(clust_index, i)->prefix_len; 00526 00527 if (clust_col_prefix_len > 0) { 00528 if (len != UNIV_SQL_NULL) { 00529 00530 dfield_set_len(dfield, 00531 dtype_get_at_most_n_mbchars( 00532 dfield_get_type(dfield), 00533 clust_col_prefix_len, len, (char*) field)); 00534 } 00535 } 00536 } 00537 00538 ut_ad(dtuple_check_typed(ref)); 00539 if (UNIV_LIKELY_NULL(heap)) { 00540 mem_heap_free(heap); 00541 } 00542 }
Here is the call graph for this function:

Here is the caller graph for this function:

| rec_t* row_get_clust_rec | ( | ulint | mode, | |
| rec_t * | rec, | |||
| dict_index_t * | index, | |||
| dict_index_t ** | clust_index, | |||
| mtr_t * | mtr | |||
| ) |
Definition at line 651 of file row0row.c.
References btr_pcur_close(), btr_pcur_get_rec(), DICT_CLUSTERED, dict_table_get_first_index(), index(), mem_heap_create, mem_heap_free, NULL, row_build_row_ref(), ROW_COPY_POINTERS, row_search_on_row_ref(), and ut_ad.
Referenced by row_vers_impl_x_locked_off_kernel().
00653 : record or NULL, if no record found */ 00654 ulint mode, /* in: BTR_MODIFY_LEAF, ... */ 00655 rec_t* rec, /* in: record in a secondary index */ 00656 dict_index_t* index, /* in: secondary index */ 00657 dict_index_t** clust_index,/* out: clustered index */ 00658 mtr_t* mtr) /* in: mtr */ 00659 { 00660 mem_heap_t* heap; 00661 dtuple_t* ref; 00662 dict_table_t* table; 00663 btr_pcur_t pcur; 00664 ibool found; 00665 rec_t* clust_rec; 00666 00667 ut_ad((index->type & DICT_CLUSTERED) == 0); 00668 00669 table = index->table; 00670 00671 heap = mem_heap_create(256); 00672 00673 ref = row_build_row_ref(ROW_COPY_POINTERS, index, rec, heap); 00674 00675 found = row_search_on_row_ref(&pcur, mode, table, ref, mtr); 00676 00677 clust_rec = found ? btr_pcur_get_rec(&pcur) : NULL; 00678 00679 mem_heap_free(heap); 00680 00681 btr_pcur_close(&pcur); 00682 00683 *clust_index = dict_table_get_first_index(table); 00684 00685 return(clust_rec); 00686 }
Here is the call graph for this function:

Here is the caller graph for this function:

| UNIV_INLINE dulint row_get_rec_roll_ptr | ( | rec_t * | rec, | |
| dict_index_t * | index, | |||
| const ulint * | offsets | |||
| ) |
Referenced by row_purge_remove_clust_if_poss_low(), row_undo_search_clust_to_pcur(), row_vers_build_for_consistent_read(), and trx_undo_prev_version_build().
Here is the caller graph for this function:

| UNIV_INLINE dulint row_get_rec_trx_id | ( | rec_t * | rec, | |
| dict_index_t * | index, | |||
| const ulint * | offsets | |||
| ) |
Referenced by lock_clust_rec_cons_read_sees(), row_vers_build_for_consistent_read(), row_vers_build_for_semi_consistent_read(), row_vers_impl_x_locked_off_kernel(), and trx_undo_prev_version_build().
Here is the caller graph for this function:

| dtuple_t* row_rec_to_index_entry | ( | ulint | type, | |
| dict_index_t * | index, | |||
| rec_t * | rec, | |||
| mem_heap_t * | heap | |||
| ) |
Definition at line 274 of file row0row.c.
References buf, dfield_set_data(), dict_index_copy_types(), dict_index_get_n_fields(), dict_index_get_n_unique_in_tree(), dtuple_check_typed(), dtuple_create(), dtuple_get_nth_field(), dtuple_set_info_bits(), dtuple_set_n_fields_cmp(), index(), mem_heap_alloc(), mem_heap_free, NULL, rec_copy(), rec_get_info_bits(), rec_get_nth_field(), rec_get_offsets, rec_offs_comp(), rec_offs_make_valid(), rec_offs_n_fields(), REC_OFFS_NORMAL_SIZE, rec_offs_size(), ROW_COPY_DATA, and ut_ad.
Referenced by btr_cur_optimistic_update(), btr_cur_pessimistic_update(), row_scan_and_check_index(), row_upd_check_references_constraints(), and trx_undo_prev_version_build().
00276 : index entry built; see the 00277 NOTE below! */ 00278 ulint type, /* in: ROW_COPY_DATA, or ROW_COPY_POINTERS: 00279 the former copies also the data fields to 00280 heap as the latter only places pointers to 00281 data fields on the index page */ 00282 dict_index_t* index, /* in: index */ 00283 rec_t* rec, /* in: record in the index; 00284 NOTE: in the case ROW_COPY_POINTERS 00285 the data fields in the row will point 00286 directly into this record, therefore, 00287 the buffer page of this record must be 00288 at least s-latched and the latch held 00289 as long as the dtuple is used! */ 00290 mem_heap_t* heap) /* in: memory heap from which the memory 00291 needed is allocated */ 00292 { 00293 dtuple_t* entry; 00294 dfield_t* dfield; 00295 ulint i; 00296 byte* field; 00297 ulint len; 00298 ulint rec_len; 00299 byte* buf; 00300 mem_heap_t* tmp_heap = NULL; 00301 ulint offsets_[REC_OFFS_NORMAL_SIZE]; 00302 ulint* offsets = offsets_; 00303 *offsets_ = (sizeof offsets_) / sizeof *offsets_; 00304 00305 ut_ad(rec && heap && index); 00306 00307 offsets = rec_get_offsets(rec, index, offsets, 00308 ULINT_UNDEFINED, &tmp_heap); 00309 00310 if (type == ROW_COPY_DATA) { 00311 /* Take a copy of rec to heap */ 00312 buf = mem_heap_alloc(heap, rec_offs_size(offsets)); 00313 rec = rec_copy(buf, rec, offsets); 00314 /* Avoid a debug assertion in rec_offs_validate(). */ 00315 rec_offs_make_valid(rec, index, offsets); 00316 } 00317 00318 rec_len = rec_offs_n_fields(offsets); 00319 00320 entry = dtuple_create(heap, rec_len); 00321 00322 dtuple_set_n_fields_cmp(entry, 00323 dict_index_get_n_unique_in_tree(index)); 00324 ut_ad(rec_len == dict_index_get_n_fields(index)); 00325 00326 dict_index_copy_types(entry, index, rec_len); 00327 00328 dtuple_set_info_bits(entry, 00329 rec_get_info_bits(rec, rec_offs_comp(offsets))); 00330 00331 for (i = 0; i < rec_len; i++) { 00332 00333 dfield = dtuple_get_nth_field(entry, i); 00334 field = rec_get_nth_field(rec, offsets, i, &len); 00335 00336 dfield_set_data(dfield, field, len); 00337 } 00338 00339 ut_ad(dtuple_check_typed(entry)); 00340 if (tmp_heap) { 00341 mem_heap_free(tmp_heap); 00342 } 00343 00344 return(entry); 00345 }
Here is the call graph for this function:

Here is the caller graph for this function:

| ibool row_search_index_entry | ( | dict_index_t * | index, | |
| dtuple_t * | entry, | |||
| ulint | mode, | |||
| btr_pcur_t * | pcur, | |||
| mtr_t * | mtr | |||
| ) |
Definition at line 692 of file row0row.c.
References btr_pcur_get_low_match(), btr_pcur_get_rec(), btr_pcur_open(), dtuple_check_typed(), dtuple_get_n_fields(), FALSE, index(), PAGE_CUR_LE, page_rec_is_infimum(), TRUE, and ut_ad.
Referenced by row_purge_remove_sec_if_poss_low(), row_undo_ins_remove_sec_low(), row_undo_mod_del_mark_or_remove_sec_low(), row_undo_mod_del_unmark_sec_and_undo_update(), and row_upd_sec_index_entry().
00694 : TRUE if found */ 00695 dict_index_t* index, /* in: index */ 00696 dtuple_t* entry, /* in: index entry */ 00697 ulint mode, /* in: BTR_MODIFY_LEAF, ... */ 00698 btr_pcur_t* pcur, /* in/out: persistent cursor, which must 00699 be closed by the caller */ 00700 mtr_t* mtr) /* in: mtr */ 00701 { 00702 ulint n_fields; 00703 ulint low_match; 00704 rec_t* rec; 00705 00706 ut_ad(dtuple_check_typed(entry)); 00707 00708 btr_pcur_open(index, entry, PAGE_CUR_LE, mode, pcur, mtr); 00709 low_match = btr_pcur_get_low_match(pcur); 00710 00711 rec = btr_pcur_get_rec(pcur); 00712 00713 n_fields = dtuple_get_n_fields(entry); 00714 00715 if (page_rec_is_infimum(rec)) { 00716 00717 return(FALSE); 00718 } 00719 00720 if (low_match != n_fields) { 00721 /* Not found */ 00722 00723 return(FALSE); 00724 } 00725 00726 return(TRUE); 00727 }
Here is the call graph for this function:

Here is the caller graph for this function:

| ibool row_search_on_row_ref | ( | btr_pcur_t * | pcur, | |
| ulint | mode, | |||
| dict_table_t * | table, | |||
| dtuple_t * | ref, | |||
| mtr_t * | mtr | |||
| ) |
Definition at line 607 of file row0row.c.
References btr_pcur_get_low_match(), btr_pcur_get_rec(), btr_pcur_open(), dict_index_get_n_unique(), dict_table_get_first_index(), dtuple_check_typed(), dtuple_get_n_fields(), FALSE, index(), PAGE_CUR_LE, page_rec_is_infimum(), TRUE, ut_a, and ut_ad.
Referenced by row_get_clust_rec(), row_purge_reposition_pcur(), and row_undo_search_clust_to_pcur().
00609 : TRUE if found */ 00610 btr_pcur_t* pcur, /* in/out: persistent cursor, which must 00611 be closed by the caller */ 00612 ulint mode, /* in: BTR_MODIFY_LEAF, ... */ 00613 dict_table_t* table, /* in: table */ 00614 dtuple_t* ref, /* in: row reference */ 00615 mtr_t* mtr) /* in: mtr */ 00616 { 00617 ulint low_match; 00618 rec_t* rec; 00619 dict_index_t* index; 00620 00621 ut_ad(dtuple_check_typed(ref)); 00622 00623 index = dict_table_get_first_index(table); 00624 00625 ut_a(dtuple_get_n_fields(ref) == dict_index_get_n_unique(index)); 00626 00627 btr_pcur_open(index, ref, PAGE_CUR_LE, mode, pcur, mtr); 00628 00629 low_match = btr_pcur_get_low_match(pcur); 00630 00631 rec = btr_pcur_get_rec(pcur); 00632 00633 if (page_rec_is_infimum(rec)) { 00634 00635 return(FALSE); 00636 } 00637 00638 if (low_match != dtuple_get_n_fields(ref)) { 00639 00640 return(FALSE); 00641 } 00642 00643 return(TRUE); 00644 }
Here is the call graph for this function:

Here is the caller graph for this function:

| UNIV_INLINE void row_set_rec_roll_ptr | ( | rec_t * | rec, | |
| dict_index_t * | index, | |||
| const ulint * | offsets, | |||
| dulint | roll_ptr | |||
| ) |
| UNIV_INLINE void row_set_rec_trx_id | ( | rec_t * | rec, | |
| dict_index_t * | index, | |||
| const ulint * | offsets, | |||
| dulint | trx_id | |||
| ) |
1.4.7

