Commit 93634462 authored by Marko Mäkelä's avatar Marko Mäkelä

Remove dict_col_t::dropped

dict_col_t::DROPPED: Magic value for dict_col_t::ind
parent 16278657
......@@ -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;
}
}
......
......@@ -369,8 +369,7 @@ struct ha_innobase_inplace_ctx : public inplace_alter_handler_ctx
(&instant_table->instant
->dropped[d++])
dict_col_t(old_table->cols[i]);
drop->dropped = true;
drop->ind = 0;
drop->set_dropped();
}
}
#ifndef DBUG_OFF
......
......@@ -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;
......
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