#include "univ.i"#include "page0types.h"#include "page0page.h"#include "rem0rec.h"#include "data0data.h"#include "mtr0mtr.h"Include dependency graph for page0cur.h:

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

Go to the source code of this file.
| #define PAGE_CUR_ADAPT |
Definition at line 21 of file page0cur.h.
| #define PAGE_CUR_G 1 |
Definition at line 25 of file page0cur.h.
Referenced by btr_cur_search_to_nth_level(), btr_pcur_open_on_user_rec(), btr_pcur_restore_position(), btr_search_check_guess(), opt_op_to_search_mode(), page_cur_search_with_match(), row_scan_and_check_index(), and row_search_for_mysql().
| #define PAGE_CUR_GE 2 |
Definition at line 26 of file page0cur.h.
Referenced by btr_cur_search_to_nth_level(), btr_pcur_open_on_user_rec(), btr_search_check_guess(), btr_search_guess_on_hash(), dict_get_first_table_name_in_db(), dict_load_columns(), dict_load_fields(), dict_load_foreign(), dict_load_foreign_cols(), dict_load_foreigns(), dict_load_indexes(), dict_load_table(), dict_load_table_on_id(), ibuf_delete_for_discarded_space(), ibuf_merge_or_delete_for_page(), opt_op_to_search_mode(), page_cur_search_with_match(), row_ins_scan_sec_index_for_duplicate(), row_search_for_mysql(), row_sel(), row_sel_try_search_shortcut(), row_sel_try_search_shortcut_for_mysql(), and row_truncate_table_for_mysql().
| #define PAGE_CUR_L 3 |
Definition at line 27 of file page0cur.h.
Referenced by btr_cur_search_to_nth_level(), btr_pcur_open_on_user_rec(), btr_pcur_restore_position(), btr_search_check_guess(), dict_create_index_tree_step(), opt_op_to_search_mode(), page_cur_search_with_match(), and row_search_for_mysql().
| #define PAGE_CUR_LE 4 |
Definition at line 28 of file page0cur.h.
Referenced by btr_cur_insert_if_possible(), btr_cur_optimistic_insert(), btr_cur_search_to_nth_level(), btr_insert_on_non_leaf_level(), btr_page_get_father_for_rec(), btr_page_split_and_insert(), btr_pcur_open_on_user_rec(), btr_pcur_restore_position(), btr_root_raise_and_insert(), btr_search_check_guess(), ibuf_insert_low(), ibuf_insert_to_index_page(), opt_op_to_search_mode(), page_cur_search_with_match(), row_ins_foreign_check_on_constraint(), row_ins_index_entry_low(), row_search_index_entry(), row_search_on_row_ref(), row_sel_get_clust_rec(), and row_sel_get_clust_rec_for_mysql().
| void page_copy_rec_list_end_to_created_page | ( | page_t * | new_page, | |
| page_t * | page, | |||
| rec_t * | rec, | |||
| dict_index_t * | index, | |||
| mtr_t * | mtr | |||
| ) |
Definition at line 1089 of file page0cur.c.
References count, dyn_array_get_data_size(), index(), mtr_struct::log, mach_write_to_4(), mem_heap_free, MTR_LOG_SHORT_INSERTS, mtr_set_log_mode(), NULL, page_copy_rec_list_to_created_page_write_log(), page_cur_insert_rec_write_log(), page_dir_get_n_heap(), page_dir_get_nth_slot(), page_dir_set_n_heap(), page_dir_set_n_slots(), PAGE_DIR_SLOT_MAX_N_OWNED, page_dir_slot_set_n_owned(), page_dir_slot_set_rec(), PAGE_DIRECTION, page_get_infimum_rec(), page_get_supremum_rec(), page_header_set_field(), page_header_set_ptr(), PAGE_HEAP_TOP, page_is_comp(), PAGE_LAST_INSERT, PAGE_N_DIRECTION, PAGE_N_RECS, PAGE_NEW_SUPREMUM, PAGE_NEW_SUPREMUM_END, PAGE_NO_DIRECTION, PAGE_OLD_SUPREMUM, PAGE_OLD_SUPREMUM_END, page_rec_get_next(), rec_copy(), rec_get_offsets, REC_OFFS_NORMAL_SIZE, rec_offs_size(), rec_set_heap_no(), rec_set_n_owned(), rec_set_next_offs(), UNIV_PAGE_SIZE, ut_a, and ut_ad.
Referenced by page_copy_rec_list_end().
01091 : index page to copy to */ 01092 page_t* page, /* in: index page */ 01093 rec_t* rec, /* in: first record to copy */ 01094 dict_index_t* index, /* in: record descriptor */ 01095 mtr_t* mtr) /* in: mtr */ 01096 { 01097 page_dir_slot_t* slot = 0; /* remove warning */ 01098 byte* heap_top; 01099 rec_t* insert_rec = 0; /* remove warning */ 01100 rec_t* prev_rec; 01101 ulint count; 01102 ulint n_recs; 01103 ulint slot_index; 01104 ulint rec_size; 01105 ulint log_mode; 01106 byte* log_ptr; 01107 ulint log_data_len; 01108 ulint comp = page_is_comp(page); 01109 mem_heap_t* heap = NULL; 01110 ulint offsets_[REC_OFFS_NORMAL_SIZE]; 01111 ulint* offsets = offsets_; 01112 *offsets_ = (sizeof offsets_) / sizeof *offsets_; 01113 01114 ut_ad(page_dir_get_n_heap(new_page) == 2); 01115 ut_ad(page != new_page); 01116 ut_ad(comp == page_is_comp(new_page)); 01117 01118 if (rec == page_get_infimum_rec(page)) { 01119 01120 rec = page_rec_get_next(rec); 01121 } 01122 01123 if (rec == page_get_supremum_rec(page)) { 01124 01125 return; 01126 } 01127 01128 #ifdef UNIV_DEBUG 01129 /* To pass the debug tests we have to set these dummy values 01130 in the debug version */ 01131 page_dir_set_n_slots(new_page, UNIV_PAGE_SIZE / 2); 01132 page_header_set_ptr(new_page, PAGE_HEAP_TOP, 01133 new_page + UNIV_PAGE_SIZE - 1); 01134 #endif 01135 01136 log_ptr = page_copy_rec_list_to_created_page_write_log(new_page, 01137 index, mtr); 01138 01139 log_data_len = dyn_array_get_data_size(&(mtr->log)); 01140 01141 /* Individual inserts are logged in a shorter form */ 01142 01143 log_mode = mtr_set_log_mode(mtr, MTR_LOG_SHORT_INSERTS); 01144 01145 prev_rec = page_get_infimum_rec(new_page); 01146 if (comp) { 01147 heap_top = new_page + PAGE_NEW_SUPREMUM_END; 01148 } else { 01149 heap_top = new_page + PAGE_OLD_SUPREMUM_END; 01150 } 01151 count = 0; 01152 slot_index = 0; 01153 n_recs = 0; 01154 01155 /* should be do ... until, comment by Jani */ 01156 while (rec != page_get_supremum_rec(page)) { 01157 offsets = rec_get_offsets(rec, index, offsets, 01158 ULINT_UNDEFINED, &heap); 01159 insert_rec = rec_copy(heap_top, rec, offsets); 01160 01161 rec_set_next_offs(prev_rec, comp, insert_rec - new_page); 01162 01163 rec_set_n_owned(insert_rec, comp, 0); 01164 rec_set_heap_no(insert_rec, comp, 2 + n_recs); 01165 01166 rec_size = rec_offs_size(offsets); 01167 01168 heap_top = heap_top + rec_size; 01169 01170 ut_ad(heap_top < new_page + UNIV_PAGE_SIZE); 01171 01172 count++; 01173 n_recs++; 01174 01175 if (count == (PAGE_DIR_SLOT_MAX_N_OWNED + 1) / 2) { 01176 01177 slot_index++; 01178 01179 slot = page_dir_get_nth_slot(new_page, slot_index); 01180 01181 page_dir_slot_set_rec(slot, insert_rec); 01182 page_dir_slot_set_n_owned(slot, count); 01183 01184 count = 0; 01185 } 01186 01187 page_cur_insert_rec_write_log(insert_rec, rec_size, prev_rec, 01188 index, mtr); 01189 prev_rec = insert_rec; 01190 rec = page_rec_get_next(rec); 01191 } 01192 01193 if ((slot_index > 0) && (count + 1 01194 + (PAGE_DIR_SLOT_MAX_N_OWNED + 1) / 2 01195 <= PAGE_DIR_SLOT_MAX_N_OWNED)) { 01196 /* We can merge the two last dir slots. This operation is 01197 here to make this function imitate exactly the equivalent 01198 task made using page_cur_insert_rec, which we use in database 01199 recovery to reproduce the task performed by this function. 01200 To be able to check the correctness of recovery, it is good 01201 that it imitates exactly. */ 01202 01203 count += (PAGE_DIR_SLOT_MAX_N_OWNED + 1) / 2; 01204 01205 page_dir_slot_set_n_owned(slot, 0); 01206 01207 slot_index--; 01208 } 01209 01210 if (UNIV_LIKELY_NULL(heap)) { 01211 mem_heap_free(heap); 01212 } 01213 01214 log_data_len = dyn_array_get_data_size(&(mtr->log)) - log_data_len; 01215 01216 ut_a(log_data_len < 100 * UNIV_PAGE_SIZE); 01217 01218 mach_write_to_4(log_ptr, log_data_len); 01219 01220 rec_set_next_offs(insert_rec, comp, 01221 comp ? PAGE_NEW_SUPREMUM : PAGE_OLD_SUPREMUM); 01222 01223 slot = page_dir_get_nth_slot(new_page, 1 + slot_index); 01224 01225 page_dir_slot_set_rec(slot, page_get_supremum_rec(new_page)); 01226 page_dir_slot_set_n_owned(slot, count + 1); 01227 01228 page_dir_set_n_slots(new_page, 2 + slot_index); 01229 page_header_set_ptr(new_page, PAGE_HEAP_TOP, heap_top); 01230 page_dir_set_n_heap(new_page, 2 + n_recs); 01231 page_header_set_field(new_page, PAGE_N_RECS, n_recs); 01232 01233 page_header_set_ptr(new_page, PAGE_LAST_INSERT, NULL); 01234 page_header_set_field(new_page, PAGE_DIRECTION, PAGE_NO_DIRECTION); 01235 page_header_set_field(new_page, PAGE_N_DIRECTION, 0); 01236 01237 /* Restore the log mode */ 01238 01239 mtr_set_log_mode(mtr, log_mode); 01240 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void page_cur_delete_rec | ( | page_cur_t * | cursor, | |
| dict_index_t * | index, | |||
| const ulint * | offsets, | |||
| mtr_t * | mtr | |||
| ) |
Definition at line 1324 of file page0cur.c.
References buf_frame_modify_clock_inc(), dict_table_is_comp(), index(), NULL, page, page_cur_delete_rec_write_log(), page_cur_get_page(), page_cur_move_to_next(), page_dir_balance_slot(), page_dir_find_owner_slot(), page_dir_get_nth_slot(), page_dir_slot_get_n_owned(), page_dir_slot_get_rec(), PAGE_DIR_SLOT_MIN_N_OWNED, page_dir_slot_set_n_owned(), page_dir_slot_set_rec(), page_get_infimum_rec(), page_get_n_recs(), page_get_supremum_rec(), page_header_set_field(), page_header_set_ptr(), page_is_comp(), PAGE_LAST_INSERT, page_mem_free(), PAGE_N_RECS, page_rec_get_next(), page_rec_set_next(), page_t, page_cur_struct::rec, rec_offs_validate(), and ut_ad.
Referenced by btr_cur_optimistic_delete(), btr_cur_optimistic_update(), btr_cur_pessimistic_delete(), btr_cur_pessimistic_update(), page_cur_parse_delete_rec(), and page_delete_rec_list_start().
01326 : a page cursor */ 01327 dict_index_t* index, /* in: record descriptor */ 01328 const ulint* offsets,/* in: rec_get_offsets(cursor->rec, index) */ 01329 mtr_t* mtr) /* in: mini-transaction handle */ 01330 { 01331 page_dir_slot_t* cur_dir_slot; 01332 page_dir_slot_t* prev_slot; 01333 page_t* page; 01334 rec_t* current_rec; 01335 rec_t* prev_rec = NULL; 01336 rec_t* next_rec; 01337 ulint cur_slot_no; 01338 ulint cur_n_owned; 01339 rec_t* rec; 01340 01341 ut_ad(cursor && mtr); 01342 01343 page = page_cur_get_page(cursor); 01344 current_rec = cursor->rec; 01345 ut_ad(rec_offs_validate(current_rec, index, offsets)); 01346 ut_ad(!!page_is_comp(page) == dict_table_is_comp(index->table)); 01347 01348 /* The record must not be the supremum or infimum record. */ 01349 ut_ad(current_rec != page_get_supremum_rec(page)); 01350 ut_ad(current_rec != page_get_infimum_rec(page)); 01351 01352 /* Save to local variables some data associated with current_rec */ 01353 cur_slot_no = page_dir_find_owner_slot(current_rec); 01354 cur_dir_slot = page_dir_get_nth_slot(page, cur_slot_no); 01355 cur_n_owned = page_dir_slot_get_n_owned(cur_dir_slot); 01356 01357 /* 0. Write the log record */ 01358 page_cur_delete_rec_write_log(current_rec, index, mtr); 01359 01360 /* 1. Reset the last insert info in the page header and increment 01361 the modify clock for the frame */ 01362 01363 page_header_set_ptr(page, PAGE_LAST_INSERT, NULL); 01364 01365 /* The page gets invalid for optimistic searches: increment the 01366 frame modify clock */ 01367 01368 buf_frame_modify_clock_inc(page); 01369 01370 /* 2. Find the next and the previous record. Note that the cursor is 01371 left at the next record. */ 01372 01373 ut_ad(cur_slot_no > 0); 01374 prev_slot = page_dir_get_nth_slot(page, cur_slot_no - 1); 01375 01376 rec = page_dir_slot_get_rec(prev_slot); 01377 01378 /* rec now points to the record of the previous directory slot. Look 01379 for the immediate predecessor of current_rec in a loop. */ 01380 01381 while(current_rec != rec) { 01382 prev_rec = rec; 01383 rec = page_rec_get_next(rec); 01384 } 01385 01386 page_cur_move_to_next(cursor); 01387 next_rec = cursor->rec; 01388 01389 /* 3. Remove the record from the linked list of records */ 01390 01391 page_rec_set_next(prev_rec, next_rec); 01392 page_header_set_field(page, PAGE_N_RECS, 01393 (ulint)(page_get_n_recs(page) - 1)); 01394 01395 /* 4. If the deleted record is pointed to by a dir slot, update the 01396 record pointer in slot. In the following if-clause we assume that 01397 prev_rec is owned by the same slot, i.e., PAGE_DIR_SLOT_MIN_N_OWNED 01398 >= 2. */ 01399 01400 #if PAGE_DIR_SLOT_MIN_N_OWNED < 2 01401 # error "PAGE_DIR_SLOT_MIN_N_OWNED < 2" 01402 #endif 01403 ut_ad(cur_n_owned > 1); 01404 01405 if (current_rec == page_dir_slot_get_rec(cur_dir_slot)) { 01406 page_dir_slot_set_rec(cur_dir_slot, prev_rec); 01407 } 01408 01409 /* 5. Update the number of owned records of the slot */ 01410 01411 page_dir_slot_set_n_owned(cur_dir_slot, cur_n_owned - 1); 01412 01413 /* 6. Free the memory occupied by the record */ 01414 page_mem_free(page, current_rec, offsets); 01415 01416 /* 7. Now we have decremented the number of owned records of the slot. 01417 If the number drops below PAGE_DIR_SLOT_MIN_N_OWNED, we balance the 01418 slots. */ 01419 01420 if (cur_n_owned <= PAGE_DIR_SLOT_MIN_N_OWNED) { 01421 page_dir_balance_slot(page, cur_slot_no); 01422 } 01423 }
Here is the call graph for this function:

Here is the caller graph for this function:

| UNIV_INLINE page_t* page_cur_get_page | ( | page_cur_t * | cur | ) |
Referenced by btr_cur_search_to_nth_level(), page_cur_delete_rec(), and page_cur_insert_rec_low().
Here is the caller graph for this function:

| UNIV_INLINE rec_t* page_cur_get_rec | ( | page_cur_t * | cur | ) |
Referenced by btr_cur_open_at_index_side(), btr_cur_open_at_rnd_pos(), btr_cur_search_to_nth_level(), btr_pcur_store_position(), btr_validate_level(), ibuf_insert_to_index_page(), lock_move_rec_list_end(), lock_move_rec_list_start(), lock_move_reorganize_page(), page_copy_rec_list_end_no_locks(), page_copy_rec_list_start(), and page_delete_rec_list_start().
Here is the caller graph for this function:

| rec_t* page_cur_insert_rec_low | ( | page_cur_t * | cursor, | |
| dtuple_t * | tuple, | |||
| dict_index_t * | index, | |||
| rec_t * | rec, | |||
| ulint * | offsets, | |||
| mtr_t * | mtr | |||
| ) |
Definition at line 857 of file page0cur.c.
References dict_table_is_comp(), dtuple_check_typed(), index(), mem_heap_free, NULL, page, page_cur_get_page(), page_cur_insert_rec_write_log(), page_dir_find_owner_slot(), PAGE_DIR_SLOT_MAX_N_OWNED, page_dir_split_slot(), PAGE_DIRECTION, page_get_n_recs(), page_get_supremum_rec(), page_header_get_field(), page_header_get_ptr(), page_header_set_field(), page_header_set_ptr(), page_is_comp(), PAGE_LAST_INSERT, PAGE_LEFT, page_mem_alloc(), PAGE_N_DIRECTION, PAGE_N_RECS, PAGE_NO_DIRECTION, page_rec_find_owner_rec(), page_rec_get_next(), page_rec_set_next(), PAGE_RIGHT, page_cur_struct::rec, rec_convert_dtuple_to_rec(), rec_copy(), rec_get_converted_size(), rec_get_n_owned(), rec_get_node_ptr_flag(), rec_get_offsets, rec_get_status(), rec_offs_make_valid(), rec_offs_size(), rec_offs_validate(), rec_set_heap_no(), rec_set_n_owned(), REC_STATUS_INFIMUM, and ut_ad.
Referenced by btr_cur_optimistic_insert().
00859 : pointer to record if succeed, NULL 00860 otherwise */ 00861 page_cur_t* cursor, /* in: a page cursor */ 00862 dtuple_t* tuple, /* in: pointer to a data tuple or NULL */ 00863 dict_index_t* index, /* in: record descriptor */ 00864 rec_t* rec, /* in: pointer to a physical record or NULL */ 00865 ulint* offsets,/* in: rec_get_offsets(rec, index) or NULL */ 00866 mtr_t* mtr) /* in: mini-transaction handle */ 00867 { 00868 byte* insert_buf = NULL; 00869 ulint rec_size; 00870 byte* page; /* the relevant page */ 00871 rec_t* last_insert; /* cursor position at previous insert */ 00872 rec_t* insert_rec; /* inserted record */ 00873 ulint heap_no; /* heap number of the inserted record */ 00874 rec_t* current_rec; /* current record after which the 00875 new record is inserted */ 00876 rec_t* next_rec; /* next record after current before 00877 the insertion */ 00878 ulint owner_slot; /* the slot which owns the 00879 inserted record */ 00880 rec_t* owner_rec; 00881 ulint n_owned; 00882 mem_heap_t* heap = NULL; 00883 ulint comp; 00884 00885 ut_ad(cursor && mtr); 00886 ut_ad(tuple || rec); 00887 ut_ad(!(tuple && rec)); 00888 ut_ad(rec || dtuple_check_typed(tuple)); 00889 00890 page = page_cur_get_page(cursor); 00891 comp = page_is_comp(page); 00892 ut_ad(dict_table_is_comp(index->table) == !!comp); 00893 00894 ut_ad(cursor->rec != page_get_supremum_rec(page)); 00895 00896 /* 1. Get the size of the physical record in the page */ 00897 if (tuple != NULL) { 00898 rec_size = rec_get_converted_size(index, tuple); 00899 } else { 00900 if (!offsets) { 00901 offsets = rec_get_offsets(rec, index, offsets, 00902 ULINT_UNDEFINED, &heap); 00903 } 00904 ut_ad(rec_offs_validate(rec, index, offsets)); 00905 rec_size = rec_offs_size(offsets); 00906 } 00907 00908 /* 2. Try to find suitable space from page memory management */ 00909 insert_buf = page_mem_alloc(page, rec_size, index, &heap_no); 00910 00911 if (insert_buf == NULL) { 00912 if (UNIV_LIKELY_NULL(heap)) { 00913 mem_heap_free(heap); 00914 } 00915 return(NULL); 00916 } 00917 00918 /* 3. Create the record */ 00919 if (tuple != NULL) { 00920 insert_rec = rec_convert_dtuple_to_rec(insert_buf, 00921 index, tuple); 00922 offsets = rec_get_offsets(insert_rec, index, offsets, 00923 ULINT_UNDEFINED, &heap); 00924 } else { 00925 insert_rec = rec_copy(insert_buf, rec, offsets); 00926 ut_ad(rec_offs_validate(rec, index, offsets)); 00927 rec_offs_make_valid(insert_rec, index, offsets); 00928 } 00929 00930 ut_ad(insert_rec); 00931 ut_ad(rec_size == rec_offs_size(offsets)); 00932 00933 /* 4. Insert the record in the linked list of records */ 00934 current_rec = cursor->rec; 00935 00936 ut_ad(!comp || rec_get_status(current_rec) <= REC_STATUS_INFIMUM); 00937 ut_ad(!comp || rec_get_status(insert_rec) < REC_STATUS_INFIMUM); 00938 00939 next_rec = page_rec_get_next(current_rec); 00940 ut_ad(!comp || rec_get_status(next_rec) != REC_STATUS_INFIMUM); 00941 page_rec_set_next(insert_rec, next_rec); 00942 page_rec_set_next(current_rec, insert_rec); 00943 00944 page_header_set_field(page, PAGE_N_RECS, 1 + page_get_n_recs(page)); 00945 00946 /* 5. Set the n_owned field in the inserted record to zero, 00947 and set the heap_no field */ 00948 00949 rec_set_n_owned(insert_rec, comp, 0); 00950 rec_set_heap_no(insert_rec, comp, heap_no); 00951 00952 /* 6. Update the last insertion info in page header */ 00953 00954 last_insert = page_header_get_ptr(page, PAGE_LAST_INSERT); 00955 ut_ad(!last_insert || !comp 00956 || rec_get_node_ptr_flag(last_insert) 00957 == rec_get_node_ptr_flag(insert_rec)); 00958 00959 if (last_insert == NULL) { 00960 page_header_set_field(page, PAGE_DIRECTION, PAGE_NO_DIRECTION); 00961 page_header_set_field(page, PAGE_N_DIRECTION, 0); 00962 00963 } else if ((last_insert == current_rec) 00964 && (page_header_get_field(page, PAGE_DIRECTION) != PAGE_LEFT)) { 00965 00966 page_header_set_field(page, PAGE_DIRECTION, PAGE_RIGHT); 00967 page_header_set_field(page, PAGE_N_DIRECTION, 00968 page_header_get_field(page, PAGE_N_DIRECTION) + 1); 00969 00970 } else if ((page_rec_get_next(insert_rec) == last_insert) 00971 && (page_header_get_field(page, PAGE_DIRECTION) != PAGE_RIGHT)) { 00972 00973 page_header_set_field(page, PAGE_DIRECTION, PAGE_LEFT); 00974 page_header_set_field(page, PAGE_N_DIRECTION, 00975 page_header_get_field(page, PAGE_N_DIRECTION) + 1); 00976 } else { 00977 page_header_set_field(page, PAGE_DIRECTION, PAGE_NO_DIRECTION); 00978 page_header_set_field(page, PAGE_N_DIRECTION, 0); 00979 } 00980 00981 page_header_set_ptr(page, PAGE_LAST_INSERT, insert_rec); 00982 00983 /* 7. It remains to update the owner record. */ 00984 00985 owner_rec = page_rec_find_owner_rec(insert_rec); 00986 n_owned = rec_get_n_owned(owner_rec, comp); 00987 rec_set_n_owned(owner_rec, comp, n_owned + 1); 00988 00989 /* 8. Now we have incremented the n_owned field of the owner 00990 record. If the number exceeds PAGE_DIR_SLOT_MAX_N_OWNED, 00991 we have to split the corresponding directory slot in two. */ 00992 00993 if (n_owned == PAGE_DIR_SLOT_MAX_N_OWNED) { 00994 owner_slot = page_dir_find_owner_slot(owner_rec); 00995 page_dir_split_slot(page, owner_slot); 00996 } 00997 00998 /* 9. Write log record of the insert */ 00999 page_cur_insert_rec_write_log(insert_rec, rec_size, current_rec, 01000 index, mtr); 01001 01002 if (UNIV_LIKELY_NULL(heap)) { 01003 mem_heap_free(heap); 01004 } 01005 return(insert_rec); 01006 }
Here is the call graph for this function:

