summaryrefslogtreecommitdiff
path: root/sql/sql_parse.cc
diff options
context:
space:
mode:
authorAleksey Midenkov <midenok@gmail.com>2019-11-22 14:29:03 +0300
committerAleksey Midenkov <midenok@gmail.com>2019-11-22 14:29:03 +0300
commit0076dce2c89248b6c0252ec4385879194f9aadbf (patch)
tree1774fb25fcbe854aee956841ab28298029b548f6 /sql/sql_parse.cc
parenta14544260c33dcdb057d2f62c4aab33cb09ebcb1 (diff)
downloadmariadb-git-0076dce2c89248b6c0252ec4385879194f9aadbf.tar.gz
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
Diffstat (limited to 'sql/sql_parse.cc')
-rw-r--r--sql/sql_parse.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index a8e66d2a230..861d50e8872 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -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);