/***********************************************************//** Inserts a record next to page cursor on an uncompressed page. Returns pointer to inserted record if succeed, i.e., enough space available, NULL otherwise. The cursor stays at the same position. @return pointer to record if succeed, NULL otherwise */ rec_t* page_cur_insert_rec_low( /*====================*/ rec_t* current_rec,/*!< in: pointer to current record after which the new record is inserted */ dict_index_t* index, /*!< in: record descriptor */ const rec_t* rec, /*!< in: pointer to a physical record */ ulint* offsets,/*!< in/out: rec_get_offsets(rec, index) */ mtr_t* mtr) /*!< in: mini-transaction handle, or NULL */ { byte* insert_buf; ulint rec_size; page_t* page; /*!< the relevant page */ rec_t* last_insert; /*!< cursor position at previous insert */ rec_t* free_rec; /*!< a free record that was reused, or NULL */ rec_t* insert_rec; /*!< inserted record */ ulint heap_no; /*!< heap number of the inserted record */ ut_ad(rec_offs_validate(rec, index, offsets)); page = page_align(current_rec); ut_ad(dict_table_is_comp(index->table) == (ibool) !!page_is_comp(page)); ut_ad(fil_page_index_page_check(page)); ut_ad(mach_read_from_8(page + PAGE_HEADER + PAGE_INDEX_ID) == index->id || index->is_dummy || (mtr ? mtr->is_inside_ibuf() : dict_index_is_ibuf(index))); ut_ad(!page_rec_is_supremum(current_rec)); (gdb) p cur2 $1 = (rec_t *) 0x0 (gdb) p *cur2 Cannot access memory at address 0x0 (gdb) p *index $3 = {id = 9007, heap = 0x2b24a90112a0, name = {m_name = 0x2b24a9128670 "PRIMARY"}, table = 0x2b24a9102070, page = 3, merge_threshold = 50, type = 3, trx_id_offset = 4, n_user_defined_cols = 1, nulls_equal = 0, n_uniq = 1, n_def = 66, n_fields = 66, n_nullable = 2, n_core_fields = 66, n_core_null_bytes = 1, static NO_CORE_NULL_BYTES = 255, static DICT_INDEXES_ID = 3, cached = 1, to_be_dropped = 0, online_status = 0, uncommitted = 0, fields = 0x2b24a912f070, parser = 0x0, has_new_v_col = false, index_fts_syncing = false, indexes = {prev = 0x0, next = 0x2b24a9123570}, search_info = 0x2b24a912f6f0, online_log = 0x0, stat_n_diff_key_vals = 0x2b24a912f6d8, stat_n_sample_sizes = 0x2b24a912f6e0, stat_n_non_null_key_vals = 0x2b24a912f6e8, stat_index_size = 1, stat_n_leaf_pages = 1, stats_error_printed = false, stat_defrag_modified_counter = 0, stat_defrag_n_pages_freed = 0, stat_defrag_n_page_split = 0, stat_defrag_data_size_sample = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, stat_defrag_sample_next_slot = 0, rtr_ssn = {mutex = {m_impl = {m_lock_word = 0, m_event = 0x0, m_policy = {m_count = {m_spins = 0, m_waits = 0, m_calls = 0, m_enabled = false}, m_id = LATCH_ID_NONE}}, m_ptr = 0x0}, seq_no = 0}, rtr_track = 0x0, trx_id = 0, zip_pad = {mutex = 0x0, pad = 0, success = 0, failure = 0, n_rounds = 0, mutex_created = 0}, lock = {lock_word = 268435453, waiters = 0, sx_recursive = 1, writer_is_wait_ex = false, writer_thread = 47436594693888, event = 0x2b24a908e0e0, wait_ex_event = 0x2b24a908e150, cfile_name = 0x556dd8c50378 " /local/home/src/MariaDB/storage/innobase/dict/dict0dict.cc", last_x_file_name = 0x556dd8c4b048 " /local/home/src/MariaDB/storage/innobase/btr/btr0cur.cc", cline = 2542, is_block_lock = 0, last_x_line = 1169, count_os_wait = 0, list = {prev = 0x2b24a91236f8, next = 0x2b24a96890f8}, pfs_psi = 0x0}} (gdb) p *mtr $5 = {m_impl = {m_memo = {m_heap = 0x0, m_list = {count = 1, start = 0x2b24b1603070, end = 0x2b24b1603070, node = &mtr_buf_t::block_t::m_node}, m_size = 160, m_first_block = { m_data = "x4\022\251$+\000\000\200\000\000\000\000\000\000\000\200\364\343\242!+\000\000\002\000\000\000\000\000\000\000\200\224\343\317#+\000\000\b\000\000\000\000\000\000\000\000\231\343\317#+\000\000\002\000\000\000\000\000\000\000\200\224\343\317#+\000\000\002\000\000\000\000\000\000\000 W\352\240!+\000\000@\000\000\000\000\000\000\000\000\177\342\242!+\000\000\004\000\000\000\000\000\000\000\200\364\343\242!+\000\000\b\000\000\000\000\000\000\000\200\364\343\242!+\000\000\002\000\000\000\000\000\000\000\000\231\343\317#+\000\000\002\000\000\000\000\000\000\000@4ڠ!+\000\000\240F`\261$+\000\000\240\242\327\331mU\000\000\n\000\000\000\000\000\000\000\020\000\000\000\000\000\000\000\000"..., m_node = {prev = 0x0, next = 0x0}, m_used = 160}}, m_log = {m_heap = 0x2b24a8b2f080, m_list = { count = 4, start = 0x2b24b16032b0, end = 0x2b24a8b2b480, node = &mtr_buf_t::block_t::m_node}, m_size = 1355, m_first_block = { m_data = "*\213\370\211\206\000B\000\001\200\004\200\006\200\a\000\004\000\003\200\001\200\004\200\004\200\004\200\004\200\004\200\004\200\004\200\001\200\004\200\004\200\004\200\004\200\004\200\004\200\004\200\004\200\004\200\004\200\004\200\004\200\004\200\004\200\004\200\004\200\004\200\004\200\004\200\004\200\004\200\004\200\004\200\004\200\004\200\004\200\004\200\004\200\004\200\004\200\004\200\004\200\004\200\004\200\004\200\004\200\004\200\004\200\004\200\004\200\004\200\004\200\004\200\004\200\004\200\004\200\004\200\004\200\004\200\004\200\004\200\004\032\356\000\215\001V\000\"+\000\000\340\065`\261$+\000\000\260\353)\211$+\000\000\000\000\000\000\000\000\000\000S,s\237!+\000\000p\004", '\000' ..., m_node = {prev = 0x0, next = 0x2b24a8b2f0f0}, m_used = 143}}, m_made_dirty = true, m_inside_ibuf = false, m_modifications = true, m_n_log_recs = 4, m_log_mode = MTR_LOG_ALL, m_user_space = 0x2b21a0ea5680, m_state = MTR_STATE_ACTIVE, m_flush_observer = 0x0, m_mtr = 0x2b24b1603040}, m_commit_lsn = 0, m_sync = true} (gdb) p *offsets $7 = 100 (gdb) p *cur1_rec $11 = 0 '\000' (gdb) p *cur2 $1 = 0 '\000' (gdb) p cur2 $2 = (rec_t *) 0x2ae132e9bb46 "" (gdb) p cur1_rec $3 = (rec_t *) 0x2ae132e8807e "" (gdb) p *cur1_rec $4 = 0 '\000' (gdb) p *index $5 = {id = 9007, heap = 0x2ae20b417120, name = {m_name = 0x2ae20b476270 "PRIMARY"}, table = 0x2ae20b472370, page = 3, merge_threshold = 50, type = 3, trx_id_offset = 4, n_user_defined_cols = 1, nulls_equal = 0, n_uniq = 1, n_def = 66, n_fields = 66, n_nullable = 2, n_core_fields = 66, n_core_null_bytes = 1, static NO_CORE_NULL_BYTES = 255, static DICT_INDEXES_ID = 3, cached = 1, to_be_dropped = 0, online_status = 0, uncommitted = 0, fields = 0x2ae20b575070, parser = 0x0, has_new_v_col = false, index_fts_syncing = false, indexes = {prev = 0x0, next = 0x2ae20b4796f0}, search_info = 0x2ae20b5756f0, online_log = 0x0, stat_n_diff_key_vals = 0x2ae20b5756d8, stat_n_sample_sizes = 0x2ae20b5756e0, stat_n_non_null_key_vals = 0x2ae20b5756e8, stat_index_size = 1, stat_n_leaf_pages = 1, stats_error_printed = false, stat_defrag_modified_counter = 0, stat_defrag_n_pages_freed = 0, stat_defrag_n_page_split = 0, stat_defrag_data_size_sample = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, stat_defrag_sample_next_slot = 0, rtr_ssn = {mutex = {m_impl = {m_lock_word = 0, m_event = 0x0, m_policy = {m_count = {m_spins = 0, m_waits = 0, m_calls = 0, m_enabled = false}, m_id = LATCH_ID_NONE}}, m_ptr = 0x0}, seq_no = 0}, rtr_track = 0x0, trx_id = 0, zip_pad = {mutex = 0x0, pad = 0, success = 0, failure = 0, n_rounds = 0, mutex_created = 0}, lock = {lock_word = 268435455, waiters = 0, sx_recursive = 1, writer_is_wait_ex = false, writer_thread = 47150480246528, event = 0x2ae20b481620, wait_ex_event = 0x2ae20b481690, cfile_name = 0x5563f7303378 " /local/home/src/MariaDB/storage/innobase/dict/dict0dict.cc", last_x_file_name = 0x5563f72fe048 " /local/home/src/MariaDB/storage/innobase/btr/btr0cur.cc", cline = 2542, is_block_lock = 0, last_x_line = 1169, count_os_wait = 0, list = {prev = 0x2ae20b479878, next = 0x2ae20c0c20c0}, pfs_psi = 0x0}} (gdb) p *mtr $6 = {m_impl = {m_memo = {m_heap = 0x0, m_list = {count = 1, start = 0x2ae213a03070, end = 0x2ae213a03070, node = &mtr_buf_t::block_t::m_node}, m_size = 160, m_first_block = { m_data = "\370\225G\v\342*\000\000\200\000\000\000\000\000\000\000\200\367#\005\337*\000\000\002\000\000\000\000\000\000\000\000\223#2\341*\000\000\b\000\000\000\000\000\000\000\000\231#2\341*\000\000\002\000\000\000\000\000\000\000\000\223#2\341*\000\000\002\000\000\000\000\000\000\000 W\352\002\337*\000\000@\000\000\000\000\000\000\000\200\342 \005\337*\000\000\004\000\000\000\000\000\000\000\200\367#\005\337*\000\000\b\000\000\000\000\000\000\000\200\367#\005\337*\000\000\002\000\000\000\000\000\000\000\000\231#2\341*\000\000\002\000\000\000\000\000\000\000@4\332\002\337*\000\000\240F\240\023\342*\000\000\240\322B\370cU\000\000\n\000\000\000\000\000\000\000\020\000\000\000\000\000\000\000\000"..., m_node = {prev = 0x0, next = 0x0}, m_used = 160}}, m_log = {m_heap = 0x0, m_list = {count = 1, start = 0x2ae213a032b0, end = 0x2ae213a032b0, node = &mtr_buf_t::block_t::m_node}, m_size = 143, m_first_block = { m_data = "*\213\370\211\206\000B\000\001\200\004\200\006\200\a\000\004\000\003\200\001\200\004\200\004\200\004\200\004\200\004\200\004\200\004\200\001\200\004\200\004\200\004\200\004\200\004\200\004\200\004\200\004\200\004\200\004\200\004\200\004\200\004\200\004\200\004\200\004\200\004\200\004\200\004\200\004\200\004\200\004\200\004\200\004\200\004\200\004\200\004\200\004\200\004\200\004\200\004\200\004\200\004\200\004\200\004\200\004\200\004\200\004\200\004\200\004\200\004\200\004\200\004\200\004\200\004\200\004\200\004\200\004\200\004\200\004\200\004\200\004\032\356\000\215\001\226b\337*\000\000\340\065\240\023\342*\000\000\260\353i\353\341*\000\000\000\000\000\000\000\000\000\000S\\\235\001\337*\000\000p\004", '\000' ..., m_node = {prev = 0x0, next = 0x0}, m_used = 143}}, m_made_dirty = true, m_inside_ibuf = false, m_modifications = true, m_n_log_recs = 1, m_log_mode = MTR_LOG_ALL, m_user_space = 0x2adf02ea5680, m_state = MTR_STATE_ACTIVE, m_flush_observer = 0x0, m_mtr = 0x2ae213a03040}, m_commit_lsn = 0, m_sync = true} (gdb) p offsets $7 = (ulint *) 0x2ae213a02470 (gdb) p *offsets $8 = 100 (gdb) p rec_get_offsets No symbol "rec_get_offsets" in current context. (gdb) s rec_get_offsets_func (rec=rec@entry=0x2ae132e8807e "", index=index@entry=0x2ae20b479470, offsets=offsets@entry=0x2ae213a02470, leaf=leaf@entry=true, n_fields=n_fields@entry=18446744073709551615, heap=heap@entry=0x2ae213a02460) at /local/home/src/MariaDB/storage/innobase/rem/rem0rec.cc:794 794 /local/home/src/MariaDB/storage/innobase/rem/rem0rec.cc: No such file or directory. (gdb) p *offsets $9 = 100 (gdb) p is_leaf No symbol "is_leaf" in current context. (gdb) p n_fields $10 = 18446744073709551615 (gdb) p *n_fields Cannot access memory at address 0xffffffffffffffff (gdb) s 802 in /local/home/src/MariaDB/storage/innobase/rem/rem0rec.cc (gdb) s 803 in /local/home/src/MariaDB/storage/innobase/rem/rem0rec.cc (gdb) s rec_get_status (rec=) at /local/home/src/MariaDB/storage/innobase/include/rem0rec.h:298 298 /local/home/src/MariaDB/storage/innobase/include/rem0rec.h: No such file or directory. (gdb) s rec_get_offsets_func (rec=rec@entry=0x2ae132e8807e "", index=index@entry=0x2ae20b479470, offsets=offsets@entry=0x2ae213a02470, leaf=leaf@entry=true, n_fields=n_fields@entry=18446744073709551615, heap=heap@entry=0x2ae213a02460) at /local/home/src/MariaDB/storage/innobase/rem/rem0rec.cc:803 803 /local/home/src/MariaDB/storage/innobase/rem/rem0rec.cc: No such file or directory. (gdb) s 808 in /local/home/src/MariaDB/storage/innobase/rem/rem0rec.cc (gdb) s dict_index_get_n_fields (index=0x2ae20b479470) at /local/home/src/MariaDB/storage/innobase/include/dict0dict.ic:916 916 /local/home/src/MariaDB/storage/innobase/include/dict0dict.ic: No such file or directory. (gdb) p *n_fields No symbol "n_fields" in current context. (gdb) s rec_get_offsets_func (rec=rec@entry=0x2ae132e8807e "", index=index@entry=0x2ae20b479470, offsets=offsets@entry=0x2ae213a02470, leaf=leaf@entry=true, n_fields=n_fields@entry=18446744073709551615, heap=heap@entry=0x2ae213a02460) at /local/home/src/MariaDB/storage/innobase/rem/rem0rec.cc:870 870 /local/home/src/MariaDB/storage/innobase/rem/rem0rec.cc: No such file or directory. (gdb) s 867 in /local/home/src/MariaDB/storage/innobase/rem/rem0rec.cc (gdb) s 870 in /local/home/src/MariaDB/storage/innobase/rem/rem0rec.cc (gdb) s 881 in /local/home/src/MariaDB/storage/innobase/rem/rem0rec.cc (gdb) s rec_offs_set_n_fields (n_fields=66, offsets=0x2ae213a02470) at /local/home/src/MariaDB/storage/innobase/include/rem0rec.ic:1263 1263 /local/home/src/MariaDB/storage/innobase/include/rem0rec.ic: No such file or directory. (gdb) s rec_get_offsets_func (rec=rec@entry=0x2ae132e8807e "", index=index@entry=0x2ae20b479470, offsets=offsets@entry=0x2ae213a02470, leaf=leaf@entry=true, n_fields=n_fields@entry=18446744073709551615, heap=heap@entry=0x2ae213a02460) at /local/home/src/MariaDB/storage/innobase/rem/rem0rec.cc:882 882 /local/home/src/MariaDB/storage/innobase/rem/rem0rec.cc: No such file or directory. (gdb) s rec_init_offsets (leaf=144, offsets=0x2ae213a02470, index=0x2ae20b479470, rec=0x2ae132e8807e "") at /local/home/src/MariaDB/storage/innobase/rem/rem0rec.cc:595 595 in /local/home/src/MariaDB/storage/innobase/rem/rem0rec.cc (gdb) s 600 in /local/home/src/MariaDB/storage/innobase/rem/rem0rec.cc (gdb) s rec_get_status (rec=) at /local/home/src/MariaDB/storage/innobase/include/rem0rec.h:298 298 /local/home/src/MariaDB/storage/innobase/include/rem0rec.h: No such file or directory. (gdb) s rec_init_offsets (leaf=144, offsets=0x2ae213a02470, index=0x2ae20b479470, rec=0x2ae132e8807e "") at /local/home/src/MariaDB/storage/innobase/rem/rem0rec.cc:603 603 /local/home/src/MariaDB/storage/innobase/rem/rem0rec.cc: No such file or directory. (gdb) s 626 in /local/home/src/MariaDB/storage/innobase/rem/rem0rec.cc (gdb) s 625 in /local/home/src/MariaDB/storage/innobase/rem/rem0rec.cc (gdb) s rec_init_offsets_comp_ordinary (format=, n_core=, offsets=, index=, rec=) at /local/home/src/MariaDB/storage/innobase/rem/rem0rec.cc:341 341 in /local/home/src/MariaDB/storage/innobase/rem/rem0rec.cc (gdb) s 314 in /local/home/src/MariaDB/storage/innobase/rem/rem0rec.cc (gdb) s 313 in /local/home/src/MariaDB/storage/innobase/rem/rem0rec.cc (gdb) break page0page.cc:861 Breakpoint 2 at 0x5563f6ca5b16: file /local/home/src/MariaDB/storage/innobase/page/page0page.cc, line 861. (gdb) c Continuing. Breakpoint 2, page_copy_rec_list_start (new_block=0x2ae132239900, block=block@entry=0x2ae132239300, rec=0x2ae132e88070 "supremum", index=index@entry=0x2ae20b479470, mtr=mtr@entry=0x2ae213a03040) at /local/home/src/MariaDB/storage/innobase/page/page0page.cc:861 861 /local/home/src/MariaDB/storage/innobase/page/page0page.cc: No such file or directory. (gdb) p *cur2 $11 = 0 '\000' (gdb) s 858 in /local/home/src/MariaDB/storage/innobase/page/page0page.cc (gdb) p *cur2 $12 = 0 '\000' (gdb) p *cur1_rec $13 = 0 '\000' (gdb) s 861 in /local/home/src/MariaDB/storage/innobase/page/page0page.cc (gdb) p *cur1_rec $14 = 0 '\000' (gdb) p *cur2 $15 = 0 '\000' (gdb) s page_cur_insert_rec_low (current_rec=current_rec@entry=0x2ae132e9bb46 "", index=index@entry=0x2ae20b479470, rec=rec@entry=0x2ae132e8807e "", offsets=offsets@entry=0x2ae213a02470, mtr=mtr@entry=0x2ae213a03040) at /local/home/src/MariaDB/storage/innobase/page/page0cur.cc:1287 1287 /local/home/src/MariaDB/storage/innobase/page/page0cur.cc: No such file or directory. (gdb) p *rec $16 = 0 '\000' (gdb) p *index $17 = {id = 9007, heap = 0x2ae20b417120, name = {m_name = 0x2ae20b476270 "PRIMARY"}, table = 0x2ae20b472370, page = 3, merge_threshold = 50, type = 3, trx_id_offset = 4, n_user_defined_cols = 1, nulls_equal = 0, n_uniq = 1, n_def = 66, n_fields = 66, n_nullable = 2, n_core_fields = 66, n_core_null_bytes = 1, static NO_CORE_NULL_BYTES = 255, static DICT_INDEXES_ID = 3, cached = 1, to_be_dropped = 0, online_status = 0, uncommitted = 0, fields = 0x2ae20b575070, parser = 0x0, has_new_v_col = false, index_fts_syncing = false, indexes = {prev = 0x0, next = 0x2ae20b4796f0}, search_info = 0x2ae20b5756f0, online_log = 0x0, stat_n_diff_key_vals = 0x2ae20b5756d8, stat_n_sample_sizes = 0x2ae20b5756e0, stat_n_non_null_key_vals = 0x2ae20b5756e8, stat_index_size = 1, stat_n_leaf_pages = 1, stats_error_printed = false, stat_defrag_modified_counter = 0, stat_defrag_n_pages_freed = 0, stat_defrag_n_page_split = 0, stat_defrag_data_size_sample = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, stat_defrag_sample_next_slot = 0, rtr_ssn = {mutex = {m_impl = {m_lock_word = 0, m_event = 0x0, m_policy = {m_count = {m_spins = 0, m_waits = 0, m_calls = 0, m_enabled = false}, m_id = LATCH_ID_NONE}}, m_ptr = 0x0}, seq_no = 0}, rtr_track = 0x0, trx_id = 0, zip_pad = {mutex = 0x0, pad = 0, success = 0, failure = 0, n_rounds = 0, mutex_created = 0}, lock = {lock_word = 268435454, waiters = 1, sx_recursive = 1, writer_is_wait_ex = false, writer_thread = 47150480246528, event = 0x2ae20b481620, wait_ex_event = 0x2ae20b481690, cfile_name = 0x5563f7303378 " /local/home/src/MariaDB/storage/innobase/dict/dict0dict.cc", last_x_file_name = 0x5563f72fe048 " /local/home/src/MariaDB/storage/innobase/btr/btr0cur.cc", cline = 2542, is_block_lock = 0, last_x_line = 1169, count_os_wait = 0, list = {prev = 0x2ae20b479878, next = 0x2ae20c0c20c0}, pfs_psi = 0x0}} (gdb) p *offsets $18 = 100 (gdb) p *page value has been optimized out (gdb) p page $19 = (gdb) p current_rec $20 = (rec_t *) 0x2ae132e9bb46 "" (gdb) p *current_rec $21 = 0 '\000'