diff --git a/innobase/btr/btr0btr.c b/innobase/btr/btr0btr.c index 4fb930da50f..232d7f0f53b 100644 --- a/innobase/btr/btr0btr.c +++ b/innobase/btr/btr0btr.c @@ -567,8 +567,9 @@ btr_page_get_father_for_rec( btr_cur_t cursor; rec_t* node_ptr; dict_index_t* index; - ulint offsets_[100] = { 100, }; + ulint offsets_[100]; ulint* offsets = offsets_; + *offsets_ = (sizeof offsets_) / sizeof *offsets_; ut_ad(mtr_memo_contains(mtr, dict_tree_get_lock(tree), MTR_MEMO_X_LOCK)); @@ -2098,7 +2099,8 @@ btr_compress( btr_node_ptr_delete(tree, page, mtr); } else { mem_heap_t* heap = NULL; - ulint offsets_[100] = { 100, }; + ulint offsets_[100]; + *offsets_ = (sizeof offsets_) / sizeof *offsets_; /* Replace the address of the old child node (= page) with the address of the merge page to the right */ @@ -2387,9 +2389,9 @@ btr_print_tree( mtr_t mtr; page_t* root; mem_heap_t* heap = NULL; - ulint offsets_[100] - = { 100, }; + ulint offsets_[100]; ulint* offsets = offsets_; + *offsets_ = (sizeof offsets_) / sizeof *offsets_; fputs("--------------------------\n" "INDEX TREE PRINT\n", stderr); @@ -2489,9 +2491,9 @@ btr_index_rec_validate( ulint i; page_t* page; mem_heap_t* heap = NULL; - ulint offsets_[100] - = { 100, }; + ulint offsets_[100]; ulint* offsets = offsets_; + *offsets_ = (sizeof offsets_) / sizeof *offsets_; page = buf_frame_align(rec); diff --git a/innobase/btr/btr0cur.c b/innobase/btr/btr0cur.c index 91ba47224ef..6279ac79d3a 100644 --- a/innobase/btr/btr0cur.c +++ b/innobase/btr/btr0cur.c @@ -275,8 +275,9 @@ btr_cur_search_to_nth_level( btr_search_t* info; #endif mem_heap_t* heap = NULL; - ulint offsets_[100] = { 100, }; + ulint offsets_[100]; ulint* offsets = offsets_; + *offsets_ = (sizeof offsets_) / sizeof *offsets_; /* Currently, PAGE_CUR_LE is the only search mode used for searches ending to upper levels */ @@ -578,8 +579,9 @@ btr_cur_open_at_index_side( ulint estimate; ulint savepoint; mem_heap_t* heap = NULL; - ulint offsets_[100] = { 100, }; + ulint offsets_[100]; ulint* offsets = offsets_; + *offsets_ = (sizeof offsets_) / sizeof *offsets_; estimate = latch_mode & BTR_ESTIMATE; latch_mode = latch_mode & ~BTR_ESTIMATE; @@ -703,8 +705,9 @@ btr_cur_open_at_rnd_pos( ulint height; rec_t* node_ptr; mem_heap_t* heap = NULL; - ulint offsets_[100] = { 100, }; + ulint offsets_[100]; ulint* offsets = offsets_; + *offsets_ = (sizeof offsets_) / sizeof *offsets_; tree = index->tree; @@ -1252,7 +1255,9 @@ btr_cur_upd_lock_and_undo( if (!(flags & BTR_NO_LOCKING_FLAG)) { mem_heap_t* heap = NULL; - ulint offsets_[100] = { 100, }; + ulint offsets_[100]; + *offsets_ = (sizeof offsets_) / sizeof *offsets_; + err = lock_clust_rec_modify_check_and_lock(flags, rec, index, rec_get_offsets(rec, index, offsets_, ULINT_UNDEFINED, &heap), thr); @@ -1426,8 +1431,9 @@ btr_cur_update_in_place( trx_t* trx; ibool was_delete_marked; mem_heap_t* heap = NULL; - ulint offsets_[100] = { 100, }; + ulint offsets_[100]; ulint* offsets = offsets_; + *offsets_ = (sizeof offsets_) / sizeof *offsets_; rec = btr_cur_get_rec(cursor); index = cursor->index; @@ -2065,7 +2071,9 @@ btr_cur_parse_del_mark_set_clust_rec( if (!(flags & BTR_KEEP_SYS_FLAG)) { mem_heap_t* heap = NULL; - ulint offsets_[100] = { 100, }; + ulint offsets_[100]; + *offsets_ = (sizeof offsets_) / sizeof *offsets_; + row_upd_rec_sys_fields_in_recovery(rec, rec_get_offsets(rec, index, offsets_, ULINT_UNDEFINED, &heap), @@ -2109,8 +2117,9 @@ btr_cur_del_mark_set_clust_rec( rec_t* rec; trx_t* trx; mem_heap_t* heap = NULL; - ulint offsets_[100] = { 100, }; + ulint offsets_[100]; ulint* offsets = offsets_; + *offsets_ = (sizeof offsets_) / sizeof *offsets_; rec = btr_cur_get_rec(cursor); index = cursor->index; @@ -2399,9 +2408,10 @@ btr_cur_optimistic_delete( ulint max_ins_size; rec_t* rec; mem_heap_t* heap = NULL; - ulint offsets_[100] = { 100, }; + ulint offsets_[100]; ulint* offsets = offsets_; ibool no_compress_needed; + *offsets_ = (sizeof offsets_) / sizeof *offsets_; ut_ad(mtr_memo_contains(mtr, buf_block_align(btr_cur_get_page(cursor)), MTR_MEMO_PAGE_X_FIX)); @@ -2803,10 +2813,12 @@ btr_estimate_number_of_different_key_vals( ulint add_on; mtr_t mtr; mem_heap_t* heap = NULL; - ulint offsets1_[100] = { 100, }; - ulint offsets2_[100] = { 100, }; + ulint offsets1_[100]; + ulint offsets2_[100]; ulint* offsets1 = offsets1_; ulint* offsets2 = offsets2_; + *offsets1_ = (sizeof offsets1_) / sizeof *offsets1_; + *offsets2_ = (sizeof offsets2_) / sizeof *offsets2_; n_cols = dict_index_get_n_unique(index); diff --git a/innobase/btr/btr0sea.c b/innobase/btr/btr0sea.c index dc712f650e7..5f95937a2cb 100644 --- a/innobase/btr/btr0sea.c +++ b/innobase/btr/btr0sea.c @@ -420,7 +420,8 @@ btr_search_update_hash_ref( && (block->curr_n_bytes == info->n_bytes) && (block->curr_side == info->side)) { mem_heap_t* heap = NULL; - ulint offsets_[100] = { 100, }; + ulint offsets_[100]; + *offsets_ = (sizeof offsets_) / sizeof *offsets_; rec = btr_cur_get_rec(cursor); @@ -552,9 +553,10 @@ btr_search_check_guess( ulint bytes; int cmp; mem_heap_t* heap = NULL; - ulint offsets_[100] = { 100, }; + ulint offsets_[100]; ulint* offsets = offsets_; ibool success = FALSE; + *offsets_ = (sizeof offsets_) / sizeof *offsets_; n_unique = dict_index_get_n_unique_in_tree(cursor->index); @@ -1098,8 +1100,9 @@ btr_search_build_page_hash_index( rec_t** recs; ulint i; mem_heap_t* heap = NULL; - ulint offsets_[100] = { 100, }; + ulint offsets_[100]; ulint* offsets = offsets_; + *offsets_ = (sizeof offsets_) / sizeof *offsets_; ut_ad(index); @@ -1341,8 +1344,9 @@ btr_search_update_hash_on_delete( ulint fold; dulint tree_id; ibool found; - ulint offsets_[100] = { 100, }; + ulint offsets_[100]; mem_heap_t* heap = NULL; + *offsets_ = (sizeof offsets_) / sizeof *offsets_; rec = btr_cur_get_rec(cursor); @@ -1452,8 +1456,9 @@ btr_search_update_hash_on_insert( ulint side; ibool locked = FALSE; mem_heap_t* heap = NULL; - ulint offsets_[100] = { 100, }; + ulint offsets_[100]; ulint* offsets = offsets_; + *offsets_ = (sizeof offsets_) / sizeof *offsets_; table = btr_search_sys->hash_index; @@ -1591,8 +1596,9 @@ btr_search_validate(void) ibool ok = TRUE; ulint i; mem_heap_t* heap = NULL; - ulint offsets_[100] = { 100, }; + ulint offsets_[100]; ulint* offsets = offsets_; + *offsets_ = (sizeof offsets_) / sizeof *offsets_; rw_lock_x_lock(&btr_search_latch); diff --git a/innobase/lock/lock0lock.c b/innobase/lock/lock0lock.c index a2560c1faae..66a746111e8 100644 --- a/innobase/lock/lock0lock.c +++ b/innobase/lock/lock0lock.c @@ -4094,8 +4094,9 @@ lock_rec_print( ulint i; mtr_t mtr; mem_heap_t* heap = NULL; - ulint offsets_[100] = { 100, }; + ulint offsets_[100]; ulint* offsets = offsets_; + *offsets_ = (sizeof offsets_) / sizeof *offsets_; #ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&kernel_mutex)); @@ -4592,8 +4593,9 @@ lock_rec_validate_page( ulint i; mtr_t mtr; mem_heap_t* heap = NULL; - ulint offsets_[100] = { 100, }; + ulint offsets_[100]; ulint* offsets = offsets_; + *offsets_ = (sizeof offsets_) / sizeof *offsets_; #ifdef UNIV_SYNC_DEBUG ut_ad(!mutex_own(&kernel_mutex)); @@ -4841,9 +4843,11 @@ lock_rec_insert_check_and_lock( #ifdef UNIV_DEBUG { mem_heap_t* heap = NULL; - ulint offsets_[100] = { 100, }; - const ulint* offsets = rec_get_offsets( - next_rec, index, offsets_, + ulint offsets_[100]; + const ulint* offsets; + *offsets_ = (sizeof offsets_) / sizeof *offsets_; + + offsets = rec_get_offsets(next_rec, index, offsets_, ULINT_UNDEFINED, &heap); ut_ad(lock_rec_queue_validate(next_rec, index, offsets)); if (heap) { @@ -4988,9 +4992,12 @@ lock_sec_rec_modify_check_and_lock( #ifdef UNIV_DEBUG { mem_heap_t* heap = NULL; - ulint offsets_[100] = { 100, }; - const ulint* offsets = rec_get_offsets( - rec, index, offsets_, ULINT_UNDEFINED, &heap); + ulint offsets_[100]; + const ulint* offsets; + *offsets_ = (sizeof offsets_) / sizeof *offsets_; + + offsets = rec_get_offsets(rec, index, offsets_, + ULINT_UNDEFINED, &heap); ut_ad(lock_rec_queue_validate(rec, index, offsets)); if (heap) { mem_heap_free(heap); @@ -5159,9 +5166,10 @@ lock_clust_rec_read_check_and_lock_alt( que_thr_t* thr) /* in: query thread */ { mem_heap_t* tmp_heap = NULL; - ulint offsets_[100] = { 100, }; + ulint offsets_[100]; ulint* offsets = offsets_; ulint ret; + *offsets_ = (sizeof offsets_) / sizeof *offsets_; offsets = rec_get_offsets(rec, index, offsets, ULINT_UNDEFINED, &tmp_heap); diff --git a/innobase/page/page0cur.c b/innobase/page/page0cur.c index d083cc26069..1b0df59d57f 100644 --- a/innobase/page/page0cur.c +++ b/innobase/page/page0cur.c @@ -59,8 +59,10 @@ page_cur_try_search_shortcut( #endif ibool success = FALSE; mem_heap_t* heap = NULL; - ulint offsets_[100] = { 100, }; + ulint offsets_[100]; ulint* offsets = offsets_; + *offsets_ = (sizeof offsets_) / sizeof *offsets_; + ut_ad(dtuple_check_typed(tuple)); rec = page_header_get_ptr(page, PAGE_LAST_INSERT); @@ -229,8 +231,9 @@ page_cur_search_with_match( ulint dbg_matched_bytes; #endif mem_heap_t* heap = NULL; - ulint offsets_[100] = { 100, }; + ulint offsets_[100]; ulint* offsets = offsets_; + *offsets_ = (sizeof offsets_) / sizeof *offsets_; ut_ad(page && tuple && iup_matched_fields && iup_matched_bytes && ilow_matched_fields && ilow_matched_bytes && cursor); @@ -517,12 +520,15 @@ page_cur_insert_rec_write_log( { mem_heap_t* heap = NULL; - ulint cur_offs_[100] = { 100, }; - ulint ins_offs_[100] = { 100, }; + ulint cur_offs_[100]; + ulint ins_offs_[100]; ulint* cur_offs; ulint* ins_offs; + *cur_offs_ = (sizeof cur_offs_) / sizeof *cur_offs_; + *ins_offs_ = (sizeof ins_offs_) / sizeof *ins_offs_; + cur_offs = rec_get_offsets(cursor_rec, index, cur_offs_, ULINT_UNDEFINED, &heap); ins_offs = rec_get_offsets(insert_rec, index, ins_offs_, @@ -671,8 +677,9 @@ page_cur_parse_insert_rec( ulint info_and_status_bits = 0; /* remove warning */ page_cur_t cursor; mem_heap_t* heap = NULL; - ulint offsets_[100] = { 100, }; + ulint offsets_[100]; ulint* offsets = offsets_; + *offsets_ = (sizeof offsets_) / sizeof *offsets_; if (!is_short) { /* Read the cursor rec offset as a 2-byte ulint */ @@ -1079,8 +1086,9 @@ page_copy_rec_list_end_to_created_page( ulint log_data_len; ibool comp = page_is_comp(page); mem_heap_t* heap = NULL; - ulint offsets_[100] = { 100, }; + ulint offsets_[100]; ulint* offsets = offsets_; + *offsets_ = (sizeof offsets_) / sizeof *offsets_; ut_ad(page_dir_get_n_heap(new_page) == 2); ut_ad(page != new_page); @@ -1268,8 +1276,9 @@ page_cur_parse_delete_rec( if (page) { mem_heap_t* heap = NULL; - ulint offsets_[100] = { 100, }; + ulint offsets_[100]; rec_t* rec = page + offset; + *offsets_ = (sizeof offsets_) / sizeof *offsets_; page_cur_position(rec, &cursor); diff --git a/innobase/page/page0page.c b/innobase/page/page0page.c index b393f0c0ad7..eb8a11f113b 100644 --- a/innobase/page/page0page.c +++ b/innobase/page/page0page.c @@ -232,8 +232,9 @@ page_mem_alloc( if (rec) { mem_heap_t* heap = NULL; - ulint offsets_[100] = { 100, }; + ulint offsets_[100]; ulint* offsets = offsets_; + *offsets_ = (sizeof offsets_) / sizeof *offsets_; offsets = rec_get_offsets(rec, index, offsets, ULINT_UNDEFINED, &heap); @@ -466,8 +467,9 @@ page_copy_rec_list_end_no_locks( page_cur_t cur2; rec_t* sup; mem_heap_t* heap = NULL; - ulint offsets_[100] = { 100, }; + ulint offsets_[100]; ulint* offsets = offsets_; + *offsets_ = (sizeof offsets_) / sizeof *offsets_; page_cur_position(rec, &cur1); @@ -566,8 +568,9 @@ page_copy_rec_list_start( page_cur_t cur2; rec_t* old_end; mem_heap_t* heap = NULL; - ulint offsets_[100] = { 100, }; + ulint offsets_[100]; ulint* offsets = offsets_; + *offsets_ = (sizeof offsets_) / sizeof *offsets_; page_cur_set_before_first(page, &cur1); @@ -747,8 +750,9 @@ page_delete_rec_list_end( if ((size == ULINT_UNDEFINED) || (n_recs == ULINT_UNDEFINED)) { mem_heap_t* heap = NULL; - ulint offsets_[100] = { 100, }; + ulint offsets_[100]; ulint* offsets = offsets_; + *offsets_ = (sizeof offsets_) / sizeof *offsets_; /* Calculate the sum of sizes and the number of records */ size = 0; n_recs = 0; @@ -831,10 +835,11 @@ page_delete_rec_list_start( { page_cur_t cur1; ulint log_mode; - ulint offsets_[100] = { 100, }; + ulint offsets_[100]; ulint* offsets = offsets_; mem_heap_t* heap = NULL; byte type; + *offsets_ = (sizeof offsets_) / sizeof *offsets_; if (index->table->comp) { type = MLOG_COMP_LIST_START_DELETE; @@ -1326,8 +1331,9 @@ page_print_list( ulint count; ulint n_recs; mem_heap_t* heap = NULL; - ulint offsets_[100] = { 100, }; + ulint offsets_[100]; ulint* offsets = offsets_; + *offsets_ = (sizeof offsets_) / sizeof *offsets_; ut_a(page_is_comp(page) == index->table->comp); @@ -1776,7 +1782,8 @@ page_validate( if (comp && page_rec_is_user_rec(rec) && rec_get_node_ptr_flag(rec) - == !btr_page_get_level_low(page)) { + != (ibool) + (btr_page_get_level_low(page) != 0)) { fputs("InnoDB: node_ptr flag mismatch\n", stderr); goto func_exit; } diff --git a/innobase/rem/rem0rec.c b/innobase/rem/rem0rec.c index 904f91b8945..94b2c692897 100644 --- a/innobase/rem/rem0rec.c +++ b/innobase/rem/rem0rec.c @@ -958,9 +958,11 @@ rec_convert_dtuple_to_rec( #ifdef UNIV_DEBUG { mem_heap_t* heap = NULL; - ulint offsets_[100 + REC_OFFS_HEADER_SIZE] - = { 100, }; - const ulint* offsets = rec_get_offsets(rec, index, + ulint offsets_[100]; + const ulint* offsets; + *offsets_ = (sizeof offsets_) / sizeof *offsets_; + + offsets = rec_get_offsets(rec, index, offsets_, ULINT_UNDEFINED, &heap); ut_ad(rec_validate(rec, offsets)); if (heap) { @@ -989,9 +991,9 @@ rec_copy_prefix_to_dtuple( ulint len; byte* buf = NULL; ulint i; - ulint offsets_[100 + REC_OFFS_HEADER_SIZE] - = { 100, }; + ulint offsets_[100]; ulint* offsets = offsets_; + *offsets_ = (sizeof offsets_) / sizeof *offsets_; offsets = rec_get_offsets(rec, index, offsets, n_fields, &heap); @@ -1405,8 +1407,9 @@ rec_print( return; } else { mem_heap_t* heap = NULL; - ulint offsets_[100 + REC_OFFS_HEADER_SIZE] - = { 100, }; + ulint offsets_[100]; + *offsets_ = (sizeof offsets_) / sizeof *offsets_; + rec_print_new(file, rec, rec_get_offsets(rec, index, offsets_, ULINT_UNDEFINED, &heap)); if (heap) { diff --git a/innobase/row/row0ins.c b/innobase/row/row0ins.c index 87ed497ba1e..99a74501ade 100644 --- a/innobase/row/row0ins.c +++ b/innobase/row/row0ins.c @@ -1134,8 +1134,9 @@ row_ins_check_foreign_constraint( mtr_t mtr; trx_t* trx = thr_get_trx(thr); mem_heap_t* heap = NULL; - ulint offsets_[100] = { 100, }; + ulint offsets_[100]; ulint* offsets = offsets_; + *offsets_ = (sizeof offsets_) / sizeof *offsets_; run_again: #ifdef UNIV_SYNC_DEBUG @@ -1558,8 +1559,9 @@ row_ins_scan_sec_index_for_duplicate( mtr_t mtr; trx_t* trx; mem_heap_t* heap = NULL; - ulint offsets_[100] = { 100, }; + ulint offsets_[100]; ulint* offsets = offsets_; + *offsets_ = (sizeof offsets_) / sizeof *offsets_; n_unique = dict_index_get_n_unique(index); @@ -1695,9 +1697,9 @@ row_ins_duplicate_error_in_clust( ulint n_unique; trx_t* trx = thr_get_trx(thr); mem_heap_t*heap = NULL; - ulint offsets_[100] = { 100, }; + ulint offsets_[100]; ulint* offsets = offsets_; - + *offsets_ = (sizeof offsets_) / sizeof *offsets_; UT_NOT_USED(mtr); @@ -1897,9 +1899,10 @@ row_ins_index_entry_low( big_rec_t* big_rec = NULL; mtr_t mtr; mem_heap_t* heap = NULL; - ulint offsets_[100] = { 100, }; + ulint offsets_[100]; ulint* offsets = offsets_; - + *offsets_ = (sizeof offsets_) / sizeof *offsets_; + log_free_check(); mtr_start(&mtr); diff --git a/innobase/row/row0mysql.c b/innobase/row/row0mysql.c index 1ee3f7d380e..fd8c2b060ef 100644 --- a/innobase/row/row0mysql.c +++ b/innobase/row/row0mysql.c @@ -3673,8 +3673,9 @@ row_scan_and_check_index( ibool contains_null; ulint i; mem_heap_t* heap = NULL; - ulint offsets_[100] = { 100, }; + ulint offsets_[100]; ulint* offsets = offsets_; + *offsets_ = (sizeof offsets_) / sizeof *offsets_; *n_rows = 0; diff --git a/innobase/row/row0purge.c b/innobase/row/row0purge.c index 8897a1a872f..659a13b42a9 100644 --- a/innobase/row/row0purge.c +++ b/innobase/row/row0purge.c @@ -101,7 +101,8 @@ row_purge_remove_clust_if_poss_low( mtr_t mtr; rec_t* rec; mem_heap_t* heap = NULL; - ulint offsets_[100] = { 100, }; + ulint offsets_[100]; + *offsets_ = (sizeof offsets_) / sizeof *offsets_; index = dict_table_get_first_index(node->table); diff --git a/innobase/row/row0row.c b/innobase/row/row0row.c index 438e54757cd..4f080c22af3 100644 --- a/innobase/row/row0row.c +++ b/innobase/row/row0row.c @@ -203,7 +203,8 @@ row_build( byte* buf; ulint i; mem_heap_t* tmp_heap = NULL; - ulint offsets_[100] = { 100, }; + ulint offsets_[100]; + *offsets_ = (sizeof offsets_) / sizeof *offsets_; ut_ad(index && rec && heap); ut_ad(index->type & DICT_CLUSTERED); @@ -296,8 +297,9 @@ row_rec_to_index_entry( ulint rec_len; byte* buf; mem_heap_t* tmp_heap = NULL; - ulint offsets_[100] = { 100, }; + ulint offsets_[100]; ulint* offsets = offsets_; + *offsets_ = (sizeof offsets_) / sizeof *offsets_; ut_ad(rec && heap && index); @@ -377,8 +379,9 @@ row_build_row_ref( ulint clust_col_prefix_len; ulint i; mem_heap_t* tmp_heap = NULL; - ulint offsets_[100] = { 100, }; + ulint offsets_[100]; ulint* offsets = offsets_; + *offsets_ = (sizeof offsets_) / sizeof *offsets_; ut_ad(index && rec && heap); @@ -470,8 +473,9 @@ row_build_row_ref_in_tuple( ulint clust_col_prefix_len; ulint i; mem_heap_t* heap = NULL; - ulint offsets_[100] = { 100, }; + ulint offsets_[100]; ulint* offsets = offsets_; + *offsets_ = (sizeof offsets_) / sizeof *offsets_; ut_a(ref && index && rec); diff --git a/innobase/row/row0sel.c b/innobase/row/row0sel.c index 7a5e4cb9264..16e2dc69e0b 100644 --- a/innobase/row/row0sel.c +++ b/innobase/row/row0sel.c @@ -79,14 +79,15 @@ row_sel_sec_rec_is_for_clust_rec( ulint i; dtype_t* cur_type; mem_heap_t* heap = NULL; - ulint clust_offsets_[100] - = { 100, }; - ulint sec_offsets_[10] - = { 10, }; + ulint clust_offsets_[100]; + ulint sec_offsets_[10]; ulint* clust_offs = clust_offsets_; ulint* sec_offs = sec_offsets_; ibool is_equal = TRUE; + *clust_offsets_ = (sizeof clust_offsets_) / sizeof *clust_offsets_; + *sec_offsets_ = (sizeof sec_offsets_) / sizeof *sec_offsets_; + clust_offs = rec_get_offsets(clust_rec, clust_index, clust_offs, ULINT_UNDEFINED, &heap); sec_offs = rec_get_offsets(sec_rec, sec_index, sec_offs, @@ -625,8 +626,9 @@ row_sel_get_clust_rec( rec_t* old_vers; ulint err; mem_heap_t* heap = NULL; - ulint offsets_[100] = { 100, }; + ulint offsets_[100]; ulint* offsets = offsets_; + *offsets_ = (sizeof offsets_) / sizeof *offsets_; offsets = rec_get_offsets(rec, btr_pcur_get_btr_cur(&plan->pcur)->index, @@ -990,9 +992,10 @@ row_sel_try_search_shortcut( dict_index_t* index; rec_t* rec; mem_heap_t* heap = NULL; - ulint offsets_[100] = { 100, }; + ulint offsets_[100]; ulint* offsets = offsets_; ulint ret; + *offsets_ = (sizeof offsets_) / sizeof *offsets_; index = plan->index; @@ -1115,8 +1118,9 @@ row_sel( ulint found_flag; ulint err; mem_heap_t* heap = NULL; - ulint offsets_[100] = { 100, }; + ulint offsets_[100]; ulint* offsets = offsets_; + *offsets_ = (sizeof offsets_) / sizeof *offsets_; ut_ad(thr->run_node == node); @@ -3035,9 +3039,10 @@ row_search_for_mysql( ulint next_offs; mtr_t mtr; mem_heap_t* heap = NULL; - ulint offsets_[100] = { 100, }; + ulint offsets_[100]; ulint* offsets = offsets_; - + *offsets_ = (sizeof offsets_) / sizeof *offsets_; + ut_ad(index && pcur && search_tuple); ut_ad(trx->mysql_thread_id == os_thread_get_curr_id()); diff --git a/innobase/row/row0undo.c b/innobase/row/row0undo.c index d994eab9873..895303e361c 100644 --- a/innobase/row/row0undo.c +++ b/innobase/row/row0undo.c @@ -152,8 +152,9 @@ row_undo_search_clust_to_pcur( ibool ret; rec_t* rec; mem_heap_t* heap = NULL; - ulint offsets_[100] = { 100, }; + ulint offsets_[100]; ulint* offsets = offsets_; + *offsets_ = (sizeof offsets_) / sizeof *offsets_; mtr_start(&mtr); diff --git a/innobase/row/row0upd.c b/innobase/row/row0upd.c index 173912d6956..d04e3c3aef1 100644 --- a/innobase/row/row0upd.c +++ b/innobase/row/row0upd.c @@ -706,8 +706,9 @@ row_upd_build_sec_rec_difference_binary( upd_t* update; ulint n_diff; ulint i; - ulint offsets_[10] = { 10, }; + ulint offsets_[10]; const ulint* offsets; + *offsets_ = (sizeof offsets_) / sizeof *offsets_; /* This function is used only for a secondary index */ ut_a(0 == (index->type & DICT_CLUSTERED)); @@ -783,8 +784,9 @@ row_upd_build_difference_binary( ulint trx_id_pos; ibool extern_bit; ulint i; - ulint offsets_[100] = { 100, }; + ulint offsets_[100]; const ulint* offsets; + *offsets_ = (sizeof offsets_) / sizeof *offsets_; /* This function is used only for a clustered index */ ut_a(index->type & DICT_CLUSTERED); @@ -1193,8 +1195,9 @@ row_upd_store_row( upd_t* update; rec_t* rec; mem_heap_t* heap = NULL; - ulint offsets_[100] = { 100, }; + ulint offsets_[100]; const ulint* offsets; + *offsets_ = (sizeof offsets_) / sizeof *offsets_; ut_ad(node->pcur->latch_mode != BTR_NO_LATCHES); @@ -1393,7 +1396,8 @@ row_upd_clust_rec_by_insert( btr_cur = btr_pcur_get_btr_cur(pcur); if (node->state != UPD_NODE_INSERT_CLUSTERED) { - ulint offsets_[100] = { 100, }; + ulint offsets_[100]; + *offsets_ = (sizeof offsets_) / sizeof *offsets_; err = btr_cur_del_mark_set_clust_rec(BTR_NO_LOCKING_FLAG, btr_cur, TRUE, thr, mtr); @@ -1533,8 +1537,10 @@ row_upd_clust_rec( if (err == DB_SUCCESS && big_rec) { mem_heap_t* heap = NULL; - ulint offsets_[100] = { 100, }; + ulint offsets_[100]; rec_t* rec; + *offsets_ = (sizeof offsets_) / sizeof *offsets_; + mtr_start(mtr); ut_a(btr_pcur_restore_position(BTR_MODIFY_TREE, pcur, mtr)); @@ -1631,8 +1637,9 @@ row_upd_clust_step( mtr_t mtr_buf; rec_t* rec; mem_heap_t* heap = NULL; - ulint offsets_[100] = { 100, }; + ulint offsets_[100]; const ulint* offsets; + *offsets_ = (sizeof offsets_) / sizeof *offsets_; index = dict_table_get_first_index(node->table); @@ -1988,7 +1995,8 @@ row_upd_in_place_in_select( btr_cur_t* btr_cur; ulint err; mem_heap_t* heap = NULL; - ulint offsets_[100] = { 100, }; + ulint offsets_[100]; + *offsets_ = (sizeof offsets_) / sizeof *offsets_; ut_ad(sel_node->select_will_do_update); ut_ad(sel_node->latch_mode == BTR_MODIFY_LEAF); diff --git a/innobase/trx/trx0rec.c b/innobase/trx/trx0rec.c index 90ecb217c1d..7b62137ba09 100644 --- a/innobase/trx/trx0rec.c +++ b/innobase/trx/trx0rec.c @@ -1016,8 +1016,9 @@ trx_undo_report_row_operation( trx_rseg_t* rseg; mtr_t mtr; mem_heap_t* heap = NULL; - ulint offsets_[100] = { 100, }; + ulint offsets_[100]; ulint* offsets = offsets_; + *offsets_ = (sizeof offsets_) / sizeof *offsets_; ut_a(index->type & DICT_CLUSTERED);