MDEV-30597 Assertion `flag == 1' failed in row_build_index_entry_low

- dtuple_vcol_data_missing() should check the DATA_MISSING only for
indexed virtual column.
parent a777a8a6
......@@ -861,15 +861,25 @@ row_vers_build_cur_vrow(
}
/** Find out whether data tuple has missing data type
for virtualcolumn.
for indexed virtual column.
@param tuple data tuple
@param index virtual index
@return true if tuple has missing column type */
static bool dtuple_vcol_data_missing(const dtuple_t &tuple)
static bool dtuple_vcol_data_missing(const dtuple_t &tuple,
dict_index_t *index)
{
for (ulint i= 0; i < tuple.n_v_fields; i++)
for (ulint i= 0; i < index->n_uniq; i++)
{
if (tuple.v_fields[i].type.mtype == DATA_MISSING)
return true;
dict_col_t *col= index->fields[i].col;
if (!col->is_virtual())
continue;
dict_v_col_t *vcol= reinterpret_cast<dict_v_col_t*>(col);
for (ulint j= 0; j < index->table->n_v_cols; j++)
{
if (vcol == &index->table->v_cols[j]
&& tuple.v_fields[j].type.mtype == DATA_MISSING)
return true;
}
}
return false;
}
......@@ -1102,7 +1112,7 @@ row_vers_old_has_index_entry(
if (dict_index_has_virtual(index)) {
if (vrow) {
if (dtuple_vcol_data_missing(*vrow)) {
if (dtuple_vcol_data_missing(*vrow, index)) {
goto nochange_index;
}
/* Keep the virtual row info for the next
......
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