mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
MDEV-18727 improve DML operation of System Versioning
MDEV-18957 UPDATE with LIMIT clause is wrong for versioned partitioned tables UPDATE, DELETE: replace linear search of current/historical records with vers_setup_conds(). Additional DML cases in view.test
This commit is contained in:
@ -4710,8 +4710,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,
|
||||
@ -4733,6 +4735,7 @@ mysql_execute_command(THD *thd)
|
||||
if (lex->describe || lex->analyze_stmt)
|
||||
res= thd->lex->explain->send_explain(thd);
|
||||
}
|
||||
multi_delete_error:
|
||||
delete result;
|
||||
}
|
||||
}
|
||||
@ -9483,7 +9486,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);
|
||||
|
Reference in New Issue
Block a user