mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
SQL, Parser: system_time logic and syntax fixes [closes #237]
This commit is contained in:
@ -263,8 +263,7 @@ bool mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds,
|
||||
if (open_and_lock_tables(thd, table_list, TRUE, 0))
|
||||
DBUG_RETURN(TRUE);
|
||||
|
||||
bool truncate_history=
|
||||
select_lex->vers_conditions.type != FOR_SYSTEM_TIME_UNSPECIFIED;
|
||||
bool truncate_history= table_list->vers_conditions;
|
||||
if (truncate_history)
|
||||
{
|
||||
TABLE *table= table_list->table;
|
||||
@ -276,12 +275,12 @@ bool mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds,
|
||||
|
||||
// trx_sees() in InnoDB reads sys_trx_start
|
||||
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)
|
||||
if (table_list->vers_conditions.type == FOR_SYSTEM_TIME_BETWEEN ||
|
||||
table_list->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)
|
||||
else if (table_list->vers_conditions.type == FOR_SYSTEM_TIME_BEFORE)
|
||||
{
|
||||
bitmap_set_bit(table->read_set, table->vers_end_field()->field_index);
|
||||
}
|
||||
|
Reference in New Issue
Block a user