Commit 1efda582 authored by Marko Mäkelä's avatar Marko Mäkelä

Replace innobase_is_v_fld() with Field::stored_in_db()

The macro innobase_is_v_fld() turns out to be equivalent with
the opposite of Field::stored_in_db(). Remove the macro and
invoke the member function directly.

innodb_base_col_setup_for_stored(): Simplify a condition to only
check Field::vcol_info.

innobase_create_index_def(): Replace some redundant code with
DBUG_ASSERT().
parent 9471dbaf
...@@ -5986,7 +5986,7 @@ innobase_build_v_templ( ...@@ -5986,7 +5986,7 @@ innobase_build_v_templ(
Field* field = table->field[i]; Field* field = table->field[i];
/* Build template for virtual columns */ /* Build template for virtual columns */
if (innobase_is_v_fld(field)) { if (!field->stored_in_db()) {
#ifdef UNIV_DEBUG #ifdef UNIV_DEBUG
const char* name; const char* name;
...@@ -7475,7 +7475,7 @@ build_template_needs_field( ...@@ -7475,7 +7475,7 @@ build_template_needs_field(
{ {
const Field* field = table->field[i]; const Field* field = table->field[i];
if (innobase_is_v_fld(field) && omits_virtual_cols(*table->s)) { if (!field->stored_in_db() && omits_virtual_cols(*table->s)) {
return NULL; return NULL;
} }
...@@ -7555,7 +7555,7 @@ build_template_field( ...@@ -7555,7 +7555,7 @@ build_template_field(
templ = prebuilt->mysql_template + prebuilt->n_template++; templ = prebuilt->mysql_template + prebuilt->n_template++;
UNIV_MEM_INVALID(templ, sizeof *templ); UNIV_MEM_INVALID(templ, sizeof *templ);
templ->is_virtual = innobase_is_v_fld(field); templ->is_virtual = !field->stored_in_db();
if (!templ->is_virtual) { if (!templ->is_virtual) {
templ->col_no = i; templ->col_no = i;
...@@ -7799,7 +7799,7 @@ ha_innobase::build_template( ...@@ -7799,7 +7799,7 @@ ha_innobase::build_template(
/* Push down an index condition or an end_range check. */ /* Push down an index condition or an end_range check. */
for (ulint i = 0; i < n_fields; i++) { for (ulint i = 0; i < n_fields; i++) {
const Field* field = table->field[i]; const Field* field = table->field[i];
const bool is_v = innobase_is_v_fld(field); const bool is_v = !field->stored_in_db();
if (is_v && skip_virtual) { if (is_v && skip_virtual) {
num_v++; num_v++;
continue; continue;
...@@ -7939,7 +7939,7 @@ ha_innobase::build_template( ...@@ -7939,7 +7939,7 @@ ha_innobase::build_template(
for (ulint i = 0; i < n_fields; i++) { for (ulint i = 0; i < n_fields; i++) {
mysql_row_templ_t* templ; mysql_row_templ_t* templ;
const Field* field = table->field[i]; const Field* field = table->field[i];
const bool is_v = innobase_is_v_fld(field); const bool is_v = !field->stored_in_db();
if (is_v && skip_virtual) { if (is_v && skip_virtual) {
num_v++; num_v++;
continue; continue;
...@@ -7989,7 +7989,7 @@ ha_innobase::build_template( ...@@ -7989,7 +7989,7 @@ ha_innobase::build_template(
for (ulint i = 0; i < n_fields; i++) { for (ulint i = 0; i < n_fields; i++) {
const Field* field = table->field[i]; const Field* field = table->field[i];
const bool is_v = innobase_is_v_fld(field); const bool is_v = !field->stored_in_db();
if (whole_row) { if (whole_row) {
if (is_v && skip_virtual) { if (is_v && skip_virtual) {
...@@ -8533,7 +8533,7 @@ calc_row_difference( ...@@ -8533,7 +8533,7 @@ calc_row_difference(
for (uint i = 0; i < table->s->fields; i++) { for (uint i = 0; i < table->s->fields; i++) {
field = table->field[i]; field = table->field[i];
const bool is_virtual = innobase_is_v_fld(field); const bool is_virtual = !field->stored_in_db();
if (is_virtual && skip_virtual) { if (is_virtual && skip_virtual) {
continue; continue;
} }
...@@ -8907,7 +8907,7 @@ wsrep_calc_row_hash( ...@@ -8907,7 +8907,7 @@ wsrep_calc_row_hash(
byte true_byte=1; byte true_byte=1;
const Field* field = table->field[i]; const Field* field = table->field[i];
if (innobase_is_v_fld(field)) { if (!field->stored_in_db()) {
continue; continue;
} }
...@@ -10986,10 +10986,8 @@ innodb_base_col_setup_for_stored( ...@@ -10986,10 +10986,8 @@ innodb_base_col_setup_for_stored(
for (uint i= 0; i < field->table->s->fields; ++i) { for (uint i= 0; i < field->table->s->fields; ++i) {
const Field* base_field = field->table->field[i]; const Field* base_field = field->table->field[i];
if (!innobase_is_s_fld(base_field) if (!base_field->vcol_info
&& !innobase_is_v_fld(base_field) && bitmap_is_set(&field->table->tmp_set, i)) {
&& bitmap_is_set(&field->table->tmp_set,
i)) {
ulint z; ulint z;
for (z = 0; z < table->n_cols; z++) { for (z = 0; z < table->n_cols; z++) {
const char* name = dict_table_get_col_name( const char* name = dict_table_get_col_name(
...@@ -11367,17 +11365,16 @@ create_index( ...@@ -11367,17 +11365,16 @@ create_index(
key->user_defined_key_parts); key->user_defined_key_parts);
for (ulint i = 0; i < key->user_defined_key_parts; i++) { for (ulint i = 0; i < key->user_defined_key_parts; i++) {
KEY_PART_INFO* key_part = key->key_part + i; const Field* field = key->key_part[i].field;
/* We do not support special (Fulltext or Spatial) /* We do not support special (Fulltext or Spatial)
index on virtual columns */ index on virtual columns */
if (innobase_is_v_fld(key_part->field)) { if (!field->stored_in_db()) {
ut_ad(0); ut_ad(0);
DBUG_RETURN(HA_ERR_UNSUPPORTED); DBUG_RETURN(HA_ERR_UNSUPPORTED);
} }
dict_mem_index_add_field( dict_mem_index_add_field(index, field->field_name, 0);
index, key_part->field->field_name, 0);
} }
DBUG_RETURN(convert_error_code_to_mysql( DBUG_RETURN(convert_error_code_to_mysql(
...@@ -11465,7 +11462,7 @@ create_index( ...@@ -11465,7 +11462,7 @@ create_index(
field_lengths[i] = key_part->length; field_lengths[i] = key_part->length;
if (innobase_is_v_fld(key_part->field)) { if (!key_part->field->stored_in_db()) {
index->type |= DICT_VIRTUAL; index->type |= DICT_VIRTUAL;
} }
...@@ -12502,19 +12499,17 @@ create_table_info_t::gcols_in_fulltext_or_spatial() ...@@ -12502,19 +12499,17 @@ create_table_info_t::gcols_in_fulltext_or_spatial()
{ {
for (ulint i = 0; i < m_form->s->keys; i++) { for (ulint i = 0; i < m_form->s->keys; i++) {
const KEY* key = m_form->key_info + i; const KEY* key = m_form->key_info + i;
if (key->flags & (HA_SPATIAL | HA_FULLTEXT)) { if (!(key->flags & (HA_SPATIAL | HA_FULLTEXT))) {
for (ulint j = 0; j < key->user_defined_key_parts; j++) { continue;
const KEY_PART_INFO* key_part = key->key_part + j; }
for (ulint j = 0; j < key->user_defined_key_parts; j++) {
/* We do not support special (Fulltext or /* We do not support special (Fulltext or
Spatial) index on virtual columns */ Spatial) index on virtual columns */
if (innobase_is_v_fld(key_part->field)) { if (!key->key_part[j].field->stored_in_db()) {
my_error(ER_UNSUPPORTED_ACTION_ON_GENERATED_COLUMN, MYF(0)); my_error(ER_UNSUPPORTED_ACTION_ON_GENERATED_COLUMN, MYF(0));
return true; return true;
}
} }
} }
} }
return false; return false;
} }
...@@ -12820,7 +12815,7 @@ create_table_info_t::create_table_update_dict() ...@@ -12820,7 +12815,7 @@ create_table_info_t::create_table_update_dict()
} }
if (const Field* ai = m_form->found_next_number_field) { if (const Field* ai = m_form->found_next_number_field) {
ut_ad(!innobase_is_v_fld(ai)); ut_ad(ai->stored_in_db());
ib_uint64_t autoinc = m_create_info->auto_increment_value; ib_uint64_t autoinc = m_create_info->auto_increment_value;
......
...@@ -846,10 +846,8 @@ innodb_base_col_setup_for_stored( ...@@ -846,10 +846,8 @@ innodb_base_col_setup_for_stored(
const Field* field, const Field* field,
dict_s_col_t* s_col); dict_s_col_t* s_col);
/** whether this is a stored column */ /** whether this is a stored generated column */
#define innobase_is_s_fld(field) ((field)->vcol_info && (field)->stored_in_db()) #define innobase_is_s_fld(field) ((field)->vcol_info && (field)->stored_in_db())
/** whether this is a computed virtual column */
#define innobase_is_v_fld(field) ((field)->vcol_info && !(field)->stored_in_db())
/** Always normalize table name to lower case on Windows */ /** Always normalize table name to lower case on Windows */
#ifdef _WIN32 #ifdef _WIN32
......
...@@ -485,7 +485,7 @@ check_v_col_in_order( ...@@ -485,7 +485,7 @@ check_v_col_in_order(
cf_it.rewind(); cf_it.rewind();
while (const Create_field* new_field = cf_it++) { while (const Create_field* new_field = cf_it++) {
if (!innobase_is_v_fld(new_field)) { if (new_field->stored_in_db()) {
continue; continue;
} }
...@@ -517,8 +517,6 @@ check_v_col_in_order( ...@@ -517,8 +517,6 @@ check_v_col_in_order(
continue; continue;
} }
ut_ad(innobase_is_v_fld(field));
if (field->flags & FIELD_IS_DROPPED) { if (field->flags & FIELD_IS_DROPPED) {
continue; continue;
} }
...@@ -859,7 +857,7 @@ ha_innobase::check_if_supported_inplace_alter( ...@@ -859,7 +857,7 @@ ha_innobase::check_if_supported_inplace_alter(
online = false; online = false;
} }
if (innobase_is_v_fld(key_part->field)) { if (!key_part->field->stored_in_db()) {
/* Do not support adding index on newly added /* Do not support adding index on newly added
virtual column, while there is also a drop virtual column, while there is also a drop
virtual column in the same clause */ virtual column in the same clause */
...@@ -1288,7 +1286,7 @@ innobase_find_equiv_index( ...@@ -1288,7 +1286,7 @@ innobase_find_equiv_index(
/* Any index on virtual columns cannot be used /* Any index on virtual columns cannot be used
for reference constaint */ for reference constaint */
if (innobase_is_v_fld(key_part.field)) { if (!key_part.field->stored_in_db()) {
goto no_match; goto no_match;
} }
...@@ -1864,21 +1862,15 @@ innobase_fields_to_mysql( ...@@ -1864,21 +1862,15 @@ innobase_fields_to_mysql(
for (uint i = 0; i < n_fields; i++) { for (uint i = 0; i < n_fields; i++) {
Field* field = table->field[i]; Field* field = table->field[i];
ulint ipos; ulint ipos;
ulint col_n;
ulint prefix_col; ulint prefix_col;
field->reset(); field->reset();
if (innobase_is_v_fld(field)) { const bool is_v = !field->stored_in_db();
col_n = num_v; const ulint col_n = is_v ? num_v++ : i - num_v;
num_v++;
} else {
col_n = i - num_v;
}
ipos = dict_index_get_nth_col_or_prefix_pos( ipos = dict_index_get_nth_col_or_prefix_pos(
index, col_n, true, innobase_is_v_fld(field), index, col_n, true, is_v, &prefix_col);
&prefix_col);
if (ipos == ULINT_UNDEFINED if (ipos == ULINT_UNDEFINED
|| dfield_is_ext(&fields[ipos]) || dfield_is_ext(&fields[ipos])
...@@ -1924,7 +1916,7 @@ innobase_row_to_mysql( ...@@ -1924,7 +1916,7 @@ innobase_row_to_mysql(
field->reset(); field->reset();
if (innobase_is_v_fld(field)) { if (!field->stored_in_db()) {
/* Virtual column are not stored in InnoDB table, so /* Virtual column are not stored in InnoDB table, so
skip it */ skip it */
num_v++; num_v++;
...@@ -2150,7 +2142,7 @@ innobase_create_index_field_def( ...@@ -2150,7 +2142,7 @@ innobase_create_index_field_def(
: key_part->field; : key_part->field;
for (ulint i = 0; i < key_part->fieldnr; i++) { for (ulint i = 0; i < key_part->fieldnr; i++) {
if (innobase_is_v_fld(altered_table->field[i])) { if (!altered_table->field[i]->stored_in_db()) {
num_v++; num_v++;
} }
} }
...@@ -2158,11 +2150,9 @@ innobase_create_index_field_def( ...@@ -2158,11 +2150,9 @@ innobase_create_index_field_def(
col_type = get_innobase_type_from_mysql_type( col_type = get_innobase_type_from_mysql_type(
&is_unsigned, field); &is_unsigned, field);
if (innobase_is_v_fld(field)) { if ((index_field->is_v_col = !field->stored_in_db())) {
index_field->is_v_col = true;
index_field->col_no = num_v; index_field->col_no = num_v;
} else { } else {
index_field->is_v_col = false;
index_field->col_no = key_part->fieldnr - num_v; index_field->col_no = key_part->fieldnr - num_v;
} }
...@@ -2264,24 +2254,15 @@ innobase_create_index_def( ...@@ -2264,24 +2254,15 @@ innobase_create_index_def(
/* Need to count the virtual fields before this spatial /* Need to count the virtual fields before this spatial
indexed field */ indexed field */
for (ulint i = 0; i < key->key_part->fieldnr; i++) { for (ulint i = 0; i < key->key_part->fieldnr; i++) {
if (innobase_is_v_fld(altered_table->field[i])) { num_v += !altered_table->field[i]->stored_in_db();
num_v++;
}
} }
index->fields[0].col_no = key->key_part[0].fieldnr - num_v; index->fields[0].col_no = key->key_part[0].fieldnr - num_v;
index->fields[0].prefix_len = 0; index->fields[0].prefix_len = 0;
index->fields[0].is_v_col = false; index->fields[0].is_v_col = false;
if (innobase_is_v_fld(key->key_part[0].field)) { /* Currently, the spatial index cannot be created
on virtual columns. It is blocked in the SQL layer. */
/* Currently, the spatial index cannot be created DBUG_ASSERT(key->key_part[0].field->stored_in_db());
on virtual columns. It is blocked in server
layer */
ut_ad(0);
index->fields[0].is_v_col = true;
} else {
index->fields[0].is_v_col = false;
}
} else { } else {
index->ind_type = (key->flags & HA_NOSAME) ? DICT_UNIQUE : 0; index->ind_type = (key->flags & HA_NOSAME) ? DICT_UNIQUE : 0;
} }
...@@ -2329,7 +2310,7 @@ innobase_fts_check_doc_id_col( ...@@ -2329,7 +2310,7 @@ innobase_fts_check_doc_id_col(
for (i = 0; i < n_cols; i++) { for (i = 0; i < n_cols; i++) {
const Field* field = altered_table->field[i]; const Field* field = altered_table->field[i];
if (innobase_is_v_fld(field)) { if (!field->stored_in_db()) {
(*num_v)++; (*num_v)++;
} }
...@@ -2345,7 +2326,7 @@ innobase_fts_check_doc_id_col( ...@@ -2345,7 +2326,7 @@ innobase_fts_check_doc_id_col(
|| field->pack_length() != 8 || field->pack_length() != 8
|| field->real_maybe_null() || field->real_maybe_null()
|| !(field->flags & UNSIGNED_FLAG) || !(field->flags & UNSIGNED_FLAG)
|| innobase_is_v_fld(field)) { || !field->stored_in_db()) {
my_error(ER_INNODB_FT_WRONG_DOCID_COLUMN, MYF(0), my_error(ER_INNODB_FT_WRONG_DOCID_COLUMN, MYF(0),
field->field_name); field->field_name);
} else { } else {
...@@ -3082,17 +3063,12 @@ innobase_build_col_map( ...@@ -3082,17 +3063,12 @@ innobase_build_col_map(
} }
while (const Create_field* new_field = cf_it++) { while (const Create_field* new_field = cf_it++) {
bool is_v = false; bool is_v = !new_field->stored_in_db();
if (innobase_is_v_fld(new_field)) {
is_v = true;
}
ulint num_old_v = 0; ulint num_old_v = 0;
for (uint old_i = 0; table->field[old_i]; old_i++) { for (uint old_i = 0; table->field[old_i]; old_i++) {
const Field* field = table->field[old_i]; const Field* field = table->field[old_i];
if (innobase_is_v_fld(field)) { if (!field->stored_in_db()) {
if (is_v && new_field->field == field) { if (is_v && new_field->field == field) {
col_map[old_table->n_cols + num_v] col_map[old_table->n_cols + num_v]
= num_old_v; = num_old_v;
...@@ -3236,14 +3212,12 @@ innobase_get_col_names( ...@@ -3236,14 +3212,12 @@ innobase_get_col_names(
ulint num_v = 0; ulint num_v = 0;
DBUG_ASSERT(i < altered_table->s->fields); DBUG_ASSERT(i < altered_table->s->fields);
if (innobase_is_v_fld(new_field)) { if (!new_field->stored_in_db()) {
continue; continue;
} }
for (uint old_i = 0; table->field[old_i]; old_i++) { for (uint old_i = 0; table->field[old_i]; old_i++) {
if (innobase_is_v_fld(table->field[old_i])) { num_v += !table->field[old_i]->stored_in_db();
num_v++;
}
if (new_field->field == table->field[old_i]) { if (new_field->field == table->field[old_i]) {
cols[old_i - num_v] = new_field->field_name; cols[old_i - num_v] = new_field->field_name;
...@@ -3528,7 +3502,7 @@ innobase_check_gis_columns( ...@@ -3528,7 +3502,7 @@ innobase_check_gis_columns(
const KEY_PART_INFO& key_part = key.key_part[0]; const KEY_PART_INFO& key_part = key.key_part[0];
/* Does not support spatial index on virtual columns */ /* Does not support spatial index on virtual columns */
if (innobase_is_v_fld(key_part.field)) { if (!key_part.field->stored_in_db()) {
DBUG_RETURN(DB_UNSUPPORTED); DBUG_RETURN(DB_UNSUPPORTED);
} }
...@@ -3629,7 +3603,7 @@ prepare_inplace_add_virtual( ...@@ -3629,7 +3603,7 @@ prepare_inplace_add_virtual(
&is_unsigned, field); &is_unsigned, field);
if (!innobase_is_v_fld(field)) { if (field->stored_in_db()) {
continue; continue;
} }
...@@ -4268,7 +4242,7 @@ innodb_v_adjust_idx_col( ...@@ -4268,7 +4242,7 @@ innodb_v_adjust_idx_col(
/* Found the field in the new table */ /* Found the field in the new table */
while (const Create_field* new_field = cf_it++) { while (const Create_field* new_field = cf_it++) {
if (!innobase_is_v_fld(new_field)) { if (new_field->stored_in_db()) {
continue; continue;
} }
...@@ -4288,7 +4262,7 @@ innodb_v_adjust_idx_col( ...@@ -4288,7 +4262,7 @@ innodb_v_adjust_idx_col(
ut_a(0); ut_a(0);
} }
ut_ad(innobase_is_v_fld(field)); ut_ad(!field->stored_in_db());
num_v = 0; num_v = 0;
...@@ -4302,9 +4276,7 @@ innodb_v_adjust_idx_col( ...@@ -4302,9 +4276,7 @@ innodb_v_adjust_idx_col(
break; break;
} }
if (innobase_is_v_fld(old_table->field[old_i])) { num_v += !old_table->field[old_i]->stored_in_db();
num_v++;
}
} }
ut_ad(col_found); ut_ad(col_found);
...@@ -4577,10 +4549,10 @@ prepare_inplace_alter_table_dict( ...@@ -4577,10 +4549,10 @@ prepare_inplace_alter_table_dict(
for (uint i = 0; i < altered_table->s->fields; i++) { for (uint i = 0; i < altered_table->s->fields; i++) {
const Field* field = altered_table->field[i]; const Field* field = altered_table->field[i];
if (innobase_is_v_fld(field)) { if (!field->stored_in_db()) {
n_v_cols++; n_v_cols++;
} else { } else {
n_cols++; n_cols++;
} }
} }
...@@ -4632,7 +4604,7 @@ prepare_inplace_alter_table_dict( ...@@ -4632,7 +4604,7 @@ prepare_inplace_alter_table_dict(
&is_unsigned, field); &is_unsigned, field);
ulint charset_no; ulint charset_no;
ulint col_len; ulint col_len;
bool is_virtual = innobase_is_v_fld(field); const bool is_virtual = !field->stored_in_db();
/* we assume in dtype_form_prtype() that this /* we assume in dtype_form_prtype() that this
fits in two bytes */ fits in two bytes */
...@@ -4717,7 +4689,7 @@ prepare_inplace_alter_table_dict( ...@@ -4717,7 +4689,7 @@ prepare_inplace_alter_table_dict(
dict_v_col_t* v_col; dict_v_col_t* v_col;
const Field* field = altered_table->field[i]; const Field* field = altered_table->field[i];
if (!innobase_is_v_fld(field)) { if (!!field->stored_in_db()) {
continue; continue;
} }
v_col = dict_table_get_nth_v_col( v_col = dict_table_get_nth_v_col(
...@@ -5471,7 +5443,7 @@ alter_fill_stored_column( ...@@ -5471,7 +5443,7 @@ alter_fill_stored_column(
Field* field = altered_table->field[i]; Field* field = altered_table->field[i];
dict_s_col_t s_col; dict_s_col_t s_col;
if (!innobase_is_v_fld(field)) { if (field->stored_in_db()) {
stored_col_no++; stored_col_no++;
} }
...@@ -5721,7 +5693,7 @@ ha_innobase::prepare_inplace_alter_table( ...@@ -5721,7 +5693,7 @@ ha_innobase::prepare_inplace_alter_table(
MySQL should have checked these already. MySQL should have checked these already.
We want to allow renaming of c1 to c2, c2 to c1. */ We want to allow renaming of c1 to c2, c2 to c1. */
for (j = 0; j < table->s->fields; j++) { for (j = 0; j < table->s->fields; j++) {
if (!innobase_is_v_fld(table->field[j])) { if (table->field[j]->stored_in_db()) {
s += strlen(s) + 1; s += strlen(s) + 1;
} }
} }
...@@ -6267,10 +6239,7 @@ ha_innobase::prepare_inplace_alter_table( ...@@ -6267,10 +6239,7 @@ ha_innobase::prepare_inplace_alter_table(
autoinc_col_max_value = innobase_get_int_col_max_value(field); autoinc_col_max_value = innobase_get_int_col_max_value(field);
} }
found_col: found_col:
if (innobase_is_v_fld(new_field)) { num_v += !new_field->stored_in_db();
++num_v;
}
i++; i++;
} }
...@@ -7172,13 +7141,13 @@ innobase_rename_columns_try( ...@@ -7172,13 +7141,13 @@ innobase_rename_columns_try(
& Alter_inplace_info::ALTER_COLUMN_NAME); & Alter_inplace_info::ALTER_COLUMN_NAME);
for (Field** fp = table->field; *fp; fp++, i++) { for (Field** fp = table->field; *fp; fp++, i++) {
bool is_virtual = innobase_is_v_fld(*fp); const bool is_virtual = !(*fp)->stored_in_db();
if (!((*fp)->flags & FIELD_IS_RENAMED)) { if (!((*fp)->flags & FIELD_IS_RENAMED)) {
goto processed_field; goto processed_field;
} }
cf_it.rewind(); cf_it.rewind();
while (Create_field* cf = cf_it++) { while (Create_field* cf = cf_it++) {
if (cf->field == *fp) { if (cf->field == *fp) {
ulint col_n = is_virtual ulint col_n = is_virtual
...@@ -7331,19 +7300,10 @@ innobase_enlarge_columns_try( ...@@ -7331,19 +7300,10 @@ innobase_enlarge_columns_try(
ha_alter_info->alter_info->create_list); ha_alter_info->alter_info->create_list);
ulint i = 0; ulint i = 0;
ulint num_v = 0; ulint num_v = 0;
bool is_v;
for (Field** fp = table->field; *fp; fp++, i++) { for (Field** fp = table->field; *fp; fp++, i++) {
ulint idx; const bool is_v = !(*fp)->stored_in_db();
ulint idx = is_v ? num_v++ : i - num_v;
if (innobase_is_v_fld(*fp)) {
is_v = true;
idx = num_v;
num_v++;
} else {
idx = i - num_v;
is_v = false;
}
cf_it.rewind(); cf_it.rewind();
while (Create_field* cf = cf_it++) { while (Create_field* cf = cf_it++) {
...@@ -7389,7 +7349,7 @@ innobase_rename_or_enlarge_columns_cache( ...@@ -7389,7 +7349,7 @@ innobase_rename_or_enlarge_columns_cache(
ulint num_v = 0; ulint num_v = 0;
for (Field** fp = table->field; *fp; fp++, i++) { for (Field** fp = table->field; *fp; fp++, i++) {
bool is_virtual = innobase_is_v_fld(*fp); const bool is_virtual = !(*fp)->stored_in_db();
cf_it.rewind(); cf_it.rewind();
while (Create_field* cf = cf_it++) { while (Create_field* cf = cf_it++) {
......
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