Here is the caller graph for this function:

| UNIV_INLINE void page_cur_invalidate | ( | page_cur_t * | cur | ) |
| UNIV_INLINE ibool page_cur_is_after_last | ( | const page_cur_t * | cur | ) |
Referenced by btr_index_page_validate(), page_find_rec_with_heap_no(), page_print_list(), page_simple_validate(), and page_validate().
Here is the caller graph for this function:

| UNIV_INLINE ibool page_cur_is_before_first | ( | const page_cur_t * | cur | ) |
Referenced by btr_cur_pessimistic_update(), lock_move_rec_list_end(), and page_copy_rec_list_end_no_locks().
Here is the caller graph for this function:

| UNIV_INLINE void page_cur_move_to_next | ( | page_cur_t * | cur | ) |
Referenced by btr_cur_open_at_index_side(), btr_cur_optimistic_update(), btr_index_page_validate(), btr_validate_level(), lock_move_rec_list_end(), lock_move_rec_list_start(), lock_move_reorganize_page(), page_copy_rec_list_end_no_locks(), page_copy_rec_list_start(), page_cur_delete_rec(), page_delete_rec_list_start(), page_find_rec_with_heap_no(), page_print_list(), page_simple_validate(), and page_validate().
Here is the caller graph for this function:

| UNIV_INLINE void page_cur_move_to_prev | ( | page_cur_t * | cur | ) |
Referenced by btr_cur_open_at_index_side(), btr_cur_optimistic_update(), btr_cur_pessimistic_update(), and page_copy_rec_list_start().
Here is the caller graph for this function:

