summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xstorage/innobase/dict/dict0mem.cc8
-rwxr-xr-xstorage/innobase/handler/handler0alter.cc3
-rwxr-xr-xstorage/innobase/include/dict0mem.h11
3 files changed, 11 insertions, 11 deletions
diff --git a/storage/innobase/dict/dict0mem.cc b/storage/innobase/dict/dict0mem.cc
index c05fc9a4c8e..cfc4066ce22 100755
--- a/storage/innobase/dict/dict0mem.cc
+++ b/storage/innobase/dict/dict0mem.cc
@@ -713,9 +713,9 @@ dict_mem_fill_column_struct(
dtype_get_mblen(mtype, prtype, &mbminlen, &mbmaxlen);
column->mbminlen = mbminlen;
column->mbmaxlen = mbmaxlen;
- column->dropped = false;
column->def_val.data = NULL;
column->def_val.len = UNIV_SQL_DEFAULT;
+ ut_ad(!column->is_dropped());
}
/**********************************************************************//**
@@ -1337,8 +1337,7 @@ inline void dict_index_t::instant_add_field(const dict_index_t& instant)
DBUG_ASSERT(!icol->is_virtual());
if (icol->is_dropped()) {
ut_d(n_dropped++);
- f.col->dropped = true;
- f.col->ind = 0;
+ f.col->set_dropped();
f.name = NULL;
} else {
f.col = &table->cols[icol - instant.table->cols];
@@ -1596,11 +1595,10 @@ void dict_table_t::construct_dropped_columns(const byte* data)
for (unsigned i = 0; i < n_dropped_cols; i++) {
dict_col_t& drop_col = dropped_cols[i];
bool is_fixed = false;
- drop_col.dropped = true;
+ drop_col.set_dropped();
while (j < num_non_pk_fields) {
if (non_pk_col_map[j++] == 0) {
- drop_col.ind = j + clust_index->n_uniq + 1;
break;
}
}
diff --git a/storage/innobase/handler/handler0alter.cc b/storage/innobase/handler/handler0alter.cc
index 997b517ade9..572ef18da32 100755
--- a/storage/innobase/handler/handler0alter.cc
+++ b/storage/innobase/handler/handler0alter.cc
@@ -369,8 +369,7 @@ add_metadata:
(&instant_table->instant
->dropped[d++])
dict_col_t(old_table->cols[i]);
- drop->dropped = true;
- drop->ind = 0;
+ drop->set_dropped();
}
}
#ifndef DBUG_OFF
diff --git a/storage/innobase/include/dict0mem.h b/storage/innobase/include/dict0mem.h
index 5d4aa6ea0d6..9752f7eda8e 100755
--- a/storage/innobase/include/dict0mem.h
+++ b/storage/innobase/include/dict0mem.h
@@ -587,9 +587,10 @@ struct dict_col_t{
this column. Our current max limit is
3072 (REC_VERSION_56_MAX_INDEX_COL_LEN)
bytes. */
-
- /** Whether the column has been instantly dropped. */
- unsigned dropped:1;
+private:
+ /** Special value of ind for a dropped column */
+ static const unsigned DROPPED = 1023;
+public:
/** Detach the column from an index.
@param[in] index index to be detached from */
@@ -649,8 +650,10 @@ struct dict_col_t{
DBUG_ASSERT(def_val.len != UNIV_SQL_DEFAULT || !def_val.data);
return def_val.len != UNIV_SQL_DEFAULT;
}
+ /** Flag the column instantly dropped */
+ void set_dropped() { ind = DROPPED; }
/** @return whether the column was instantly dropped */
- bool is_dropped() const { return dropped; }
+ bool is_dropped() const { return ind == DROPPED; }
/** @return whether the column was instantly dropped
@param[in] index the clustered index */
inline bool is_dropped(const dict_index_t& index) const;