summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2018-09-27 23:50:45 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2018-09-27 23:50:45 +0300
commit93634462e5802cbe728919a1bfea56cc3cb27271 (patch)
tree8f57d1b4a7e27758437391654310a75377b3723b
parent1627865700ad83e0d475cab7eaac498fd1bf2884 (diff)
downloadmariadb-git-10.4-mdev-15662.tar.gz
Remove dict_col_t::dropped10.4-mdev-15662
dict_col_t::DROPPED: Magic value for dict_col_t::ind
-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;