1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

MDEV-29721 Inconsistency upon inserting history with visible period columns

don't set vers_write=false if one vers column was used explicitly,
instead do vers_update_fields() for columns that do not have explicit
value. So, if row_start has the value and row_end not, row_end will
get max by default.
This commit is contained in:
Sergei Golubchik
2022-10-10 10:30:51 +02:00
parent 8d2ec37a40
commit d94ed0bb2a
7 changed files with 88 additions and 63 deletions

View File

@ -1749,11 +1749,10 @@ int mysql_prepare_insert(THD *thd, TABLE_LIST *table_list,
if (duplic == DUP_REPLACE && table_list->set_insert_values(thd->mem_root))
DBUG_RETURN(1);
Field *row_start= table->vers_start_field();
Field *row_end= table->vers_end_field();
if (!fields.elements && !(row_start->invisible && row_end->invisible) &&
thd->vers_insert_history(row_start))
table->vers_write= false;
Field *row_start= table->vers_start_field();
Field *row_end= table->vers_end_field();
if (!fields.elements && !(row_start->invisible && row_end->invisible))
thd->vers_insert_history(row_start); // check privileges
}
if (!select_insert)
@ -4194,6 +4193,7 @@ int select_insert::send_data(List<Item> &values)
bool error=0;
thd->count_cuted_fields= CHECK_FIELD_WARN; // Calculate cuted fields
table->reset_default_fields();
store_values(values);
if (table->default_field &&
unlikely(table->update_default_fields(info.ignore)))