Commit 3789692d authored by Sergei Golubchik's avatar Sergei Golubchik

don't compare unassigned columns

on UPDATE, compare_record() was comparing all columns that are marked
for writing. But generated columns that are written to the table are
always deterministic and cannot change unless normal non-generated
columns were changed. So it's enough to compare only non-generated
columns that were explicitly assigned values in the SET clause.
parent 17ab02f4
......@@ -76,7 +76,7 @@ bool compare_record(const TABLE *table)
for (Field **ptr= table->field ; *ptr != NULL; ptr++)
{
Field *field= *ptr;
if (bitmap_is_set(table->write_set, field->field_index))
if (field->has_explicit_value() && !field->vcol_info)
{
if (field->real_maybe_null())
{
......@@ -108,8 +108,9 @@ bool compare_record(const TABLE *table)
/* Compare updated fields */
for (Field **ptr= table->field ; *ptr ; ptr++)
{
if (bitmap_is_set(table->write_set, (*ptr)->field_index) &&
(*ptr)->cmp_binary_offset(table->s->rec_buff_length))
Field *field= *ptr;
if (field->has_explicit_value() && !field->vcol_info &&
field->cmp_binary_offset(table->s->rec_buff_length))
return TRUE;
}
return FALSE;
......
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