Commit d8b5a3af authored by marko's avatar marko

dict_table_t: Remove the field "type".

dict_load_table(): Refuse to load tables with other TYPE than
DICT_TABLE_ORDINARY.
parent 7631ed9c
......@@ -75,7 +75,7 @@ dict_create_sys_tables_tuple(
dfield = dtuple_get_nth_field(entry, 3);
ptr = mem_heap_alloc(heap, 4);
mach_write_to_4(ptr, table->type);
mach_write_to_4(ptr, DICT_TABLE_ORDINARY);
dfield_set_data(dfield, ptr, 4);
/* 6: MIX_ID ---------------------------*/
......
......@@ -1774,8 +1774,6 @@ dict_index_build_internal_clust(
new_index->id = index->id;
ut_a(table->type == DICT_TABLE_ORDINARY);
/* Copy the fields of index */
dict_index_copy(new_index, index, 0, index->n_fields);
......
......@@ -768,7 +768,7 @@ dict_load_table(
if (!btr_pcur_is_on_user_rec(&pcur, &mtr)
|| rec_get_deleted_flag(rec, 0)) {
/* Not found */
err_exit:
btr_pcur_close(&pcur);
mtr_commit(&mtr);
mem_heap_free(heap);
......@@ -780,11 +780,8 @@ dict_load_table(
/* Check if the table name in record is the searched one */
if (len != ut_strlen(name) || ut_memcmp(name, field, len) != 0) {
btr_pcur_close(&pcur);
mtr_commit(&mtr);
mem_heap_free(heap);
return(NULL);
goto err_exit;
}
ut_a(0 == ut_strcmp("SPACE",
......@@ -848,8 +845,13 @@ dict_load_table(
table->id = mach_read_from_8(field);
field = rec_get_nth_field_old(rec, 5, &len);
table->type = mach_read_from_4(field);
ut_a(table->type == DICT_TABLE_ORDINARY);
if (UNIV_UNLIKELY(mach_read_from_4(field) != DICT_TABLE_ORDINARY)) {
ut_print_timestamp(stderr);
fprintf(stderr,
" InnoDB: table %s: unknown table type %lu\n",
name, (ulong) mach_read_from_4(field));
goto err_exit;
}
btr_pcur_close(&pcur);
mtr_commit(&mtr);
......
......@@ -50,7 +50,6 @@ 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;
......
......@@ -281,7 +281,6 @@ a foreign key constraint is enforced, therefore RESTRICT just means no flag */
/* Data structure for a database table */
struct dict_table_struct{
dulint id; /* id of the table */
ulint type; /* DICT_TABLE_ORDINARY, ... */
ulint flags; /* DICT_TF_COMPACT, ... */
mem_heap_t* heap; /* memory heap */
const char* name; /* table name */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment