mirror of
https://github.com/MariaDB/server.git
synced 2025-07-07 06:01:31 +03:00
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.
This commit is contained in:
@ -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;
|
||||
|
Reference in New Issue
Block a user