1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

MDEV-34033 Exchange partition with virtual columns fails

MDEV-28127 did is_equal() which compared vcol expressions
literally. But another table vcol expression is not equal because of
different table name.

We implement another comparison method is_identical() which respects
different table name in vcol comparison. If any field item points to
table_A and compared field item points to table_B, such items are
treated as equal in (table_A, table_B) comparison. This is done by
cloning table_B expression and renaming any table_B entries to table_A
in it.
This commit is contained in:
Aleksey Midenkov
2025-01-13 15:40:58 +03:00
parent 92383f8db1
commit 0cf2176b79
9 changed files with 119 additions and 1 deletions

View File

@ -7874,8 +7874,12 @@ bool mysql_compare_tables(TABLE *table, Alter_info *alter_info,
{
if (!tmp_new_field->field->vcol_info)
DBUG_RETURN(false);
if (!field->vcol_info->is_equal(tmp_new_field->field->vcol_info))
bool err;
if (!field->vcol_info->is_equivalent(thd, table->s, create_info->table->s,
tmp_new_field->field->vcol_info, err))
DBUG_RETURN(false);
if (err)
DBUG_RETURN(true);
}
/*