diff --git a/btr/btr0btr.c b/btr/btr0btr.c index 3061d18e1c3..86a7dd0a161 100644 --- a/btr/btr0btr.c +++ b/btr/btr0btr.c @@ -147,7 +147,7 @@ btr_root_get( root = btr_page_get(space, root_page_no, RW_X_LATCH, mtr); ut_a((ibool)!!page_is_comp(root) == - UT_LIST_GET_FIRST(tree->tree_indexes)->table->comp); + dict_table_is_comp(UT_LIST_GET_FIRST(tree->tree_indexes)->table)); return(root); } @@ -870,7 +870,7 @@ btr_page_reorganize_low( ut_ad(mtr_memo_contains(mtr, buf_block_align(page), MTR_MEMO_PAGE_X_FIX)); - ut_ad((ibool) !!page_is_comp(page) == index->table->comp); + ut_ad(!!page_is_comp(page) == dict_table_is_comp(index->table)); data_size1 = page_get_data_size(page); max_ins_size1 = page_get_max_insert_size_after_reorganize(page, 1); @@ -2143,7 +2143,8 @@ btr_compress( page = btr_cur_get_page(cursor); page_zip = buf_block_get_page_zip(buf_block_align(page)); tree = btr_cur_get_tree(cursor); - ut_a((ibool)!!page_is_comp(page) == cursor->index->table->comp); + ut_a((ibool) !!page_is_comp(page) + == dict_table_is_comp(cursor->index->table) ); ut_ad(mtr_memo_contains(mtr, dict_tree_get_lock(tree), MTR_MEMO_X_LOCK)); @@ -2654,11 +2655,13 @@ btr_index_rec_validate( return(TRUE); } - if (UNIV_UNLIKELY((ibool)!!page_is_comp(page) != index->table->comp)) { + if (UNIV_UNLIKELY((ibool)!!page_is_comp(page) + != dict_table_is_comp(index->table))) { btr_index_rec_validate_report(page, rec, index); fprintf(stderr, "InnoDB: compact flag=%lu, should be %lu\n", (ulong) !!page_is_comp(page), - (ulong) index->table->comp); + (ulong) dict_table_is_comp(index->table)); + return(FALSE); } diff --git a/btr/btr0cur.c b/btr/btr0cur.c index 4357a57162d..d20c2ae7fe9 100644 --- a/btr/btr0cur.c +++ b/btr/btr0cur.c @@ -545,7 +545,7 @@ retry_page_get: page = btr_page_get(space, page_no, RW_X_LATCH, mtr); ut_a((ibool)!!page_is_comp(page) - == index->table->comp); + == dict_table_is_comp(index->table)); } break; @@ -1413,7 +1413,7 @@ btr_cur_update_in_place_log( byte* log_ptr; page_t* page = ut_align_down(rec, UNIV_PAGE_SIZE); ut_ad(flags < 256); - ut_ad(!!page_is_comp(page) == index->table->comp); + ut_ad(!!page_is_comp(page) == dict_table_is_comp(index->table)); log_ptr = mlog_open_and_write_index(mtr, rec, index, page_is_comp(page) ? MLOG_COMP_REC_UPDATE_IN_PLACE @@ -1500,7 +1500,7 @@ btr_cur_parse_update_in_place( goto func_exit; } - ut_a((ibool)!!page_is_comp(page) == index->table->comp); + ut_a((ibool)!!page_is_comp(page) == dict_table_is_comp(index->table)); rec = page + rec_offset; /* We do not need to reserve btr_search_latch, as the page is only @@ -1554,7 +1554,7 @@ btr_cur_update_in_place( rec = btr_cur_get_rec(cursor); index = cursor->index; - ut_ad(!!page_rec_is_comp(rec) == index->table->comp); + ut_ad(!!page_rec_is_comp(rec) == dict_table_is_comp(index->table)); trx = thr_get_trx(thr); offsets = rec_get_offsets(rec, index, offsets, ULINT_UNDEFINED, &heap); #ifdef UNIV_DEBUG @@ -1686,7 +1686,7 @@ btr_cur_optimistic_update( page = btr_cur_get_page(cursor); orig_rec = rec = btr_cur_get_rec(cursor); index = cursor->index; - ut_ad(!!page_rec_is_comp(rec) == index->table->comp); + ut_ad(!!page_rec_is_comp(rec) == dict_table_is_comp(index->table)); heap = mem_heap_create(1024); offsets = rec_get_offsets(rec, index, NULL, ULINT_UNDEFINED, &heap); @@ -2158,7 +2158,7 @@ btr_cur_del_mark_set_clust_rec_log( ut_ad(flags < 256); ut_ad(val <= 1); - ut_ad(!!page_rec_is_comp(rec) == index->table->comp); + ut_ad(!!page_rec_is_comp(rec) == dict_table_is_comp(index->table)); log_ptr = mlog_open_and_write_index(mtr, rec, index, page_rec_is_comp(rec) @@ -2206,7 +2206,8 @@ btr_cur_parse_del_mark_set_clust_rec( ulint offset; rec_t* rec; - ut_ad(!page || !!page_is_comp(page) == index->table->comp); + ut_ad(!page + || !!page_is_comp(page) == dict_table_is_comp(index->table)); if (end_ptr < ptr + 2) { @@ -2294,7 +2295,7 @@ btr_cur_del_mark_set_clust_rec( rec = btr_cur_get_rec(cursor); index = cursor->index; - ut_ad(!!page_rec_is_comp(rec) == index->table->comp); + ut_ad(!!page_rec_is_comp(rec) == dict_table_is_comp(index->table)); offsets = rec_get_offsets(rec, index, offsets, ULINT_UNDEFINED, &heap); #ifdef UNIV_DEBUG @@ -2468,7 +2469,7 @@ btr_cur_del_mark_set_sec_rec( block = buf_block_align(rec); ut_ad(!!page_is_comp(buf_block_get_frame(block)) - == cursor->index->table->comp); + == dict_table_is_comp(cursor->index->table)); page_zip = buf_block_get_page_zip(block); if (block->is_hashed) { @@ -3937,7 +3938,7 @@ btr_rec_free_externally_stored_fields( MTR_MEMO_PAGE_X_FIX)); /* Free possible externally stored fields in the record */ - ut_ad(index->table->comp == !!rec_offs_comp(offsets)); + ut_ad(dict_table_is_comp(index->table) == !!rec_offs_comp(offsets)); n_fields = rec_offs_n_fields(offsets); for (i = 0; i < n_fields; i++) { diff --git a/data/data0data.c b/data/data0data.c index 32813ceed47..52b364dc249 100644 --- a/data/data0data.c +++ b/data/data0data.c @@ -525,9 +525,9 @@ dtuple_convert_big_rec( n_fields = 0; while (rec_get_converted_size(index, entry) - >= ut_min(page_get_free_space_of_empty( - index->table->comp) / 2, - REC_MAX_DATA_SIZE)) { + >= ut_min(page_get_free_space_of_empty( + dict_table_is_comp(index->table)) / 2, + REC_MAX_DATA_SIZE)) { longest = 0; for (i = dict_index_get_n_unique_in_tree(index); diff --git a/dict/dict0boot.c b/dict/dict0boot.c index 07d0a7173b8..66360386380 100644 --- a/dict/dict0boot.c +++ b/dict/dict0boot.c @@ -250,7 +250,7 @@ dict_boot(void) /* Insert into the dictionary cache the descriptions of the basic system tables */ /*-------------------------*/ - table = dict_mem_table_create("SYS_TABLES", DICT_HDR_SPACE, 8, FALSE); + table = dict_mem_table_create("SYS_TABLES", DICT_HDR_SPACE, 8, 0); dict_mem_table_add_col(table, "NAME", DATA_BINARY, 0, 0, 0); dict_mem_table_add_col(table, "ID", DATA_BINARY, 0, 0, 0); @@ -286,7 +286,7 @@ dict_boot(void) dict_hdr + DICT_HDR_TABLE_IDS, MLOG_4BYTES, &mtr)); ut_a(success); /*-------------------------*/ - table = dict_mem_table_create("SYS_COLUMNS", DICT_HDR_SPACE, 7, FALSE); + table = dict_mem_table_create("SYS_COLUMNS", DICT_HDR_SPACE, 7, 0); dict_mem_table_add_col(table, "TABLE_ID", DATA_BINARY,0,0,0); dict_mem_table_add_col(table, "POS", DATA_INT, 0, 4, 0); @@ -312,7 +312,7 @@ dict_boot(void) dict_hdr + DICT_HDR_COLUMNS, MLOG_4BYTES, &mtr)); ut_a(success); /*-------------------------*/ - table = dict_mem_table_create("SYS_INDEXES", DICT_HDR_SPACE, 7, FALSE); + table = dict_mem_table_create("SYS_INDEXES", DICT_HDR_SPACE, 7, 0); dict_mem_table_add_col(table, "TABLE_ID", DATA_BINARY, 0,0,0); dict_mem_table_add_col(table, "ID", DATA_BINARY, 0, 0, 0); @@ -348,7 +348,7 @@ dict_boot(void) dict_hdr + DICT_HDR_INDEXES, MLOG_4BYTES, &mtr)); ut_a(success); /*-------------------------*/ - table = dict_mem_table_create("SYS_FIELDS", DICT_HDR_SPACE, 3, FALSE); + table = dict_mem_table_create("SYS_FIELDS", DICT_HDR_SPACE, 3, 0); dict_mem_table_add_col(table, "INDEX_ID", DATA_BINARY, 0,0,0); dict_mem_table_add_col(table, "POS", DATA_INT, 0, 4, 0); diff --git a/dict/dict0crea.c b/dict/dict0crea.c index 10311cdd657..18950110aad 100644 --- a/dict/dict0crea.c +++ b/dict/dict0crea.c @@ -62,9 +62,13 @@ dict_create_sys_tables_tuple( /* 4: N_COLS ---------------------------*/ dfield = dtuple_get_nth_field(entry, 2); +#if DICT_TF_COMPACT != 1 +#error +#endif + ptr = mem_heap_alloc(heap, 4); mach_write_to_4(ptr, table->n_def - | ((ulint) table->comp << 31)); + | ((table->flags & DICT_TF_COMPACT) << 31)); dfield_set_data(dfield, ptr, 4); /* 5: TYPE -----------------------------*/ dfield = dtuple_get_nth_field(entry, 3); @@ -671,7 +675,7 @@ dict_drop_index_tree( ut_ad(mutex_own(&(dict_sys->mutex))); #endif /* UNIV_SYNC_DEBUG */ - ut_a(!dict_sys->sys_indexes->comp); + ut_a(!dict_table_is_comp(dict_sys->sys_indexes)); ptr = rec_get_nth_field_old(rec, DICT_SYS_INDEXES_PAGE_NO_FIELD, &len); ut_ad(len == 4); @@ -743,7 +747,7 @@ dict_truncate_index_tree( ut_ad(mutex_own(&(dict_sys->mutex))); #endif /* UNIV_SYNC_DEBUG */ - ut_a(!dict_sys->sys_indexes->comp); + ut_a(!dict_table_is_comp(dict_sys->sys_indexes)); ptr = rec_get_nth_field_old(rec, DICT_SYS_INDEXES_PAGE_NO_FIELD, &len); ut_ad(len == 4); diff --git a/dict/dict0dict.c b/dict/dict0dict.c index da5034f04e1..e8725eca542 100644 --- a/dict/dict0dict.c +++ b/dict/dict0dict.c @@ -2984,8 +2984,7 @@ loop: command, determine if there are any foreign keys, and if so, immediately reject the command if the table is a temporary one. For now, this kludge will work. */ - if (reject_fks && (UT_LIST_GET_LEN(table->foreign_list) > 0)) - { + if (reject_fks && (UT_LIST_GET_LEN(table->foreign_list) > 0)) { return DB_CANNOT_ADD_CONSTRAINT; } @@ -3702,7 +3701,7 @@ dict_tree_find_index_low( && UNIV_UNLIKELY(table->type != DICT_TABLE_ORDINARY)) { /* Get the mix id of the record */ - ut_a(!table->comp); + ut_a(!dict_table_is_comp(table)); mix_id = mach_dulint_read_compressed( rec_get_nth_field_old(rec, table->mix_len, &len)); @@ -3798,7 +3797,7 @@ dict_is_mixed_table_rec( byte* mix_id_field; ulint len; - ut_ad(!table->comp); + ut_ad(!dict_table_is_comp(table)); mix_id_field = rec_get_nth_field_old(rec, table->mix_len, &len); @@ -3861,7 +3860,7 @@ dict_tree_build_node_ptr( on non-leaf levels we remove the last field, which contains the page number of the child page */ - ut_a(!ind->table->comp); + ut_a(!dict_table_is_comp(ind->table)); n_unique = rec_get_n_fields_old(rec); if (level > 0) { @@ -3924,7 +3923,7 @@ dict_tree_copy_rec_order_prefix( index = dict_tree_find_index_low(tree, rec); if (UNIV_UNLIKELY(tree->type & DICT_UNIVERSAL)) { - ut_a(!index->table->comp); + ut_a(!dict_table_is_comp(index->table)); n = rec_get_n_fields_old(rec); } else { n = dict_index_get_n_unique_in_tree(index); @@ -3951,7 +3950,8 @@ dict_tree_build_data_tuple( ind = dict_tree_find_index_low(tree, rec); - ut_ad(ind->table->comp || n_fields <= rec_get_n_fields_old(rec)); + ut_ad(dict_table_is_comp(ind->table) + || n_fields <= rec_get_n_fields_old(rec)); tuple = dtuple_create(heap, n_fields); @@ -3975,7 +3975,7 @@ dict_index_calc_min_rec_len( ulint sum = 0; ulint i; - if (UNIV_LIKELY(index->table->comp)) { + if (dict_table_is_comp(index->table)) { ulint nullable = 0; sum = REC_N_NEW_EXTRA_BYTES; for (i = 0; i < dict_index_get_n_fields(index); i++) { @@ -4128,7 +4128,7 @@ dict_foreign_print_low( } fprintf(stderr, " )\n" - " REFERENCES %s (", + " REFERENCES %s (", foreign->referenced_table_name); for (i = 0; i < foreign->n_fields; i++) { diff --git a/dict/dict0load.c b/dict/dict0load.c index 066aba631ee..09935c03288 100644 --- a/dict/dict0load.c +++ b/dict/dict0load.c @@ -58,7 +58,7 @@ dict_get_first_table_name_in_db( sys_tables = dict_table_get_low("SYS_TABLES"); sys_index = UT_LIST_GET_FIRST(sys_tables->indexes); - ut_a(!sys_tables->comp); + ut_a(!dict_table_is_comp(sys_tables)); tuple = dtuple_create(heap, 1); dfield = dtuple_get_nth_field(tuple, 0); @@ -94,7 +94,7 @@ loop: return(NULL); } - if (!rec_get_deleted_flag(rec, sys_tables->comp)) { + if (!rec_get_deleted_flag(rec, 0)) { /* We found one */ @@ -169,7 +169,7 @@ loop: field = rec_get_nth_field_old(rec, 0, &len); - if (!rec_get_deleted_flag(rec, sys_tables->comp)) { + if (!rec_get_deleted_flag(rec, 0)) { /* We found one */ @@ -235,7 +235,7 @@ dict_check_tablespaces_and_store_max_id( sys_tables = dict_table_get_low("SYS_TABLES"); sys_index = UT_LIST_GET_FIRST(sys_tables->indexes); - ut_a(!sys_tables->comp); + ut_a(!dict_table_is_comp(sys_tables)); btr_pcur_open_at_index_side(TRUE, sys_index, BTR_SEARCH_LEAF, &pcur, TRUE, &mtr); @@ -264,7 +264,7 @@ loop: field = rec_get_nth_field_old(rec, 0, &len); - if (!rec_get_deleted_flag(rec, sys_tables->comp)) { + if (!rec_get_deleted_flag(rec, 0)) { /* We found one */ @@ -343,7 +343,7 @@ dict_load_columns( sys_columns = dict_table_get_low("SYS_COLUMNS"); sys_index = UT_LIST_GET_FIRST(sys_columns->indexes); - ut_a(!sys_columns->comp); + ut_a(!dict_table_is_comp(sys_columns)); tuple = dtuple_create(heap, 1); dfield = dtuple_get_nth_field(tuple, 0); @@ -362,7 +362,7 @@ dict_load_columns( ut_a(btr_pcur_is_on_user_rec(&pcur, &mtr)); - ut_a(!rec_get_deleted_flag(rec, sys_columns->comp)); + ut_a(!rec_get_deleted_flag(rec, 0)); field = rec_get_nth_field_old(rec, 0, &len); ut_ad(len == 8); @@ -476,7 +476,7 @@ dict_load_fields( sys_fields = dict_table_get_low("SYS_FIELDS"); sys_index = UT_LIST_GET_FIRST(sys_fields->indexes); - ut_a(!sys_fields->comp); + ut_a(!dict_table_is_comp(sys_fields)); tuple = dtuple_create(heap, 1); dfield = dtuple_get_nth_field(tuple, 0); @@ -494,7 +494,7 @@ dict_load_fields( rec = btr_pcur_get_rec(&pcur); ut_a(btr_pcur_is_on_user_rec(&pcur, &mtr)); - if (rec_get_deleted_flag(rec, sys_fields->comp)) { + if (rec_get_deleted_flag(rec, 0)) { dict_load_report_deleted_index(table->name, i); } @@ -589,7 +589,7 @@ dict_load_indexes( sys_indexes = dict_table_get_low("SYS_INDEXES"); sys_index = UT_LIST_GET_FIRST(sys_indexes->indexes); - ut_a(!sys_indexes->comp); + ut_a(!dict_table_is_comp(sys_indexes)); tuple = dtuple_create(heap, 1); dfield = dtuple_get_nth_field(tuple, 0); @@ -617,7 +617,7 @@ dict_load_indexes( break; } - if (rec_get_deleted_flag(rec, table->comp)) { + if (rec_get_deleted_flag(rec, dict_table_is_comp(table))) { dict_load_report_deleted_index(table->name, ULINT_UNDEFINED); @@ -739,6 +739,7 @@ dict_load_table( ulint len; ulint space; ulint n_cols; + ulint flags; ulint err; mtr_t mtr; @@ -752,7 +753,7 @@ dict_load_table( sys_tables = dict_table_get_low("SYS_TABLES"); sys_index = UT_LIST_GET_FIRST(sys_tables->indexes); - ut_a(!sys_tables->comp); + ut_a(!dict_table_is_comp(sys_tables)); tuple = dtuple_create(heap, 1); dfield = dtuple_get_nth_field(tuple, 0); @@ -765,7 +766,7 @@ dict_load_table( rec = btr_pcur_get_rec(&pcur); if (!btr_pcur_is_on_user_rec(&pcur, &mtr) - || rec_get_deleted_flag(rec, sys_tables->comp)) { + || rec_get_deleted_flag(rec, 0)) { /* Not found */ btr_pcur_close(&pcur); @@ -827,10 +828,15 @@ dict_load_table( field = rec_get_nth_field_old(rec, 4, &len); n_cols = mach_read_from_4(field); + flags = 0; + /* The high-order bit of N_COLS is the "compact format" flag. */ - table = dict_mem_table_create(name, space, - n_cols & ~0x80000000UL, - !!(n_cols & 0x80000000UL)); + if (n_cols & 0x80000000UL) { + flags |= DICT_TF_COMPACT; + } + + table = dict_mem_table_create(name, space, n_cols & ~0x80000000UL, + flags); table->ibd_file_missing = ibd_file_missing; @@ -938,7 +944,7 @@ dict_load_table_on_id( sys_tables = dict_sys->sys_tables; sys_table_ids = dict_table_get_next_index( dict_table_get_first_index(sys_tables)); - ut_a(!sys_tables->comp); + ut_a(!dict_table_is_comp(sys_tables)); heap = mem_heap_create(256); tuple = dtuple_create(heap, 1); @@ -955,7 +961,7 @@ dict_load_table_on_id( rec = btr_pcur_get_rec(&pcur); if (!btr_pcur_is_on_user_rec(&pcur, &mtr) - || rec_get_deleted_flag(rec, sys_tables->comp)) { + || rec_get_deleted_flag(rec, 0)) { /* Not found */ btr_pcur_close(&pcur); @@ -1052,7 +1058,7 @@ dict_load_foreign_cols( sys_foreign_cols = dict_table_get_low("SYS_FOREIGN_COLS"); sys_index = UT_LIST_GET_FIRST(sys_foreign_cols->indexes); - ut_a(!sys_foreign_cols->comp); + ut_a(!dict_table_is_comp(sys_foreign_cols)); tuple = dtuple_create(foreign->heap, 1); dfield = dtuple_get_nth_field(tuple, 0); @@ -1067,7 +1073,7 @@ dict_load_foreign_cols( rec = btr_pcur_get_rec(&pcur); ut_a(btr_pcur_is_on_user_rec(&pcur, &mtr)); - ut_a(!rec_get_deleted_flag(rec, sys_foreign_cols->comp)); + ut_a(!rec_get_deleted_flag(rec, 0)); field = rec_get_nth_field_old(rec, 0, &len); ut_a(len == ut_strlen(id)); @@ -1125,7 +1131,7 @@ dict_load_foreign( sys_foreign = dict_table_get_low("SYS_FOREIGN"); sys_index = UT_LIST_GET_FIRST(sys_foreign->indexes); - ut_a(!sys_foreign->comp); + ut_a(!dict_table_is_comp(sys_foreign)); tuple = dtuple_create(heap2, 1); dfield = dtuple_get_nth_field(tuple, 0); @@ -1138,7 +1144,7 @@ dict_load_foreign( rec = btr_pcur_get_rec(&pcur); if (!btr_pcur_is_on_user_rec(&pcur, &mtr) - || rec_get_deleted_flag(rec, sys_foreign->comp)) { + || rec_get_deleted_flag(rec, 0)) { /* Not found */ fprintf(stderr, @@ -1260,7 +1266,7 @@ dict_load_foreigns( return(DB_ERROR); } - ut_a(!sys_foreign->comp); + ut_a(!dict_table_is_comp(sys_foreign)); mtr_start(&mtr); /* Get the secondary index based on FOR_NAME from table @@ -1315,7 +1321,7 @@ loop: goto next_rec; } - if (rec_get_deleted_flag(rec, sys_foreign->comp)) { + if (rec_get_deleted_flag(rec, 0)) { goto next_rec; } diff --git a/dict/dict0mem.c b/dict/dict0mem.c index 4dc91e9e2bd..ead12e8f5c8 100644 --- a/dict/dict0mem.c +++ b/dict/dict0mem.c @@ -36,13 +36,13 @@ dict_mem_table_create( ignored if the table is made a member of a cluster */ ulint n_cols, /* in: number of columns */ - ibool comp) /* in: TRUE=compact page format */ + ulint flags) /* in: table flags */ { dict_table_t* table; mem_heap_t* heap; ut_ad(name); - ut_ad(comp == FALSE || comp == TRUE); + ut_ad(!(flags & ~DICT_TF_COMPACT)); heap = mem_heap_create(DICT_HEAP_SIZE); @@ -51,12 +51,12 @@ dict_mem_table_create( table->heap = heap; table->type = DICT_TABLE_ORDINARY; + table->flags = flags; table->name = mem_heap_strdup(heap, name); table->dir_path_of_temp_table = NULL; table->space = space; table->ibd_file_missing = FALSE; table->tablespace_discarded = FALSE; - table->comp = comp; table->zip = 0; table->n_def = 0; table->n_cols = n_cols + DATA_N_SYS_COLS; @@ -115,7 +115,7 @@ dict_mem_cluster_create( dict_table_t* cluster; /* Clustered tables cannot work with the compact record format. */ - cluster = dict_mem_table_create(name, space, n_cols, FALSE); + cluster = dict_mem_table_create(name, space, n_cols, 0); cluster->type = DICT_TABLE_CLUSTER; cluster->mix_len = mix_len; diff --git a/fil/fil0fil.c b/fil/fil0fil.c index 19f4a7abfd5..7418420628e 100644 --- a/fil/fil0fil.c +++ b/fil/fil0fil.c @@ -2200,7 +2200,7 @@ retry: if (count > 1000) { ut_print_timestamp(stderr); - fputs(" InnoDB: Warning: problems renaming ", stderr); + fputs(" InnoDB: Warning: problems renaming ", stderr); ut_print_filename(stderr, old_name); fputs(" to ", stderr); ut_print_filename(stderr, new_name); @@ -2353,7 +2353,7 @@ fil_create_new_single_table_tablespace( OS_DATA_FILE, &ret); if (ret == FALSE) { ut_print_timestamp(stderr); - fputs(" InnoDB: Error creating file ", stderr); + fputs(" InnoDB: Error creating file ", stderr); ut_print_filename(stderr, path); fputs(".\n", stderr); @@ -3351,7 +3351,7 @@ fil_space_for_table_exists_in_mem( if (space == NULL) { if (namespace == NULL) { ut_print_timestamp(stderr); - fputs(" InnoDB: Error: table ", stderr); + fputs(" InnoDB: Error: table ", stderr); ut_print_filename(stderr, name); fprintf(stderr, "\n" "InnoDB: in InnoDB data dictionary has tablespace id %lu,\n" @@ -3363,7 +3363,7 @@ fil_space_for_table_exists_in_mem( (ulong) id); } else { ut_print_timestamp(stderr); - fputs(" InnoDB: Error: table ", stderr); + fputs(" InnoDB: Error: table ", stderr); ut_print_filename(stderr, name); fprintf(stderr, "\n" "InnoDB: in InnoDB data dictionary has tablespace id %lu,\n" @@ -3388,7 +3388,7 @@ fil_space_for_table_exists_in_mem( if (0 != strcmp(space->name, path)) { ut_print_timestamp(stderr); - fputs(" InnoDB: Error: table ", stderr); + fputs(" InnoDB: Error: table ", stderr); ut_print_filename(stderr, name); fprintf(stderr, "\n" "InnoDB: in InnoDB data dictionary has tablespace id %lu,\n" diff --git a/handler/ha_innodb.cc b/handler/ha_innodb.cc index aa2237a3ef3..af2544935dc 100644 --- a/handler/ha_innodb.cc +++ b/handler/ha_innodb.cc @@ -626,8 +626,7 @@ innobase_mysql_print_thd( /* Points to buf or dyn_str. */ char* str = buf; - if (max_query_len == 0) - { + if (max_query_len == 0) { /* ADDITIONAL SAFETY: the default is to print at most 300 chars to reduce the probability of a seg fault if there is a race in @@ -639,8 +638,7 @@ innobase_mysql_print_thd( len = min(thd->query_length, max_query_len); - if (len > (sizeof(buf) - 1)) - { + if (len > (sizeof(buf) - 1)) { dyn_str = my_malloc(len + 1, MYF(0)); str = dyn_str; } @@ -651,8 +649,7 @@ innobase_mysql_print_thd( putc('\n', f); fwrite(str, 1, len, f); - if (dyn_str) - { + if (dyn_str) { my_free(dyn_str, MYF(0)); } } @@ -2309,7 +2306,7 @@ ha_innobase::get_row_type() const row_prebuilt_t* prebuilt = (row_prebuilt_t*) innobase_prebuilt; if (prebuilt && prebuilt->table) { - if (prebuilt->table->comp) { + if (dict_table_is_comp(prebuilt->table)) { return(ROW_TYPE_COMPACT); } else { return(ROW_TYPE_REDUNDANT); @@ -3697,12 +3694,12 @@ calc_row_difference( if (n_len != UNIV_SQL_NULL) { buf = row_mysql_store_col_in_innobase_format( - &dfield, - (byte*)buf, - TRUE, - new_mysql_row_col, - col_pack_len, - prebuilt->table->comp); + &dfield, + (byte*)buf, + TRUE, + new_mysql_row_col, + col_pack_len, + dict_table_is_comp(prebuilt->table)); ufield->new_val.data = dfield.data; ufield->new_val.len = dfield.len; } else { @@ -4586,7 +4583,7 @@ create_table_def( an .ibd file for it (no .ibd extension in the path, though); otherwise this is NULL */ - ibool comp) /* in: TRUE=compact record format */ + ulint flags) /* in: table flags */ { Field* field; dict_table_t* table; @@ -4609,7 +4606,7 @@ create_table_def( /* We pass 0 as the space id, and determine at a lower level the space id where to store the table */ - table = dict_mem_table_create(table_name, 0, n_cols, comp); + table = dict_mem_table_create(table_name, 0, n_cols, flags); if (path_of_temp_table) { table->dir_path_of_temp_table = @@ -4855,6 +4852,7 @@ ha_innobase::create( char norm_name[FN_REFLEN]; THD *thd= current_thd; ib_longlong auto_inc_value; + ulint flags; DBUG_ENTER("ha_innobase::create"); @@ -4908,9 +4906,15 @@ ha_innobase::create( /* Create the table definition in InnoDB */ + flags = 0; + + if (form->s->row_type != ROW_TYPE_REDUNDANT) { + flags |= DICT_TF_COMPACT; + } + error = create_table_def(trx, form, norm_name, create_info->options & HA_LEX_CREATE_TMP_TABLE ? name2 : NULL, - form->s->row_type != ROW_TYPE_REDUNDANT); + flags); if (error) { goto cleanup; @@ -6624,8 +6628,7 @@ innodb_show_status( /* allocate buffer for the string, and read the contents of the temporary file */ - if (!(str = my_malloc(usable_len + 1, MYF(0)))) - { + if (!(str = my_malloc(usable_len + 1, MYF(0)))) { mutex_exit_noninline(&srv_monitor_file_mutex); DBUG_RETURN(TRUE); } diff --git a/ibuf/ibuf0ibuf.c b/ibuf/ibuf0ibuf.c index 6b8a6bc8212..246acd36e95 100644 --- a/ibuf/ibuf0ibuf.c +++ b/ibuf/ibuf0ibuf.c @@ -532,7 +532,7 @@ ibuf_data_init_for_space( sprintf(buf, "SYS_IBUF_TABLE_%lu", (ulong) space); /* use old-style record format for the insert buffer */ - table = dict_mem_table_create(buf, space, 2, FALSE); + table = dict_mem_table_create(buf, space, 2, 0); dict_mem_table_add_col(table, "PAGE_NO", DATA_BINARY, 0, 0, 0); dict_mem_table_add_col(table, "TYPES", DATA_BINARY, 0, 0, 0); @@ -1127,13 +1127,18 @@ ibuf_dummy_index_create( { dict_table_t* table; dict_index_t* index; + table = dict_mem_table_create("IBUF_DUMMY", - DICT_HDR_SPACE, n, comp); + DICT_HDR_SPACE, n, comp ? DICT_TF_COMPACT : 0); + index = dict_mem_index_create("IBUF_DUMMY", "IBUF_DUMMY", - DICT_HDR_SPACE, 0, n); + DICT_HDR_SPACE, 0, n); + index->table = table; + /* avoid ut_ad(index->cached) in dict_index_get_n_unique_in_tree */ index->cached = TRUE; + return(index); } /************************************************************************ @@ -2454,7 +2459,7 @@ ibuf_update_max_tablespace_id(void) ibuf_data = fil_space_get_ibuf_data(0); ibuf_index = ibuf_data->index; - ut_a(!ibuf_index->table->comp); + ut_a(!dict_table_is_comp(ibuf_index->table)); ibuf_enter(); @@ -2598,8 +2603,8 @@ ibuf_insert_low( the first fields and the type information for other fields, and which will be inserted to the insert buffer. */ - ibuf_entry = ibuf_entry_build(entry, index->table->comp, - space, page_no, heap); + ibuf_entry = ibuf_entry_build(entry, dict_table_is_comp(index->table), + space, page_no, heap); /* Open a cursor to the insert buffer tree to calculate if we can add the new entry to it without exceeding the free space limit for the @@ -2770,7 +2775,8 @@ ibuf_insert( ut_a(!index->table->zip); if (rec_get_converted_size(index, entry) - >= page_get_free_space_of_empty(index->table->comp) / 2) { + >= page_get_free_space_of_empty( + dict_table_is_comp(index->table)) / 2) { return(FALSE); } @@ -2817,7 +2823,8 @@ ibuf_insert_to_index_page( ut_ad(ibuf_inside()); ut_ad(dtuple_check_typed(entry)); - if (UNIV_UNLIKELY(index->table->comp != (ibool)!!page_is_comp(page))) { + if (UNIV_UNLIKELY(dict_table_is_comp(index->table) + != (ibool)!!page_is_comp(page))) { fputs( "InnoDB: Trying to insert a record from the insert buffer to an index page\n" "InnoDB: but the 'compact' flag does not match!\n", stderr); @@ -3135,7 +3142,7 @@ ibuf_merge_or_delete_for_page( mtr_start(&mtr); - fputs(" InnoDB: Dump of the ibuf bitmap page:\n", + fputs(" InnoDB: Dump of the ibuf bitmap page:\n", stderr); bitmap_page = ibuf_bitmap_get_map_page(space, page_no, diff --git a/include/btr0cur.ic b/include/btr0cur.ic index 72375028ea9..5d2ae768416 100644 --- a/include/btr0cur.ic +++ b/include/btr0cur.ic @@ -53,7 +53,8 @@ btr_cur_get_page( btr_cur_t* cursor) /* in: tree cursor */ { page_t* page = buf_frame_align(page_cur_get_rec(&(cursor->page_cur))); - ut_ad(!!page_is_comp(page) == cursor->index->table->comp); + ut_ad(!!page_is_comp(page) + == dict_table_is_comp(cursor->index->table)); return(page); } diff --git a/include/dict0dict.h b/include/dict0dict.h index 05334d3bffc..7a0b80aebe6 100644 --- a/include/dict0dict.h +++ b/include/dict0dict.h @@ -487,6 +487,15 @@ dict_table_get_sys_col_no( dict_table_t* table, /* in: table */ ulint sys); /* in: DATA_ROW_ID, ... */ /************************************************************************ +Check whether the table uses the compact page format. */ +UNIV_INLINE +ibool +dict_table_is_comp( +/*===============*/ + /* out: TRUE if table uses the + compact page format */ + const dict_table_t* table); /* in: table */ +/************************************************************************ Checks if a column is in the ordering columns of the clustered index of a table. Column prefixes are treated like whole columns. */ diff --git a/include/dict0dict.ic b/include/dict0dict.ic index e4db9025329..b99ca7815a8 100644 --- a/include/dict0dict.ic +++ b/include/dict0dict.ic @@ -189,6 +189,25 @@ dict_table_get_sys_col_no( return(table->n_cols - DATA_N_SYS_COLS + sys); } +/************************************************************************ +Check whether the table uses the compact page format. */ +UNIV_INLINE +ibool +dict_table_is_comp( +/*===============*/ + /* out: TRUE if table uses the + compact page format */ + const dict_table_t* table) /* in: table */ +{ + ut_ad(table); + +#if DICT_TF_COMPACT != TRUE +#error +#endif + + return(UNIV_LIKELY(table->flags & DICT_TF_COMPACT)); +} + /************************************************************************ Gets the number of fields in the internal representation of an index, including fields added by the dictionary system. */ diff --git a/include/dict0mem.h b/include/dict0mem.h index a5b482a4edd..5116802c49e 100644 --- a/include/dict0mem.h +++ b/include/dict0mem.h @@ -39,6 +39,9 @@ combination of types */ #define DICT_TABLE_CLUSTER 3 /* this means that the table is really a cluster definition */ +/* Table flags */ +#define DICT_TF_COMPACT 1 /* compact page format */ + /************************************************************************** Creates a table memory object. */ @@ -52,7 +55,7 @@ dict_mem_table_create( is ignored if the table is made a member of a cluster */ ulint n_cols, /* in: number of columns */ - ibool comp); /* in: TRUE=compact page format */ + ulint flags); /* in: table flags */ /************************************************************************** Creates a cluster memory object. */ @@ -300,6 +303,7 @@ a foreign key constraint is enforced, therefore RESTRICT just means no flag */ struct dict_table_struct{ dulint id; /* id of the table or cluster */ ulint type; /* DICT_TABLE_ORDINARY, ... */ + ulint flags; /* DICT_TF_COMPACT, ... */ mem_heap_t* heap; /* memory heap */ const char* name; /* table name */ const char* dir_path_of_temp_table;/* NULL or the directory path @@ -317,7 +321,6 @@ struct dict_table_struct{ ibool tablespace_discarded;/* this flag is set TRUE when the user calls DISCARD TABLESPACE on this table, and reset to FALSE in IMPORT TABLESPACE */ - ibool comp; /* flag: TRUE=compact page format */ ibool zip; /* flag: TRUE=compressed page format */ hash_node_t name_hash; /* hash chain node */ hash_node_t id_hash; /* hash chain node */ diff --git a/include/rem0rec.ic b/include/rem0rec.ic index 9a77361e2bf..f42171ebe54 100644 --- a/include/rem0rec.ic +++ b/include/rem0rec.ic @@ -455,9 +455,11 @@ rec_get_n_fields( { ut_ad(rec); ut_ad(index); - if (UNIV_UNLIKELY(!index->table->comp)) { + + if (!dict_table_is_comp(index->table)) { return(rec_get_n_fields_old(rec)); } + switch (rec_get_status(rec)) { case REC_STATUS_ORDINARY: return(dict_index_get_n_fields(index)); @@ -1500,7 +1502,7 @@ rec_get_converted_size( ? dict_index_get_n_unique_in_tree(index) + 1 : dict_index_get_n_fields(index))); - if (UNIV_LIKELY(index->table->comp)) { + if (dict_table_is_comp(index->table)) { return(rec_get_converted_size_new(index, dtuple)); } diff --git a/include/sync0sync.ic b/include/sync0sync.ic index a9211b484a6..f384e43779f 100644 --- a/include/sync0sync.ic +++ b/include/sync0sync.ic @@ -255,8 +255,7 @@ mutex_enter_func( mutex->count_using++; #endif /* UNIV_HOTBACKUP */ - if (!mutex_test_and_set(mutex)) - { + if (!mutex_test_and_set(mutex)) { #ifdef UNIV_SYNC_DEBUG mutex_set_debug_info(mutex, file_name, line); #endif @@ -264,5 +263,4 @@ mutex_enter_func( } mutex_spin_wait(mutex, file_name, line); - } diff --git a/include/univ.i b/include/univ.i index 459aee46b14..d9e432a8791 100644 --- a/include/univ.i +++ b/include/univ.i @@ -233,7 +233,7 @@ of a field is a 32-bit integer when we store it, for example, to an undo log on disk, we must have also this number fit in 32 bits, also in 64-bit computers! */ -#define UNIV_SQL_NULL ULINT32_UNDEFINED +#define UNIV_SQL_NULL ULINT32_UNDEFINED /* Lengths which are not UNIV_SQL_NULL, but bigger than the following number indicate that a field contains a reference to an externally diff --git a/lock/lock0lock.c b/lock/lock0lock.c index fffb46fab6b..d3eaf31618d 100644 --- a/lock/lock0lock.c +++ b/lock/lock0lock.c @@ -476,7 +476,7 @@ lock_check_trx_id_sanity( if (ut_dulint_cmp(trx_id, trx_sys->max_trx_id) >= 0) { ut_print_timestamp(stderr); - fputs(" InnoDB: Error: transaction id associated" + fputs(" InnoDB: Error: transaction id associated" " with record\n", stderr); rec_print_new(stderr, rec, offsets); @@ -1733,7 +1733,7 @@ lock_rec_create( space = buf_frame_get_space_id(page); page_no = buf_frame_get_page_no(page); - ut_ad((ibool) !!page_is_comp(page) == index->table->comp); + ut_ad(!!page_is_comp(page) == dict_table_is_comp(index->table)); /* If rec is the supremum record, then we reset the gap and LOCK_REC_NOT_GAP bits, as all locks on the supremum are diff --git a/log/log0recv.c b/log/log0recv.c index 2ef33b7f569..45eccbf4de1 100644 --- a/log/log0recv.c +++ b/log/log0recv.c @@ -771,7 +771,8 @@ recv_parse_or_apply_log_rec_body( if (NULL != (ptr = mlog_parse_index(ptr, end_ptr, type == MLOG_COMP_REC_INSERT, &index))) { ut_a(!page - || (ibool)!!page_is_comp(page)==index->table->comp); + || (ibool)!!page_is_comp(page) + == dict_table_is_comp(index->table)); ptr = page_cur_parse_insert_rec(FALSE, ptr, end_ptr, index, page, page_zip, mtr); } @@ -780,7 +781,8 @@ recv_parse_or_apply_log_rec_body( if (NULL != (ptr = mlog_parse_index(ptr, end_ptr, type == MLOG_COMP_REC_CLUST_DELETE_MARK, &index))) { ut_a(!page - || (ibool)!!page_is_comp(page)==index->table->comp); + || (ibool)!!page_is_comp(page) + == dict_table_is_comp(index->table)); ptr = btr_cur_parse_del_mark_set_clust_rec(ptr, end_ptr, page, page_zip, index); } @@ -802,7 +804,8 @@ recv_parse_or_apply_log_rec_body( if (NULL != (ptr = mlog_parse_index(ptr, end_ptr, type == MLOG_COMP_REC_UPDATE_IN_PLACE, &index))) { ut_a(!page - || (ibool)!!page_is_comp(page)==index->table->comp); + || (ibool)!!page_is_comp(page) + == dict_table_is_comp(index->table)); ptr = btr_cur_parse_update_in_place(ptr, end_ptr, page, page_zip, index); } @@ -813,7 +816,8 @@ recv_parse_or_apply_log_rec_body( type == MLOG_COMP_LIST_END_DELETE || type == MLOG_COMP_LIST_START_DELETE, &index))) { ut_a(!page - || (ibool)!!page_is_comp(page)==index->table->comp); + || (ibool)!!page_is_comp(page) + == dict_table_is_comp(index->table)); ptr = page_parse_delete_rec_list(type, ptr, end_ptr, index, page, mtr); } @@ -822,7 +826,8 @@ recv_parse_or_apply_log_rec_body( if (NULL != (ptr = mlog_parse_index(ptr, end_ptr, type == MLOG_COMP_LIST_END_COPY_CREATED, &index))) { ut_a(!page - || (ibool)!!page_is_comp(page)==index->table->comp); + || (ibool)!!page_is_comp(page) + == dict_table_is_comp(index->table)); ptr = page_parse_copy_rec_list_to_created_page(ptr, end_ptr, index, page, page_zip, mtr); } @@ -831,7 +836,8 @@ recv_parse_or_apply_log_rec_body( if (NULL != (ptr = mlog_parse_index(ptr, end_ptr, type == MLOG_COMP_PAGE_REORGANIZE, &index))) { ut_a(!page - || (ibool)!!page_is_comp(page)==index->table->comp); + || (ibool)!!page_is_comp(page) + == dict_table_is_comp(index->table)); ptr = btr_parse_page_reorganize(ptr, end_ptr, index, page, mtr); } @@ -866,7 +872,8 @@ recv_parse_or_apply_log_rec_body( if (NULL != (ptr = mlog_parse_index(ptr, end_ptr, type == MLOG_COMP_REC_DELETE, &index))) { ut_a(!page - || (ibool)!!page_is_comp(page)==index->table->comp); + || (ibool)!!page_is_comp(page) + == dict_table_is_comp(index->table)); ptr = page_cur_parse_delete_rec(ptr, end_ptr, index, page, page_zip, mtr); } @@ -2733,7 +2740,7 @@ recv_recovery_from_checkpoint_start( < 0) { fprintf(stderr, "InnoDB: ##########################################################\n" -"InnoDB: WARNING!\n" +"InnoDB: WARNING!\n" "InnoDB: The log sequence number in ibdata files is higher\n" "InnoDB: than the log sequence number in the ib_logfiles! Are you sure\n" "InnoDB: you are using the right ib_logfiles to start up the database?\n" diff --git a/mem/mem0dbg.c b/mem/mem0dbg.c index f92d3325140..2644bba0fe0 100644 --- a/mem/mem0dbg.c +++ b/mem/mem0dbg.c @@ -894,17 +894,17 @@ mem_print_info_low( fprintf(outfile, "\n"); - fprintf(outfile, "Current allocated memory : %lu\n", + fprintf(outfile, "Current allocated memory : %lu\n", mem_current_allocated_memory); - fprintf(outfile, "Current allocated heaps and buffers : %lu\n", + fprintf(outfile, "Current allocated heaps and buffers : %lu\n", n_heaps); - fprintf(outfile, "Cumulative allocated memory : %lu\n", + fprintf(outfile, "Cumulative allocated memory : %lu\n", mem_total_allocated_memory); - fprintf(outfile, "Maximum allocated memory : %lu\n", + fprintf(outfile, "Maximum allocated memory : %lu\n", mem_max_allocated_memory); - fprintf(outfile, "Cumulative created heaps and buffers : %lu\n", + fprintf(outfile, "Cumulative created heaps and buffers : %lu\n", mem_n_created_heaps); - fprintf(outfile, "Cumulative number of allocations : %lu\n", + fprintf(outfile, "Cumulative number of allocations : %lu\n", mem_n_allocations); mem_last_print_info = mem_n_created_heaps; diff --git a/mtr/mtr0log.c b/mtr/mtr0log.c index 0e0a65c5697..6e234c5f1a5 100644 --- a/mtr/mtr0log.c +++ b/mtr/mtr0log.c @@ -430,7 +430,7 @@ mlog_open_and_write_index( const byte* log_start; const byte* log_end; - ut_ad(!!page_rec_is_comp(rec) == index->table->comp); + ut_ad(!!page_rec_is_comp(rec) == dict_table_is_comp(index->table)); if (!page_rec_is_comp(rec)) { log_start = log_ptr = mlog_open(mtr, 11 + size); @@ -541,7 +541,8 @@ mlog_parse_index( } else { n = n_uniq = 1; } - table = dict_mem_table_create("LOG_DUMMY", DICT_HDR_SPACE, n, comp); + table = dict_mem_table_create("LOG_DUMMY", DICT_HDR_SPACE, n, + comp ? DICT_TF_COMPACT : 0); ind = dict_mem_index_create("LOG_DUMMY", "LOG_DUMMY", DICT_HDR_SPACE, 0, n); ind->table = table; diff --git a/os/os0file.c b/os/os0file.c index b1962bb563e..d10bdccbd2b 100644 --- a/os/os0file.c +++ b/os/os0file.c @@ -1305,7 +1305,7 @@ try_again: if (create_mode == OS_FILE_OPEN_RETRY) { int i; ut_print_timestamp(stderr); - fputs(" InnoDB: Retrying to lock the first data file\n", + fputs(" InnoDB: Retrying to lock the first data file\n", stderr); for (i = 0; i < 100; i++) { os_thread_sleep(1000000); @@ -1315,7 +1315,7 @@ try_again: } } ut_print_timestamp(stderr); - fputs(" InnoDB: Unable to open the first data file\n", + fputs(" InnoDB: Unable to open the first data file\n", stderr); } close(file); diff --git a/os/os0proc.c b/os/os0proc.c index 3211ad5c4ba..fc1b2d0d2dd 100644 --- a/os/os0proc.c +++ b/os/os0proc.c @@ -119,7 +119,7 @@ os_awe_enable_lock_pages_in_mem(void) Result = LookupPrivilegeValue(NULL, SE_LOCK_MEMORY_NAME, &(Info.Privilege[0].Luid)); - if (Result != TRUE) { + if (Result != TRUE) { fprintf(stderr, "InnoDB: AWE: Cannot get local privilege value for %s, error %lu.\n", SE_LOCK_MEMORY_NAME, (ulint)GetLastError()); @@ -134,7 +134,7 @@ os_awe_enable_lock_pages_in_mem(void) 0, NULL, NULL); /* Check the result */ - if (Result != TRUE) { + if (Result != TRUE) { fprintf(stderr, "InnoDB: AWE: Cannot adjust process token privileges, error %u.\n", GetLastError()); diff --git a/page/page0cur.c b/page/page0cur.c index de8565f1ac0..22631d72bc5 100644 --- a/page/page0cur.c +++ b/page/page0cur.c @@ -529,7 +529,8 @@ page_cur_insert_rec_write_log( ut_a(rec_size < UNIV_PAGE_SIZE); ut_ad(buf_frame_align(insert_rec) == buf_frame_align(cursor_rec)); - ut_ad(!page_rec_is_comp(insert_rec) == !index->table->comp); + ut_ad(!page_rec_is_comp(insert_rec) + == !dict_table_is_comp(index->table)); { mem_heap_t* heap = NULL; @@ -789,7 +790,7 @@ page_cur_parse_insert_rec( return(ptr + (end_seg_len >> 1)); } - ut_ad((ibool) !!page_is_comp(page) == index->table->comp); + ut_ad(!!page_is_comp(page) == dict_table_is_comp(index->table)); ut_ad(!page_zip || page_is_comp(page)); /* Read from the log the inserted index record end segment which @@ -908,7 +909,8 @@ page_cur_insert_rec_low( ut_ad(rec_offs_validate(rec, index, offsets)); page = page_cur_get_page(cursor); - ut_ad(index->table->comp == (ibool) !!page_is_comp(page)); + ut_ad(dict_table_is_comp(index->table) + == (ibool) !!page_is_comp(page)); ut_ad(!page_rec_is_supremum(cursor->rec)); @@ -1125,7 +1127,7 @@ page_copy_rec_list_to_created_page_write_log( { byte* log_ptr; - ut_ad(!!page_is_comp(page) == index->table->comp); + ut_ad(!!page_is_comp(page) == dict_table_is_comp(index->table)); log_ptr = mlog_open_and_write_index(mtr, page, index, page_is_comp(page) @@ -1370,7 +1372,7 @@ page_cur_delete_rec_write_log( { byte* log_ptr; - ut_ad((ibool) !!page_rec_is_comp(rec) == index->table->comp); + ut_ad(!!page_rec_is_comp(rec) == dict_table_is_comp(index->table)); log_ptr = mlog_open_and_write_index(mtr, rec, index, page_rec_is_comp(rec) @@ -1465,7 +1467,7 @@ page_cur_delete_rec( page = page_cur_get_page(cursor); current_rec = cursor->rec; ut_ad(rec_offs_validate(current_rec, index, offsets)); - ut_ad((ibool) !!page_is_comp(page) == index->table->comp); + ut_ad(!!page_is_comp(page) == dict_table_is_comp(index->table)); /* The record must not be the supremum or infimum record. */ ut_ad(page_rec_is_user_rec(current_rec)); diff --git a/page/page0page.c b/page/page0page.c index a45fcc1de8e..9e51f37a381 100644 --- a/page/page0page.c +++ b/page/page0page.c @@ -345,7 +345,7 @@ page_create( rec_t* supremum_rec; page_t* page; ulint* offsets; - const ibool comp = index->table->comp; + const ibool comp = dict_table_is_comp(index->table); ut_ad(!page_zip || comp); ut_ad(frame && mtr); @@ -517,7 +517,8 @@ page_copy_rec_list_end_no_locks( page_cur_move_to_next(&cur1); } - ut_a((ibool)!!page_is_comp(new_page) == index->table->comp); + ut_a((ibool)!!page_is_comp(new_page) + == dict_table_is_comp(index->table)); ut_a(page_is_comp(new_page) == page_rec_is_comp(rec)); ut_a(mach_read_from_2(new_page + UNIV_PAGE_SIZE - 10) == (ulint) (page_is_comp(new_page) @@ -765,7 +766,7 @@ page_parse_delete_rec_list( return(ptr); } - ut_ad((ibool) !!page_is_comp(page) == index->table->comp); + ut_ad(!!page_is_comp(page) == dict_table_is_comp(index->table)); if (type == MLOG_LIST_END_DELETE || type == MLOG_COMP_LIST_END_DELETE) { @@ -981,7 +982,8 @@ page_delete_rec_list_start( *offsets_ = (sizeof offsets_) / sizeof *offsets_; - ut_ad((ibool) !!page_rec_is_comp(rec) == index->table->comp); + ut_ad((ibool) !!page_rec_is_comp(rec) + == dict_table_is_comp(index->table)); if (page_rec_is_infimum(rec)) { @@ -1509,7 +1511,7 @@ page_rec_print( rec_print_new(stderr, rec, offsets); if (page_rec_is_comp(rec)) { fprintf(stderr, - " n_owned: %lu; heap_no: %lu; next rec: %lu\n", + " n_owned: %lu; heap_no: %lu; next rec: %lu\n", (ulong) rec_get_n_owned_new(rec), (ulong) rec_get_heap_no_new(rec), (ulong) rec_get_next_offs(rec, TRUE)); @@ -1549,7 +1551,7 @@ page_dir_print( for (i = 0; i < n; i++) { slot = page_dir_get_nth_slot(page, i); if ((i == pr_n) && (i < n - pr_n)) { - fputs(" ... \n", stderr); + fputs(" ... \n", stderr); } if ((i < pr_n) || (i >= n - pr_n)) { fprintf(stderr, @@ -1582,7 +1584,7 @@ page_print_list( ulint* offsets = offsets_; *offsets_ = (sizeof offsets_) / sizeof *offsets_; - ut_a((ibool)!!page_is_comp(page) == index->table->comp); + ut_a((ibool)!!page_is_comp(page) == dict_table_is_comp(index->table)); fprintf(stderr, "--------------------------------\n" @@ -2180,7 +2182,7 @@ page_validate( ulint* old_offsets = NULL; if (UNIV_UNLIKELY((ibool) !!page_is_comp(page) - != index->table->comp)) { + != dict_table_is_comp(index->table))) { fputs("InnoDB: 'compact format' flag mismatch\n", stderr); goto func_exit2; } diff --git a/pars/pars0pars.c b/pars/pars0pars.c index ed61d5e2183..1b7a3a653a9 100644 --- a/pars/pars0pars.c +++ b/pars/pars0pars.c @@ -1578,7 +1578,7 @@ pars_create_table( /* As the InnoDB SQL parser is for internal use only, for creating some system tables, this function will only create tables in the old (not compact) record format. */ - table = dict_mem_table_create(table_sym->name, 0, n_cols, FALSE); + table = dict_mem_table_create(table_sym->name, 0, n_cols, 0); if (not_fit_in_memory != NULL) { table->does_not_fit_in_memory = TRUE; diff --git a/rem/rem0rec.c b/rem/rem0rec.c index 9f6ca6df506..f34d496de48 100644 --- a/rem/rem0rec.c +++ b/rem/rem0rec.c @@ -155,7 +155,7 @@ rec_get_n_extern_new( ulint n_extern; ulint i; - ut_ad(index->table->comp); + ut_ad(dict_table_is_comp(index->table)); ut_ad(rec_get_status((rec_t*) rec) == REC_STATUS_ORDINARY); ut_ad(n == ULINT_UNDEFINED || n <= dict_index_get_n_fields(index)); @@ -242,7 +242,7 @@ rec_init_offsets( rec_offs_make_valid(rec, index, offsets); - if (UNIV_LIKELY(index->table->comp)) { + if (dict_table_is_comp(index->table)) { const byte* nulls; const byte* lens; dict_field_t* field; @@ -399,7 +399,7 @@ rec_get_offsets_func( ut_ad(index); ut_ad(heap); - if (UNIV_LIKELY(index->table->comp)) { + if (dict_table_is_comp(index->table)) { switch (UNIV_EXPECT(rec_get_status(rec), REC_STATUS_ORDINARY)) { case REC_STATUS_ORDINARY: @@ -469,7 +469,7 @@ rec_get_offsets_reverse( ut_ad(extra); ut_ad(index); ut_ad(offsets); - ut_ad(index->table->comp); + ut_ad(dict_table_is_comp(index->table)); if (UNIV_UNLIKELY(node_ptr)) { n_node_ptr_field = dict_index_get_n_unique_in_tree(index); @@ -636,7 +636,7 @@ rec_get_converted_size_new( ulint i; ulint n_fields; ut_ad(index && dtuple); - ut_ad(index->table->comp); + ut_ad(dict_table_is_comp(index->table)); switch (dtuple_get_info_bits(dtuple) & REC_NEW_STATUS_MASK) { case REC_STATUS_ORDINARY: @@ -765,7 +765,7 @@ rec_set_field_extern_bits_new( ulint n_fields; ulint null_mask = 1; ut_ad(rec && index); - ut_ad(index->table->comp); + ut_ad(dict_table_is_comp(index->table)); ut_ad(rec_get_status(rec) == REC_STATUS_ORDINARY); n_fields = dict_index_get_n_fields(index); @@ -843,7 +843,7 @@ rec_set_field_extern_bits( const ulint* vec, /* in: array of field numbers */ ulint n_fields)/* in: number of fields numbers */ { - if (UNIV_LIKELY(index->table->comp)) { + if (dict_table_is_comp(index->table)) { rec_set_field_extern_bits_new(rec, index, vec, n_fields); } else { ut_a(!rec_get_1byte_offs_flag(rec)); @@ -1007,8 +1007,7 @@ rec_convert_dtuple_to_rec_new( ulint fixed_len; ulint null_mask = 1; const ulint n_fields = dtuple_get_n_fields(dtuple); - ut_ad(index->table->comp); - + ut_ad(dict_table_is_comp(index->table)); ut_ad(n_fields > 0); /* Try to ensure that the memset() between the for() loops @@ -1167,7 +1166,7 @@ rec_convert_dtuple_to_rec( ut_ad(dtuple_validate(dtuple)); ut_ad(dtuple_check_typed(dtuple)); - if (UNIV_LIKELY(index->table->comp)) { + if (dict_table_is_comp(index->table)) { rec = rec_convert_dtuple_to_rec_new(buf, index, dtuple); } else { rec = rec_convert_dtuple_to_rec_old(buf, dtuple); @@ -1219,7 +1218,7 @@ rec_copy_prefix_to_dtuple( ut_ad(dtuple_check_typed(tuple)); dtuple_set_info_bits(tuple, - rec_get_info_bits(rec, index->table->comp)); + rec_get_info_bits(rec, dict_table_is_comp(index->table))); for (i = 0; i < n_fields; i++) { @@ -1307,7 +1306,7 @@ rec_copy_prefix_to_buf( UNIV_PREFETCH_RW(*buf); - if (UNIV_UNLIKELY(!index->table->comp)) { + if (!dict_table_is_comp(index->table)) { ut_ad(rec_validate_old(rec)); return(rec_copy_prefix_to_buf_old(rec, n_fields, rec_get_field_start_offs(rec, n_fields), @@ -1635,7 +1634,7 @@ rec_print( { ut_ad(index); - if (!index->table->comp) { + if (!dict_table_is_comp(index->table)) { rec_print_old(file, rec); return; } else { diff --git a/row/row0ins.c b/row/row0ins.c index 30f4c9f4013..c3611ec37e2 100644 --- a/row/row0ins.c +++ b/row/row0ins.c @@ -256,7 +256,8 @@ row_ins_sec_index_entry_by_modify( rec = btr_cur_get_rec(cursor); ut_ad((cursor->index->type & DICT_CLUSTERED) == 0); - ut_ad(rec_get_deleted_flag(rec, cursor->index->table->comp)); + ut_ad(rec_get_deleted_flag(rec, + dict_table_is_comp(cursor->index->table))); /* We know that in the alphabetical ordering, entry and rec are identified. But in their binary form there may be differences if @@ -279,7 +280,7 @@ row_ins_sec_index_entry_by_modify( case DB_ZIP_OVERFLOW: err = DB_FAIL; } - } else { + } else { ut_a(mode == BTR_MODIFY_TREE); err = btr_cur_pessimistic_update(BTR_KEEP_SYS_FLAG, cursor, &dummy_big_rec, update, 0, thr, mtr); @@ -324,7 +325,8 @@ row_ins_clust_index_entry_by_modify( rec = btr_cur_get_rec(cursor); - ut_ad(rec_get_deleted_flag(rec, cursor->index->table->comp)); + ut_ad(rec_get_deleted_flag(rec, + dict_table_is_comp(cursor->index->table))); heap = mem_heap_create(1024); @@ -346,7 +348,7 @@ row_ins_clust_index_entry_by_modify( case DB_ZIP_OVERFLOW: err = DB_FAIL; } - } else { + } else { ut_a(mode == BTR_MODIFY_TREE); err = btr_cur_pessimistic_update(0, cursor, big_rec, update, 0, thr, mtr); @@ -975,7 +977,7 @@ row_ins_foreign_check_on_constraint( goto nonstandard_exit_func; } - if (rec_get_deleted_flag(clust_rec, table->comp)) { + if (rec_get_deleted_flag(clust_rec, dict_table_is_comp(table))) { /* This can happen if there is a circular reference of rows such that cascading delete comes to delete a row already in the process of being delete marked */ diff --git a/row/row0mysql.c b/row/row0mysql.c index 605cab26407..73afe6f6331 100644 --- a/row/row0mysql.c +++ b/row/row0mysql.c @@ -437,12 +437,12 @@ row_mysql_convert_row_to_innobase( } row_mysql_store_col_in_innobase_format(dfield, - prebuilt->ins_upd_rec_buff - + templ->mysql_col_offset, - TRUE, /* MySQL row format data */ - mysql_rec + templ->mysql_col_offset, - templ->mysql_col_len, - prebuilt->table->comp); + prebuilt->ins_upd_rec_buff + + templ->mysql_col_offset, + TRUE, /* MySQL row format data */ + mysql_rec + templ->mysql_col_offset, + templ->mysql_col_len, + dict_table_is_comp(prebuilt->table)); next_column: ; } @@ -1916,7 +1916,7 @@ row_create_table_for_mysql( if (err == DB_OUT_OF_FILE_SPACE) { ut_print_timestamp(stderr); - fputs(" InnoDB: Warning: cannot create table ", + fputs(" InnoDB: Warning: cannot create table ", stderr); ut_print_name(stderr, trx, table->name); fputs(" because tablespace full\n", stderr); @@ -1930,7 +1930,7 @@ row_create_table_for_mysql( } else if (err == DB_DUPLICATE_KEY) { ut_print_timestamp(stderr); - fputs(" InnoDB: Error: table ", stderr); + fputs(" InnoDB: Error: table ", stderr); ut_print_name(stderr, trx, table->name); fputs(" already exists in InnoDB internal\n" "InnoDB: data dictionary. Have you deleted the .frm file\n" @@ -2007,7 +2007,7 @@ row_create_index_for_mysql( ut_print_timestamp(stderr); - fputs(" InnoDB: Error: column ", stderr); + fputs(" InnoDB: Error: column ", stderr); ut_print_name(stderr, trx, dict_index_get_nth_field(index, i)->name); fputs(" appears twice in ", stderr); @@ -2437,7 +2437,7 @@ do not allow the discard. We also reserve the data dictionary latch. */ if (table->space == 0) { ut_print_timestamp(stderr); - fputs(" InnoDB: Error: table ", stderr); + fputs(" InnoDB: Error: table ", stderr); ut_print_name(stderr, trx, name); fputs("\n" "InnoDB: is in the system tablespace 0 which cannot be discarded\n", stderr); @@ -2449,7 +2449,7 @@ do not allow the discard. We also reserve the data dictionary latch. */ if (table->n_foreign_key_checks_running > 0) { ut_print_timestamp(stderr); - fputs(" InnoDB: You are trying to DISCARD table ", stderr); + fputs(" InnoDB: You are trying to DISCARD table ", stderr); ut_print_name(stderr, trx, table->name); fputs("\n" "InnoDB: though there is a foreign key check running on it.\n" @@ -2483,7 +2483,7 @@ do not allow the discard. We also reserve the data dictionary latch. */ rewind(ef); ut_print_timestamp(ef); - fputs(" Cannot DISCARD table ", ef); + fputs(" Cannot DISCARD table ", ef); ut_print_name(ef, trx, name); fputs("\n" "because it is referenced by ", ef); @@ -2602,7 +2602,7 @@ row_import_tablespace_for_mysql( if (!success) { ut_print_timestamp(stderr); - fputs(" InnoDB: Error: cannot reset lsn's in table ", stderr); + fputs(" InnoDB: Error: cannot reset lsn's in table ", stderr); ut_print_name(stderr, trx, name); fputs("\n" "InnoDB: in ALTER TABLE ... IMPORT TABLESPACE\n", stderr); @@ -2623,7 +2623,7 @@ row_import_tablespace_for_mysql( if (!table) { ut_print_timestamp(stderr); - fputs(" InnoDB: table ", stderr); + fputs(" InnoDB: table ", stderr); ut_print_name(stderr, trx, name); fputs("\n" "InnoDB: does not exist in the InnoDB data dictionary\n" @@ -2637,7 +2637,7 @@ row_import_tablespace_for_mysql( if (table->space == 0) { ut_print_timestamp(stderr); - fputs(" InnoDB: Error: table ", stderr); + fputs(" InnoDB: Error: table ", stderr); ut_print_name(stderr, trx, name); fputs("\n" "InnoDB: is in the system tablespace 0 which cannot be imported\n", stderr); @@ -2821,7 +2821,7 @@ do not allow the TRUNCATE. We also reserve the data dictionary latch. */ rewind(ef); ut_print_timestamp(ef); - fputs(" Cannot truncate table ", ef); + fputs(" Cannot truncate table ", ef); ut_print_name(ef, trx, table->name); fputs(" by DROP+CREATE\n" "InnoDB: because it is referenced by ", ef); @@ -2841,7 +2841,7 @@ do not allow the TRUNCATE. We also reserve the data dictionary latch. */ if (table->n_foreign_key_checks_running > 0) { ut_print_timestamp(stderr); - fputs(" InnoDB: Cannot truncate table ", stderr); + fputs(" InnoDB: Cannot truncate table ", stderr); ut_print_name(stderr, trx, table->name); fputs(" by DROP+CREATE\n" "InnoDB: because there is a foreign key check running on it.\n", @@ -2964,7 +2964,7 @@ do not allow the TRUNCATE. We also reserve the data dictionary latch. */ trx_general_rollback_for_mysql(trx, FALSE, NULL); trx->error_state = DB_SUCCESS; ut_print_timestamp(stderr); -fputs(" InnoDB: Unable to assign a new identifier to table ", stderr); +fputs(" InnoDB: Unable to assign a new identifier to table ", stderr); ut_print_name(stderr, trx, table->name); fputs("\n" "InnoDB: after truncating it. Background processes may corrupt the table!\n", @@ -3179,7 +3179,7 @@ row_drop_table_for_mysql( err = DB_TABLE_NOT_FOUND; ut_print_timestamp(stderr); - fputs(" InnoDB: Error: table ", stderr); + fputs(" InnoDB: Error: table ", stderr); ut_print_name(stderr, trx, name); fputs(" does not exist in the InnoDB internal\n" "InnoDB: data dictionary though MySQL is trying to drop it.\n" @@ -3215,7 +3215,7 @@ row_drop_table_for_mysql( rewind(ef); ut_print_timestamp(ef); - fputs(" Cannot drop table ", ef); + fputs(" Cannot drop table ", ef); ut_print_name(ef, trx, name); fputs("\n" "because it is referenced by ", ef); @@ -3237,7 +3237,7 @@ row_drop_table_for_mysql( if (added) { ut_print_timestamp(stderr); -fputs(" InnoDB: Warning: MySQL is trying to drop table ", stderr); +fputs(" InnoDB: Warning: MySQL is trying to drop table ", stderr); ut_print_name(stderr, trx, table->name); fputs("\n" "InnoDB: though there are still open handles to it.\n" @@ -3270,7 +3270,7 @@ fputs(" InnoDB: Warning: MySQL is trying to drop table ", stderr); if (added) { ut_print_timestamp(stderr); -fputs(" InnoDB: You are trying to drop table ", stderr); +fputs(" InnoDB: You are trying to drop table ", stderr); ut_print_name(stderr, trx, table->name); fputs("\n" "InnoDB: though there is a foreign key check running on it.\n" @@ -3330,7 +3330,7 @@ fputs(" InnoDB: You are trying to drop table ", stderr); if (dict_load_table(name) != NULL) { ut_print_timestamp(stderr); - fputs(" InnoDB: Error: not able to remove table ", + fputs(" InnoDB: Error: not able to remove table ", stderr); ut_print_name(stderr, trx, name); fputs(" from the dictionary cache!\n", stderr); @@ -3648,7 +3648,7 @@ row_rename_table_for_mysql( err = DB_TABLE_NOT_FOUND; ut_print_timestamp(stderr); - fputs(" InnoDB: Error: table ", stderr); + fputs(" InnoDB: Error: table ", stderr); ut_print_name(stderr, trx, old_name); fputs(" does not exist in the InnoDB internal\n" "InnoDB: data dictionary though MySQL is trying to rename the table.\n" @@ -3664,7 +3664,7 @@ row_rename_table_for_mysql( err = DB_TABLE_NOT_FOUND; ut_print_timestamp(stderr); - fputs(" InnoDB: Error: table ", stderr); + fputs(" InnoDB: Error: table ", stderr); ut_print_name(stderr, trx, old_name); fputs( " does not have an .ibd file in the database directory.\n" @@ -3798,7 +3798,7 @@ row_rename_table_for_mysql( if (err == DB_DUPLICATE_KEY) { ut_print_timestamp(stderr); fputs( - " InnoDB: Error; possible reasons:\n" + " InnoDB: Error; possible reasons:\n" "InnoDB: 1) Table rename would cause two FOREIGN KEY constraints\n" "InnoDB: to have the same internal name in case-insensitive comparison.\n" "InnoDB: 2) table ", stderr); @@ -3858,7 +3858,7 @@ row_rename_table_for_mysql( ut_print_timestamp(stderr); if (old_is_tmp) { - fputs(" InnoDB: Error: in ALTER TABLE ", + fputs(" InnoDB: Error: in ALTER TABLE ", stderr); ut_print_name(stderr, trx, new_name); fputs("\n" diff --git a/row/row0row.c b/row/row0row.c index a1c590eecce..9fbbd3e0911 100644 --- a/row/row0row.c +++ b/row/row0row.c @@ -189,7 +189,8 @@ row_build( row = dtuple_create(heap, row_len); - dtuple_set_info_bits(row, rec_get_info_bits(rec, table->comp)); + dtuple_set_info_bits(row, rec_get_info_bits(rec, + dict_table_is_comp(table))); n_fields = rec_offs_n_fields(offsets); diff --git a/row/row0sel.c b/row/row0sel.c index bb8e3226e75..bea55262d53 100644 --- a/row/row0sel.c +++ b/row/row0sel.c @@ -688,7 +688,8 @@ row_sel_get_clust_rec( || btr_pcur_get_low_match(&(plan->clust_pcur)) < dict_index_get_n_unique(index)) { - ut_a(rec_get_deleted_flag(rec, plan->table->comp)); + ut_a(rec_get_deleted_flag(rec, + dict_table_is_comp(plan->table))); ut_a(node->read_view); /* In a rare case it is possible that no clust rec is found @@ -765,7 +766,8 @@ row_sel_get_clust_rec( visit through secondary index records that would not really exist in our snapshot. */ - if ((old_vers || rec_get_deleted_flag(rec, plan->table->comp)) + if ((old_vers || rec_get_deleted_flag(rec, + dict_table_is_comp(plan->table))) && !row_sel_sec_rec_is_for_clust_rec(rec, plan->index, clust_rec, index)) { goto func_exit; @@ -1082,7 +1084,7 @@ row_sel_try_search_shortcut( row_sel_fetch_columns(index, rec, offsets, UT_LIST_GET_FIRST(plan->columns)); - if (rec_get_deleted_flag(rec, plan->table->comp)) { + if (rec_get_deleted_flag(rec, dict_table_is_comp(plan->table))) { ret = SEL_EXHAUSTED; goto func_exit; @@ -1491,7 +1493,7 @@ rec_loop: goto table_exhausted; } - if (rec_get_deleted_flag(rec, plan->table->comp) + if (rec_get_deleted_flag(rec, dict_table_is_comp(plan->table)) && !cons_read_requires_clust_rec) { /* The record is delete marked: we can skip it if this is @@ -1535,7 +1537,8 @@ rec_loop: goto next_rec; } - if (rec_get_deleted_flag(clust_rec, plan->table->comp)) { + if (rec_get_deleted_flag(clust_rec, + dict_table_is_comp(plan->table))) { /* The record is delete marked: we can skip it */ @@ -2202,7 +2205,7 @@ row_sel_convert_mysql_key_to_innobase( FALSE, /* MySQL key value format col */ key_ptr + data_offset, data_len, - index->table->comp); + dict_table_is_comp(index->table)); buf += data_len; } @@ -2710,10 +2713,11 @@ row_sel_get_clust_rec_for_mysql( clustered index record did not exist in the read view of trx. */ - if (!rec_get_deleted_flag(rec, sec_index->table->comp) + if (!rec_get_deleted_flag(rec, + dict_table_is_comp(sec_index->table)) || prebuilt->select_lock_type != LOCK_NONE) { ut_print_timestamp(stderr); - fputs(" InnoDB: error clustered record" + fputs(" InnoDB: error clustered record" " for sec rec not found\n" "InnoDB: ", stderr); dict_index_name_print(stderr, trx, sec_index); @@ -2795,7 +2799,7 @@ row_sel_get_clust_rec_for_mysql( if (clust_rec && (old_vers || rec_get_deleted_flag(rec, - sec_index->table->comp)) + dict_table_is_comp(sec_index->table))) && !row_sel_sec_rec_is_for_clust_rec(rec, sec_index, clust_rec, clust_index)) { clust_rec = NULL; @@ -2908,8 +2912,7 @@ row_sel_pop_cached_row_for_mysql( ut_ad(prebuilt->n_fetch_cached > 0); ut_ad(prebuilt->mysql_prefix_len <= prebuilt->mysql_row_len); - if (UNIV_UNLIKELY(prebuilt->keep_other_fields_on_keyread)) - { + if (UNIV_UNLIKELY(prebuilt->keep_other_fields_on_keyread)) { /* Copy cache record field by field, don't touch fields that are not covered by current key */ cached_rec = @@ -2923,8 +2926,7 @@ row_sel_pop_cached_row_for_mysql( templ->mysql_col_len); /* Copy NULL bit of the current field from cached_rec to buf */ - if (templ->mysql_null_bit_mask) - { + if (templ->mysql_null_bit_mask) { buf[templ->mysql_null_byte_offset] ^= (buf[templ->mysql_null_byte_offset] ^ cached_rec[templ->mysql_null_byte_offset]) & @@ -2932,8 +2934,7 @@ row_sel_pop_cached_row_for_mysql( } } } - else - { + else { ut_memcpy(buf, prebuilt->fetch_cache[prebuilt->fetch_cache_first], prebuilt->mysql_prefix_len); } @@ -3053,7 +3054,7 @@ row_sel_try_search_shortcut_for_mysql( return(SEL_RETRY); } - if (rec_get_deleted_flag(rec, index->table->comp)) { + if (rec_get_deleted_flag(rec, dict_table_is_comp(index->table))) { return(SEL_EXHAUSTED); } @@ -3097,7 +3098,7 @@ row_search_for_mysql( cursor 'direction' should be 0. */ { dict_index_t* index = prebuilt->index; - ibool comp = index->table->comp; + ibool comp = dict_table_is_comp(index->table); dtuple_t* search_tuple = prebuilt->search_tuple; btr_pcur_t* pcur = prebuilt->pcur; trx_t* trx = prebuilt->trx; diff --git a/row/row0upd.c b/row/row0upd.c index fa8b6b52fad..8b0185fe857 100644 --- a/row/row0upd.c +++ b/row/row0upd.c @@ -1321,7 +1321,8 @@ row_upd_sec_index_entry( delete marked if we return after a lock wait in row_ins_index_entry below */ - if (!rec_get_deleted_flag(rec, index->table->comp)) { + if (!rec_get_deleted_flag(rec, + dict_table_is_comp(index->table))) { err = btr_cur_del_mark_set_sec_rec(0, btr_cur, TRUE, thr, &mtr); if (err == DB_SUCCESS && check_ref) { @@ -1527,7 +1528,7 @@ row_upd_clust_rec( btr_cur = btr_pcur_get_btr_cur(pcur); ut_ad(!rec_get_deleted_flag(btr_pcur_get_rec(pcur), - index->table->comp)); + dict_table_is_comp(index->table))); /* Try optimistic updating of the record, keeping changes within the page; we do not check locks because we assume the x-lock on the @@ -1564,7 +1565,7 @@ row_upd_clust_rec( ut_a(btr_pcur_restore_position(BTR_MODIFY_TREE, pcur, mtr)); ut_ad(!rec_get_deleted_flag(btr_pcur_get_rec(pcur), - index->table->comp)); + dict_table_is_comp(index->table))); err = btr_cur_pessimistic_update(BTR_NO_LOCKING_FLAG, btr_cur, &big_rec, node->update, @@ -2058,7 +2059,7 @@ row_upd_in_place_in_select( row_upd_eval_new_vals(node->update); ut_ad(!rec_get_deleted_flag(btr_pcur_get_rec(pcur), - btr_cur->index->table->comp)); + dict_table_is_comp(btr_cur->index->table))); ut_ad(node->cmpl_info & UPD_NODE_NO_SIZE_CHANGE); ut_ad(node->cmpl_info & UPD_NODE_NO_ORD_CHANGE); diff --git a/row/row0vers.c b/row/row0vers.c index 07c5c96a2fa..971f6ae9d4c 100644 --- a/row/row0vers.c +++ b/row/row0vers.c @@ -123,7 +123,7 @@ row_vers_impl_x_locked_off_kernel( comp = page_rec_is_comp(rec); ut_ad(index->table == clust_index->table); - ut_ad(!!comp == index->table->comp); + ut_ad(!!comp == dict_table_is_comp(index->table)); ut_ad(!comp == !page_rec_is_comp(clust_rec)); /* We look up if some earlier version, which was modified by the trx_id @@ -323,7 +323,7 @@ row_vers_old_has_index_entry( clust_index = dict_table_get_first_index(index->table); comp = page_rec_is_comp(rec); - ut_ad(!index->table->comp == !comp); + ut_ad(!dict_table_is_comp(index->table) == !comp); heap = mem_heap_create(1024); clust_offsets = rec_get_offsets(rec, clust_index, NULL, ULINT_UNDEFINED, &heap); diff --git a/srv/srv0srv.c b/srv/srv0srv.c index 648cec22b3c..1256dd21c87 100644 --- a/srv/srv0srv.c +++ b/srv/srv0srv.c @@ -919,7 +919,7 @@ srv_init(void) /* create dummy table and index for old-style infimum and supremum */ table = dict_mem_table_create("SYS_DUMMY1", - DICT_HDR_SPACE, 1, FALSE); + DICT_HDR_SPACE, 1, 0); dict_mem_table_add_col(table, "DUMMY", DATA_CHAR, DATA_ENGLISH | DATA_NOT_NULL, 8, 0); @@ -930,7 +930,7 @@ srv_init(void) srv_sys->dummy_ind1->table = table; /* create dummy table and index for new-style infimum and supremum */ table = dict_mem_table_create("SYS_DUMMY2", - DICT_HDR_SPACE, 1, TRUE); + DICT_HDR_SPACE, 1, DICT_TF_COMPACT); dict_mem_table_add_col(table, "DUMMY", DATA_CHAR, DATA_ENGLISH | DATA_NOT_NULL, 8, 0); srv_sys->dummy_ind2 = dict_mem_index_create("SYS_DUMMY2", diff --git a/srv/srv0start.c b/srv/srv0start.c index a75eadc1471..c792d600500 100644 --- a/srv/srv0start.c +++ b/srv/srv0start.c @@ -1753,7 +1753,7 @@ innobase_shutdown_for_mysql(void) ut_print_timestamp(stderr); fprintf(stderr, " InnoDB: Warning: shutting down a not properly started\n" -" InnoDB: or created database!\n"); +" InnoDB: or created database!\n"); } return(DB_SUCCESS); diff --git a/trx/trx0rec.c b/trx/trx0rec.c index 8894a266c6f..5ffd42c08a6 100644 --- a/trx/trx0rec.c +++ b/trx/trx0rec.c @@ -455,7 +455,7 @@ trx_undo_page_report_modify( /* Store first some general parameters to the undo log */ if (update) { - if (rec_get_deleted_flag(rec, table->comp)) { + if (rec_get_deleted_flag(rec, dict_table_is_comp(table))) { type_cmpl = TRX_UNDO_UPD_DEL_REC; } else { type_cmpl = TRX_UNDO_UPD_EXIST_REC; @@ -480,7 +480,7 @@ trx_undo_page_report_modify( /*----------------------------------------*/ /* Store the state of the info bits */ - bits = rec_get_info_bits(rec, table->comp); + bits = rec_get_info_bits(rec, dict_table_is_comp(table)); mach_write_to_1(ptr, bits); ptr += 1; diff --git a/trx/trx0roll.c b/trx/trx0roll.c index ae145736bdc..fd733ef5fb8 100644 --- a/trx/trx0roll.c +++ b/trx/trx0roll.c @@ -240,7 +240,7 @@ trx_rollback_to_savepoint_for_mysql( if (trx->conc_state == TRX_NOT_STARTED) { ut_print_timestamp(stderr); - fputs(" InnoDB: Error: transaction has a savepoint ", stderr); + fputs(" InnoDB: Error: transaction has a savepoint ", stderr); ut_print_name(stderr, trx, savep->name); fputs(" though it is not started\n", stderr); return(DB_ERROR);