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

WIP: Add row_log_t::instant

parent fb978872
......@@ -222,6 +222,11 @@ struct row_log_t {
decryption or NULL */
const char* path; /*!< where to create temporary file during
log operation */
/** the instantly dropped columns in the clustered index of
the source table; before row_log_table_apply() completes, the
table could be emptied, so that table->is_instant() no longer holds,
but all log records must be in the "instant" format. */
dict_instant_t* instant;
/** the number of core fields in the clustered index of the
source table; before row_log_table_apply() completes, the
table could be emptied, so that table->is_instant() no longer holds,
......@@ -236,14 +241,15 @@ struct row_log_t {
const TABLE* old_table; /*< Use old table in case of error. */
uint64_t n_rows; /*< Number of rows read from the table */
/** Determine whether the log should be in the 'instant ADD' format
/** Determine whether the log should be in the 'instant ALTER TABLE'
format
@param[in] index the clustered index of the source table
@return whether to use the 'instant ADD COLUMN' format */
@return whether to use the 'instant ALTER TABLE' format */
bool is_instant(const dict_index_t* index) const
{
ut_ad(table);
ut_ad(n_core_fields <= index->n_fields);
return n_core_fields != index->n_fields;
ut_ad(n_core_fields <= index->n_fields || instant);
return instant || n_core_fields != index->n_fields;
}
const byte* instant_field_value(ulint n, ulint* len) const
......@@ -2530,6 +2536,7 @@ row_log_table_apply_op(
}
rec_offs_set_n_fields(offsets, dup->index->n_fields);
/* FIXME: pass log->instant as well */
rec_init_offsets_temp(mrec, dup->index, offsets,
log->n_core_fields,
log->non_core_fields,
......@@ -3205,6 +3212,9 @@ row_log_allocate(
log->head.total = 0;
log->path = path;
log->n_core_fields = index->n_core_fields;
#if 1 /* FIXME: when we add instant->heap, this must be a copy! */
log->instant = index->table->instant;
#endif
ut_ad(!table || log->is_instant(index) == index->is_instant());
log->allow_not_null = allow_not_null;
log->old_table = old_table;
......
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