1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-01 03:47:19 +03:00

MDEV-18727 improve DML operation of System Versioning (10.4)

UPDATE, DELETE: replace linear search of current/historical records
with vers_setup_conds().

Additional DML cases in view.test
This commit is contained in:
Aleksey Midenkov
2019-11-25 16:01:43 +03:00
parent 4111a53079
commit 33f55789d3
20 changed files with 267 additions and 107 deletions

View File

@ -4778,8 +4778,10 @@ mysql_execute_command(THD *thd)
{
result= new (thd->mem_root) multi_delete(thd, aux_tables,
lex->table_count);
if (unlikely(result))
if (likely(result))
{
if (unlikely(select_lex->vers_setup_conds(thd, aux_tables)))
goto multi_delete_error;
res= mysql_select(thd,
select_lex->get_table_list(),
select_lex->with_wild,
@ -4801,6 +4803,7 @@ mysql_execute_command(THD *thd)
if (lex->describe || lex->analyze_stmt)
res= thd->lex->explain->send_explain(thd);
}
multi_delete_error:
delete result;
}
}
@ -9595,7 +9598,7 @@ bool update_precheck(THD *thd, TABLE_LIST *tables)
bool delete_precheck(THD *thd, TABLE_LIST *tables)
{
DBUG_ENTER("delete_precheck");
if (tables->vers_conditions.is_set())
if (tables->vers_conditions.delete_history)
{
if (check_one_table_access(thd, DELETE_HISTORY_ACL, tables))
DBUG_RETURN(TRUE);