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

SQL: TRUNCATE FOR SYSTEM_TIME BEFORE [closes #111]

This commit is contained in:
kevg
2017-01-12 13:51:12 +03:00
committed by Aleksey Midenkov
parent 3a64d55aed
commit e069de7d9d
7 changed files with 112 additions and 6 deletions

View File

@ -283,11 +283,16 @@ bool mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds,
DBUG_RETURN(TRUE);
// trx_sees() in InnoDB reads sys_trx_start
if (!table->versioned_by_sql() &&
(select_lex->vers_conditions.type == FOR_SYSTEM_TIME_BETWEEN ||
select_lex->vers_conditions.type == FOR_SYSTEM_TIME_FROM_TO))
{
bitmap_set_bit(table->read_set, table->vers_start_field()->field_index);
if (!table->versioned_by_sql()) {
if (select_lex->vers_conditions.type == FOR_SYSTEM_TIME_BETWEEN ||
select_lex->vers_conditions.type == FOR_SYSTEM_TIME_FROM_TO)
{
bitmap_set_bit(table->read_set, table->vers_start_field()->field_index);
}
else if (select_lex->vers_conditions.type == FOR_SYSTEM_TIME_BEFORE)
{
bitmap_set_bit(table->read_set, table->vers_end_field()->field_index);
}
}
}