summaryrefslogtreecommitdiff
path: root/storage/innobase/dict/dict0crea.cc
diff options
context:
space:
mode:
Diffstat (limited to 'storage/innobase/dict/dict0crea.cc')
-rw-r--r--storage/innobase/dict/dict0crea.cc48
1 files changed, 25 insertions, 23 deletions
diff --git a/storage/innobase/dict/dict0crea.cc b/storage/innobase/dict/dict0crea.cc
index 8a06cd1db2c..77a79e32605 100644
--- a/storage/innobase/dict/dict0crea.cc
+++ b/storage/innobase/dict/dict0crea.cc
@@ -67,6 +67,7 @@ dict_create_sys_tables_tuple(
ut_ad(table);
ut_ad(heap);
+ ut_ad(table->n_cols >= DATA_N_SYS_COLS);
sys_tables = dict_sys->sys_tables;
@@ -100,7 +101,8 @@ dict_create_sys_tables_tuple(
/* If there is any virtual column, encode it in N_COLS */
mach_write_to_4(ptr, dict_table_encode_n_col(
- static_cast<ulint>(table->n_def),
+ static_cast<ulint>(table->n_cols
+ - DATA_N_SYS_COLS),
static_cast<ulint>(table->n_v_def))
| ((table->flags & DICT_TF_COMPACT) << 31));
dfield_set_data(dfield, ptr, 4);
@@ -404,9 +406,8 @@ dict_build_tablespace_for_table(
ut_ad(!dict_table_is_temporary(table));
/* This table will need a new tablespace. */
- ut_ad(dict_table_get_format(table) <= UNIV_FORMAT_MAX);
ut_ad(DICT_TF_GET_ZIP_SSIZE(table->flags) == 0
- || dict_table_get_format(table) >= UNIV_FORMAT_B);
+ || dict_table_has_atomic_blobs(table));
/* Get a new tablespace ID */
dict_hdr_get_new_id(NULL, NULL, &space, table, false);
@@ -481,21 +482,6 @@ dict_build_tablespace_for_table(
return(DB_SUCCESS);
}
-/***************************************************************//**
-Builds a column definition to insert. */
-static
-void
-dict_build_col_def_step(
-/*====================*/
- tab_node_t* node) /*!< in: table create node */
-{
- dtuple_t* row;
-
- row = dict_create_sys_columns_tuple(node->table, node->col_no,
- node->heap);
- ins_node_set_new_row(node->col_def, row);
-}
-
/** Builds a SYS_VIRTUAL row definition to insert.
@param[in] node table create node */
static
@@ -1357,12 +1343,19 @@ dict_create_table_step(
if (node->state == TABLE_BUILD_COL_DEF) {
- if (node->col_no < (static_cast<ulint>(node->table->n_def)
- + static_cast<ulint>(node->table->n_v_def))) {
+ if (node->col_no + DATA_N_SYS_COLS
+ < (static_cast<ulint>(node->table->n_def)
+ + static_cast<ulint>(node->table->n_v_def))) {
- dict_build_col_def_step(node);
+ ulint i = node->col_no++;
+ if (i + DATA_N_SYS_COLS >= node->table->n_def) {
+ i += DATA_N_SYS_COLS;
+ }
- node->col_no++;
+ ins_node_set_new_row(
+ node->col_def,
+ dict_create_sys_columns_tuple(node->table, i,
+ node->heap));
thr->run_node = node->col_def;
@@ -1420,7 +1413,8 @@ dict_create_table_step(
if (node->state == TABLE_ADD_TO_CACHE) {
DBUG_EXECUTE_IF("ib_ddl_crash_during_create", DBUG_SUICIDE(););
- dict_table_add_to_cache(node->table, TRUE, node->heap);
+ node->table->can_be_evicted = true;
+ node->table->add_to_cache();
err = DB_SUCCESS;
}
@@ -1520,6 +1514,14 @@ dict_create_index_step(
goto function_exit;
}
+ ut_ad(!node->index->is_instant());
+ ut_ad(node->index->n_core_null_bytes
+ == ((dict_index_is_clust(node->index)
+ && node->table->supports_instant())
+ ? dict_index_t::NO_CORE_NULL_BYTES
+ : UT_BITS_IN_BYTES(node->index->n_nullable)));
+ node->index->n_core_null_bytes = UT_BITS_IN_BYTES(
+ node->index->n_nullable);
node->state = INDEX_CREATE_INDEX_TREE;
}