| void page_cur_open_on_rnd_user_rec | ( | page_t * | page, | |
| page_cur_t * | cursor | |||
| ) |
Definition at line 477 of file page0cur.c.
References page_cur_position(), page_get_infimum_rec(), page_get_n_recs(), page_rec_get_next(), page_rnd, and rnd.
Referenced by btr_cur_open_at_rnd_pos().
00479 : page */ 00480 page_cur_t* cursor) /* in/out: page cursor */ 00481 { 00482 ulint rnd; 00483 rec_t* rec; 00484 00485 if (page_get_n_recs(page) == 0) { 00486 page_cur_position(page_get_infimum_rec(page), cursor); 00487 00488 return; 00489 } 00490 00491 page_rnd += 87584577; 00492 00493 rnd = page_rnd % page_get_n_recs(page); 00494 00495 rec = page_get_infimum_rec(page); 00496 00497 rec = page_rec_get_next(rec); 00498 00499 while (rnd > 0) { 00500 rec = page_rec_get_next(rec); 00501 00502 rnd--; 00503 } 00504 00505 page_cur_position(rec, cursor); 00506 }
Here is the call graph for this function:

Here is the caller graph for this function:

| byte* page_cur_parse_delete_rec | ( | byte * | ptr, | |
| byte * | end_ptr, | |||
| dict_index_t * | index, | |||
| page_t * | page, | |||
| mtr_t * | mtr | |||
| ) |
Definition at line 1277 of file page0cur.c.
References index(), mach_read_from_2(), mem_heap_free, NULL, offset, page_cur_delete_rec(), page_cur_position(), rec_get_offsets, REC_OFFS_NORMAL_SIZE, UNIV_PAGE_SIZE, and ut_a.
Referenced by recv_parse_or_apply_log_rec_body().
01279 : pointer to record end or NULL */ 01280 byte* ptr, /* in: buffer */ 01281 byte* end_ptr,/* in: buffer end */ 01282 dict_index_t* index, /* in: record descriptor */ 01283 page_t* page, /* in: page or NULL */ 01284 mtr_t* mtr) /* in: mtr or NULL */ 01285 { 01286 ulint offset; 01287 page_cur_t cursor; 01288 01289 if (end_ptr < ptr + 2) { 01290 01291 return(NULL); 01292 } 01293 01294 /* Read the cursor rec offset as a 2-byte ulint */ 01295 offset = mach_read_from_2(ptr); 01296 ptr += 2; 01297 01298 ut_a(offset <= UNIV_PAGE_SIZE); 01299 01300 if (page) { 01301 mem_heap_t* heap = NULL; 01302 ulint offsets_[REC_OFFS_NORMAL_SIZE]; 01303 rec_t* rec = page + offset; 01304 *offsets_ = (sizeof offsets_) / sizeof *offsets_; 01305 01306 page_cur_position(rec, &cursor); 01307 01308 page_cur_delete_rec(&cursor, index, 01309 rec_get_offsets(rec, index, offsets_, 01310 ULINT_UNDEFINED, &heap), mtr); 01311 if (UNIV_LIKELY_NULL(heap)) { 01312 mem_heap_free(heap); 01313 } 01314 } 01315 01316 return(ptr); 01317 }
Here is the call graph for this function:

Here is the caller graph for this function:

| byte* page_cur_parse_insert_rec | ( | ibool | is_short, | |
| byte * | ptr, | |||
| byte * | end_ptr, | |||
| dict_index_t * | index, | |||
| page_t * | page, | |||
| mtr_t * | mtr | |||
| ) |
Definition at line 675 of file page0cur.c.
References buf, buf_page_print(), dict_table_is_comp(), recv_sys_struct::found_corrupt_log, index(), mach_parse_compressed(), mach_read_from_1(), mach_read_from_2(), mem_alloc, mem_free, mem_heap_free, NULL, offset, page_cur_position(), page_cur_rec_insert(), page_get_supremum_rec(), page_is_comp(), page_rec_get_prev(), rec_get_info_and_status_bits(), rec_get_offsets, rec_get_start(), rec_offs_extra_size(), REC_OFFS_NORMAL_SIZE, rec_offs_size(), rec_set_info_and_status_bits(), recv_sys, TRUE, UNIV_PAGE_SIZE, ut_a, ut_ad, ut_error, ut_memcpy(), and ut_print_buf().
Referenced by page_parse_copy_rec_list_to_created_page(), and recv_parse_or_apply_log_rec_body().
00677 : end of log record or NULL */ 00678 ibool is_short,/* in: TRUE if short inserts */ 00679 byte* ptr, /* in: buffer */ 00680 byte* end_ptr,/* in: buffer end */ 00681 dict_index_t* index, /* in: record descriptor */ 00682 page_t* page, /* in: page or NULL */ 00683 mtr_t* mtr) /* in: mtr or NULL */ 00684 { 00685 ulint extra_info_yes; 00686 ulint offset = 0; /* remove warning */ 00687 ulint origin_offset; 00688 ulint end_seg_len; 00689 ulint mismatch_index; 00690 rec_t* cursor_rec; 00691 byte buf1[1024]; 00692 byte* buf; 00693 byte* ptr2 = ptr; 00694 ulint info_and_status_bits = 0; /* remove warning */ 00695 page_cur_t cursor; 00696 mem_heap_t* heap = NULL; 00697 ulint offsets_[REC_OFFS_NORMAL_SIZE]; 00698 ulint* offsets = offsets_; 00699 *offsets_ = (sizeof offsets_) / sizeof *offsets_; 00700 00701 if (!is_short) { 00702 /* Read the cursor rec offset as a 2-byte ulint */ 00703 00704 if (end_ptr < ptr + 2) { 00705 00706 return(NULL); 00707 } 00708 00709 offset = mach_read_from_2(ptr); 00710 00711 if (offset >= UNIV_PAGE_SIZE) { 00712 00713 recv_sys->found_corrupt_log = TRUE; 00714 00715 return(NULL); 00716 } 00717 00718 ptr += 2; 00719 } 00720 00721 ptr = mach_parse_compressed(ptr, end_ptr, &end_seg_len); 00722 00723 if (ptr == NULL) { 00724 00725 return(NULL); 00726 } 00727 00728 extra_info_yes = end_seg_len & 0x1UL; 00729 end_seg_len >>= 1; 00730 00731 if (end_seg_len >= UNIV_PAGE_SIZE) { 00732 recv_sys->found_corrupt_log = TRUE; 00733 00734 return(NULL); 00735 } 00736 00737 if (extra_info_yes) { 00738 /* Read the info bits */ 00739 00740 if (end_ptr < ptr + 1) { 00741 00742 return(NULL); 00743 } 00744 00745 info_and_status_bits = mach_read_from_1(ptr); 00746 ptr++; 00747 00748 ptr = mach_parse_compressed(ptr, end_ptr, &origin_offset); 00749 00750 if (ptr == NULL) { 00751 00752 return(NULL); 00753 } 00754 00755 ut_a(origin_offset < UNIV_PAGE_SIZE); 00756 00757 ptr = mach_parse_compressed(ptr, end_ptr, &mismatch_index); 00758 00759 if (ptr == NULL) { 00760 00761 return(NULL); 00762 } 00763 00764 ut_a(mismatch_index < UNIV_PAGE_SIZE); 00765 } 00766 00767 if (end_ptr < ptr + end_seg_len) { 00768 00769 return(NULL); 00770 } 00771 00772 if (page == NULL) { 00773 00774 return(ptr + end_seg_len); 00775 } 00776 00777 ut_ad(!!page_is_comp(page) == dict_table_is_comp(index->table)); 00778 00779 /* Read from the log the inserted index record end segment which 00780 differs from the cursor record */ 00781 00782 if (is_short) { 00783 cursor_rec = page_rec_get_prev(page_get_supremum_rec(page)); 00784 } else { 00785 cursor_rec = page + offset; 00786 } 00787 00788 offsets = rec_get_offsets(cursor_rec, index, offsets, 00789 ULINT_UNDEFINED, &heap); 00790 00791 if (extra_info_yes == 0) { 00792 info_and_status_bits = rec_get_info_and_status_bits( 00793 cursor_rec, page_is_comp(page)); 00794 origin_offset = rec_offs_extra_size(offsets); 00795 mismatch_index = rec_offs_size(offsets) - end_seg_len; 00796 } 00797 00798 if (mismatch_index + end_seg_len < sizeof buf1) { 00799 buf = buf1; 00800 } else { 00801 buf = mem_alloc(mismatch_index + end_seg_len); 00802 } 00803 00804 /* Build the inserted record to buf */ 00805 00806 if (mismatch_index >= UNIV_PAGE_SIZE) { 00807 fprintf(stderr, 00808 "Is short %lu, info_and_status_bits %lu, offset %lu, " 00809 "o_offset %lu\n" 00810 "mismatch index %lu, end_seg_len %lu\n" 00811 "parsed len %lu\n", 00812 (ulong) is_short, (ulong) info_and_status_bits, 00813 (ulong) offset, 00814 (ulong) origin_offset, 00815 (ulong) mismatch_index, (ulong) end_seg_len, 00816 (ulong) (ptr - ptr2)); 00817 00818 fputs("Dump of 300 bytes of log:\n", stderr); 00819 ut_print_buf(stderr, ptr2, 300); 00820 00821 buf_page_print(page); 00822 00823 ut_error; 00824 } 00825 00826 ut_memcpy(buf, rec_get_start(cursor_rec, offsets), mismatch_index); 00827 ut_memcpy(buf + mismatch_index, ptr, end_seg_len); 00828 00829 rec_set_info_and_status_bits(buf + origin_offset, page_is_comp(page), 00830 info_and_status_bits); 00831 00832 page_cur_position(cursor_rec, &cursor); 00833 00834 offsets = rec_get_offsets(buf + origin_offset, index, offsets, 00835 ULINT_UNDEFINED, &heap); 00836 page_cur_rec_insert(&cursor, buf + origin_offset, index, offsets, mtr); 00837 00838 if (buf != buf1) { 00839 00840 mem_free(buf); 00841 } 00842 00843 if (UNIV_LIKELY_NULL(heap)) { 00844 mem_heap_free(heap); 00845 } 00846 00847 return(ptr + end_seg_len); 00848 }
Here is the call graph for this function:

Here is the caller graph for this function:

| UNIV_INLINE void page_cur_position | ( | rec_t * | rec, | |
| page_cur_t * | cur | |||
| ) |
Referenced by lock_move_rec_list_end(), lock_move_rec_list_start(), page_copy_rec_list_end_no_locks(), page_cur_open_on_rnd_user_rec(), page_cur_parse_delete_rec(), and page_cur_parse_insert_rec().
Here is the caller graph for this function:

| UNIV_INLINE rec_t* page_cur_rec_insert | ( | page_cur_t * | cursor, | |
| rec_t * | rec, | |||
| dict_index_t * | index, | |||
| ulint * | offsets, | |||
| mtr_t * | mtr | |||
| ) |
Referenced by page_copy_rec_list_end_no_locks(), page_copy_rec_list_start(), and page_cur_parse_insert_rec().
Here is the caller graph for this function:

| UNIV_INLINE ulint page_cur_search | ( | page_t * | page, | |
| dict_index_t * | index, | |||
| dtuple_t * | tuple, | |||
| ulint | mode, | |||
| page_cur_t * | cursor | |||
| ) |
Referenced by btr_cur_insert_if_possible(), btr_cur_optimistic_insert(), btr_page_split_and_insert(), btr_root_raise_and_insert(), and ibuf_insert_to_index_page().
Here is the caller graph for this function:

| void page_cur_search_with_match | ( | page_t * | page, | |
| dict_index_t * | index, | |||
| dtuple_t * | tuple, | |||
| ulint | mode, | |||
| ulint * | iup_matched_fields, | |||
| ulint * | iup_matched_bytes, | |||
| ulint * | ilow_matched_fields, | |||
| ulint * | ilow_matched_bytes, | |||
| page_cur_t * | cursor | |||
| ) |
Definition at line 193 of file page0cur.c.
References cmp, cmp_dtuple_rec_with_match(), dtuple_check_typed(), dtuple_get_n_fields_cmp(), index(), mem_heap_free, NULL, page_check_dir(), page_cmp_dtuple_rec_with_match(), PAGE_CUR_G, PAGE_CUR_GE, PAGE_CUR_L, PAGE_CUR_LE, page_dir_get_n_slots(), page_dir_get_nth_slot(), page_dir_slot_get_rec(), PAGE_DIRECTION, page_get_infimum_rec(), page_get_supremum_rec(), page_header_get_field(), page_header_get_ptr(), PAGE_LAST_INSERT, PAGE_LEVEL, PAGE_N_DIRECTION, page_rec_get_next(), PAGE_RIGHT, page_cur_struct::rec, rec_get_offsets, REC_OFFS_NORMAL_SIZE, ut_a, ut_ad, and ut_pair_min().
Referenced by btr_cur_search_to_nth_level().
00195 : index page */ 00196 dict_index_t* index, /* in: record descriptor */ 00197 dtuple_t* tuple, /* in: data tuple */ 00198 ulint mode, /* in: PAGE_CUR_L, PAGE_CUR_LE, PAGE_CUR_G, 00199 or PAGE_CUR_GE */ 00200 ulint* iup_matched_fields, 00201 /* in/out: already matched fields in upper 00202 limit record */ 00203 ulint* iup_matched_bytes, 00204 /* in/out: already matched bytes in a field 00205 not yet completely matched */ 00206 ulint* ilow_matched_fields, 00207 /* in/out: already matched fields in lower 00208 limit record */ 00209 ulint* ilow_matched_bytes, 00210 /* in/out: already matched bytes in a field 00211 not yet completely matched */ 00212 page_cur_t* cursor) /* out: page cursor */ 00213 { 00214 ulint up; 00215 ulint low; 00216 ulint mid; 00217 page_dir_slot_t* slot; 00218 rec_t* up_rec; 00219 rec_t* low_rec; 00220 rec_t* mid_rec; 00221 ulint up_matched_fields; 00222 ulint up_matched_bytes; 00223 ulint low_matched_fields; 00224 ulint low_matched_bytes; 00225 ulint cur_matched_fields; 00226 ulint cur_matched_bytes; 00227 int cmp; 00228 #ifdef UNIV_SEARCH_DEBUG 00229 int dbg_cmp; 00230 ulint dbg_matched_fields; 00231 ulint dbg_matched_bytes; 00232 #endif 00233 mem_heap_t* heap = NULL; 00234 ulint offsets_[REC_OFFS_NORMAL_SIZE]; 00235 ulint* offsets = offsets_; 00236 *offsets_ = (sizeof offsets_) / sizeof *offsets_; 00237 00238 ut_ad(page && tuple && iup_matched_fields && iup_matched_bytes 00239 && ilow_matched_fields && ilow_matched_bytes && cursor); 00240 ut_ad(dtuple_validate(tuple)); 00241 ut_ad(dtuple_check_typed(tuple)); 00242 #ifdef UNIV_DEBUG 00243 # ifdef PAGE_CUR_DBG 00244 if (mode != PAGE_CUR_DBG) 00245 # endif /* PAGE_CUR_DBG */ 00246 # ifdef PAGE_CUR_LE_OR_EXTENDS 00247 if (mode != PAGE_CUR_LE_OR_EXTENDS) 00248 # endif /* PAGE_CUR_LE_OR_EXTENDS */ 00249 ut_ad((mode == PAGE_CUR_L) || (mode == PAGE_CUR_LE) 00250 || (mode == PAGE_CUR_G) || (mode == PAGE_CUR_GE)); 00251 #endif /* UNIV_DEBUG */ 00252 00253 page_check_dir(page); 00254 00255 #ifdef PAGE_CUR_ADAPT 00256 if ((page_header_get_field(page, PAGE_LEVEL) == 0) 00257 && (mode == PAGE_CUR_LE) 00258 && (page_header_get_field(page, PAGE_N_DIRECTION) > 3) 00259 && (page_header_get_ptr(page, PAGE_LAST_INSERT)) 00260 && (page_header_get_field(page, PAGE_DIRECTION) == PAGE_RIGHT)) { 00261 00262 if (page_cur_try_search_shortcut(page, index, tuple, 00263 iup_matched_fields, iup_matched_bytes, 00264 ilow_matched_fields, ilow_matched_bytes, 00265 cursor)) { 00266 return; 00267 } 00268 } 00269 # ifdef PAGE_CUR_DBG 00270 if (mode == PAGE_CUR_DBG) { 00271 mode = PAGE_CUR_LE; 00272 } 00273 # endif 00274 #endif 00275 00276 /* The following flag does not work for non-latin1 char sets because 00277 cmp_full_field does not tell how many bytes matched */ 00278 #ifdef PAGE_CUR_LE_OR_EXTENDS 00279 ut_a(mode != PAGE_CUR_LE_OR_EXTENDS); 00280 #endif /* PAGE_CUR_LE_OR_EXTENDS */ 00281 00282 /* If mode PAGE_CUR_G is specified, we are trying to position the 00283 cursor to answer a query of the form "tuple < X", where tuple is 00284 the input parameter, and X denotes an arbitrary physical record on 00285 the page. We want to position the cursor on the first X which 00286 satisfies the condition. */ 00287 00288 up_matched_fields = *iup_matched_fields; 00289 up_matched_bytes = *iup_matched_bytes; 00290 low_matched_fields = *ilow_matched_fields; 00291 low_matched_bytes = *ilow_matched_bytes; 00292 00293 /* Perform binary search. First the search is done through the page 00294 directory, after that as a linear search in the list of records 00295 owned by the upper limit directory slot. */ 00296 00297 low = 0; 00298 up = page_dir_get_n_slots(page) - 1; 00299 00300 /* Perform binary search until the lower and upper limit directory 00301 slots come to the distance 1 of each other */ 00302 00303 while (up - low > 1) { 00304 mid = (low + up) / 2; 00305 slot = page_dir_get_nth_slot(page, mid); 00306 mid_rec = page_dir_slot_get_rec(slot); 00307 00308 ut_pair_min(&cur_matched_fields, &cur_matched_bytes, 00309 low_matched_fields, low_matched_bytes, 00310 up_matched_fields, up_matched_bytes); 00311 00312 offsets = rec_get_offsets(mid_rec, index, offsets, 00313 dtuple_get_n_fields_cmp(tuple), &heap); 00314 00315 cmp = cmp_dtuple_rec_with_match(tuple, mid_rec, offsets, 00316 &cur_matched_fields, 00317 &cur_matched_bytes); 00318 if (UNIV_LIKELY(cmp > 0)) { 00319 low_slot_match: 00320 low = mid; 00321 low_matched_fields = cur_matched_fields; 00322 low_matched_bytes = cur_matched_bytes; 00323 00324 } else if (UNIV_LIKELY(cmp /* == -1 */)) { 00325 #ifdef PAGE_CUR_LE_OR_EXTENDS 00326 if (mode == PAGE_CUR_LE_OR_EXTENDS 00327 && page_cur_rec_field_extends(tuple, mid_rec, 00328 offsets, cur_matched_fields)) { 00329 00330 goto low_slot_match; 00331 } 00332 #endif /* PAGE_CUR_LE_OR_EXTENDS */ 00333 up_slot_match: 00334 up = mid; 00335 up_matched_fields = cur_matched_fields; 00336 up_matched_bytes = cur_matched_bytes; 00337 00338 } else if (mode == PAGE_CUR_G || mode == PAGE_CUR_LE 00339 #ifdef PAGE_CUR_LE_OR_EXTENDS 00340 || mode == PAGE_CUR_LE_OR_EXTENDS 00341 #endif /* PAGE_CUR_LE_OR_EXTENDS */ 00342 ) { 00343 00344 goto low_slot_match; 00345 } else { 00346 00347 goto up_slot_match; 00348 } 00349 } 00350 00351 slot = page_dir_get_nth_slot(page, low); 00352 low_rec = page_dir_slot_get_rec(slot); 00353 slot = page_dir_get_nth_slot(page, up); 00354 up_rec = page_dir_slot_get_rec(slot); 00355 00356 /* Perform linear search until the upper and lower records come to 00357 distance 1 of each other. */ 00358 00359 while (page_rec_get_next(low_rec) != up_rec) { 00360 00361 mid_rec = page_rec_get_next(low_rec); 00362 00363 ut_pair_min(&cur_matched_fields, &cur_matched_bytes, 00364 low_matched_fields, low_matched_bytes, 00365 up_matched_fields, up_matched_bytes); 00366 00367 offsets = rec_get_offsets(mid_rec, index, offsets, 00368 dtuple_get_n_fields_cmp(tuple), &heap); 00369 00370 cmp = cmp_dtuple_rec_with_match(tuple, mid_rec, offsets, 00371 &cur_matched_fields, 00372 &cur_matched_bytes); 00373 if (UNIV_LIKELY(cmp > 0)) { 00374 low_rec_match: 00375 low_rec = mid_rec; 00376 low_matched_fields = cur_matched_fields; 00377 low_matched_bytes = cur_matched_bytes; 00378 00379 } else if (UNIV_LIKELY(cmp /* == -1 */)) { 00380 #ifdef PAGE_CUR_LE_OR_EXTENDS 00381 if (mode == PAGE_CUR_LE_OR_EXTENDS 00382 && page_cur_rec_field_extends(tuple, mid_rec, 00383 offsets, cur_matched_fields)) { 00384 00385 goto low_rec_match; 00386 } 00387 #endif /* PAGE_CUR_LE_OR_EXTENDS */ 00388 up_rec_match: 00389 up_rec = mid_rec; 00390 up_matched_fields = cur_matched_fields; 00391 up_matched_bytes = cur_matched_bytes; 00392 } else if (mode == PAGE_CUR_G || mode == PAGE_CUR_LE 00393 #ifdef PAGE_CUR_LE_OR_EXTENDS 00394 || mode == PAGE_CUR_LE_OR_EXTENDS 00395 #endif /* PAGE_CUR_LE_OR_EXTENDS */ 00396 ) { 00397 00398 goto low_rec_match; 00399 } else { 00400 00401 goto up_rec_match; 00402 } 00403 } 00404 00405 #ifdef UNIV_SEARCH_DEBUG 00406 00407 /* Check that the lower and upper limit records have the 00408 right alphabetical order compared to tuple. */ 00409 dbg_matched_fields = 0; 00410 dbg_matched_bytes = 0; 00411 00412 offsets = rec_get_offsets(low_rec, index, offsets, 00413 ULINT_UNDEFINED, &heap); 00414 dbg_cmp = page_cmp_dtuple_rec_with_match(tuple, low_rec, offsets, 00415 &dbg_matched_fields, 00416 &dbg_matched_bytes); 00417 if (mode == PAGE_CUR_G) { 00418 ut_a(dbg_cmp >= 0); 00419 } else if (mode == PAGE_CUR_GE) { 00420 ut_a(dbg_cmp == 1); 00421 } else if (mode == PAGE_CUR_L) { 00422 ut_a(dbg_cmp == 1); 00423 } else if (mode == PAGE_CUR_LE) { 00424 ut_a(dbg_cmp >= 0); 00425 } 00426 00427 if (low_rec != page_get_infimum_rec(page)) { 00428 00429 ut_a(low_matched_fields == dbg_matched_fields); 00430 ut_a(low_matched_bytes == dbg_matched_bytes); 00431 } 00432 00433 dbg_matched_fields = 0; 00434 dbg_matched_bytes = 0; 00435 00436 offsets = rec_get_offsets(up_rec, index, offsets, 00437 ULINT_UNDEFINED, &heap); 00438 dbg_cmp = page_cmp_dtuple_rec_with_match(tuple, up_rec, offsets, 00439 &dbg_matched_fields, 00440 &dbg_matched_bytes); 00441 if (mode == PAGE_CUR_G) { 00442 ut_a(dbg_cmp == -1); 00443 } else if (mode == PAGE_CUR_GE) { 00444 ut_a(dbg_cmp <= 0); 00445 } else if (mode == PAGE_CUR_L) { 00446 ut_a(dbg_cmp <= 0); 00447 } else if (mode == PAGE_CUR_LE) { 00448 ut_a(dbg_cmp == -1); 00449 } 00450 00451 if (up_rec != page_get_supremum_rec(page)) { 00452 00453 ut_a(up_matched_fields == dbg_matched_fields); 00454 ut_a(up_matched_bytes == dbg_matched_bytes); 00455 } 00456 #endif 00457 if (mode <= PAGE_CUR_GE) { 00458 cursor->rec = up_rec; 00459 } else { 00460 cursor->rec = low_rec; 00461 } 00462 00463 *iup_matched_fields = up_matched_fields; 00464 *iup_matched_bytes = up_matched_bytes; 00465 *ilow_matched_fields = low_matched_fields; 00466 *ilow_matched_bytes = low_matched_bytes; 00467 if (UNIV_LIKELY_NULL(heap)) { 00468 mem_heap_free(heap); 00469 } 00470 }
Here is the call graph for this function:

Here is the caller graph for this function:

| UNIV_INLINE void page_cur_set_after_last | ( | page_t * | page, | |
| page_cur_t * | cur | |||
| ) |
Referenced by btr_cur_open_at_index_side(), btr_pcur_move_backward_from_page(), and page_copy_rec_list_start().
Here is the caller graph for this function:

| UNIV_INLINE void page_cur_set_before_first | ( | page_t * | page, | |
| page_cur_t * | cur | |||
| ) |
Referenced by btr_cur_open_at_index_side(), btr_index_page_validate(), btr_pcur_move_to_next_page(), btr_root_raise_and_insert(), btr_validate_level(), lock_move_rec_list_end(), lock_move_rec_list_start(), lock_move_reorganize_page(), page_copy_rec_list_end_no_locks(), page_copy_rec_list_start(), page_delete_rec_list_start(), page_find_rec_with_heap_no(), page_print_list(), page_simple_validate(), and page_validate().
Here is the caller graph for this function:

| UNIV_INLINE rec_t* page_cur_tuple_insert | ( | page_cur_t * | cursor, | |
| dtuple_t * | tuple, | |||
| dict_index_t * | index, | |||
| mtr_t * | mtr | |||
| ) |
Referenced by btr_cur_insert_if_possible(), btr_cur_optimistic_insert(), btr_page_split_and_insert(), btr_root_raise_and_insert(), and ibuf_insert_to_index_page().
Here is the caller graph for this function:

| byte* page_parse_copy_rec_list_to_created_page | ( | byte * | ptr, | |
| byte * | end_ptr, | |||
| dict_index_t * | index, | |||
| page_t * | page, | |||
| mtr_t * | mtr | |||
| ) |
Definition at line 1038 of file page0cur.c.
References index(), mach_read_from_4(), NULL, page_cur_parse_insert_rec(), PAGE_DIRECTION, page_header_set_field(), page_header_set_ptr(), PAGE_LAST_INSERT, PAGE_N_DIRECTION, PAGE_NO_DIRECTION, TRUE, and ut_a.
Referenced by recv_parse_or_apply_log_rec_body().
01040 : end of log record or NULL */ 01041 byte* ptr, /* in: buffer */ 01042 byte* end_ptr,/* in: buffer end */ 01043 dict_index_t* index, /* in: record descriptor */ 01044 page_t* page, /* in: page or NULL */ 01045 mtr_t* mtr) /* in: mtr or NULL */ 01046 { 01047 byte* rec_end; 01048 ulint log_data_len; 01049 01050 if (ptr + 4 > end_ptr) { 01051 01052 return(NULL); 01053 } 01054 01055 log_data_len = mach_read_from_4(ptr); 01056 ptr += 4; 01057 01058 rec_end = ptr + log_data_len; 01059 01060 if (rec_end > end_ptr) { 01061 01062 return(NULL); 01063 } 01064 01065 if (!page) { 01066 01067 return(rec_end); 01068 } 01069 01070 while (ptr < rec_end) { 01071 ptr = page_cur_parse_insert_rec(TRUE, ptr, end_ptr, 01072 index, page, mtr); 01073 } 01074 01075 ut_a(ptr == rec_end); 01076 01077 page_header_set_ptr(page, PAGE_LAST_INSERT, NULL); 01078 page_header_set_field(page, PAGE_DIRECTION, PAGE_NO_DIRECTION); 01079 page_header_set_field(page, PAGE_N_DIRECTION, 0); 01080 01081 return(rec_end); 01082 }
Here is the call graph for this function:

Here is the caller graph for this function:

1.4.7

