summaryrefslogtreecommitdiff
path: root/sql/sql_delete.cc
diff options
context:
space:
mode:
authorEugene Kosov <claprix@yandex.ru>2019-07-26 15:22:31 +0300
committerEugene Kosov <claprix@yandex.ru>2019-07-26 15:22:31 +0300
commit4c7a74396497ae28779016b5bd59283aeee0b6f4 (patch)
tree31c49a23aede628f3afc3999faa290bc522923ad /sql/sql_delete.cc
parentde9e3930940c44458d254987066a81f1cea9b500 (diff)
parent29df1003d9faf09b635eedf10a0e3196e71bb297 (diff)
downloadmariadb-git-4c7a74396497ae28779016b5bd59283aeee0b6f4.tar.gz
Merge 10.3 into 10.4
Diffstat (limited to 'sql/sql_delete.cc')
-rw-r--r--sql/sql_delete.cc17
1 files changed, 10 insertions, 7 deletions
diff --git a/sql/sql_delete.cc b/sql/sql_delete.cc
index 26646d5c73f..583dcbbd8b3 100644
--- a/sql/sql_delete.cc
+++ b/sql/sql_delete.cc
@@ -351,8 +351,8 @@ bool mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds,
THD_STAGE_INFO(thd, stage_init_update);
- bool truncate_history= table_list->vers_conditions.is_set();
- if (truncate_history)
+ bool delete_history= table_list->vers_conditions.is_set();
+ if (delete_history)
{
DBUG_ASSERT(!table_list->period_conditions.is_set());
@@ -401,7 +401,10 @@ bool mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds,
select_lex->item_list, &conds,
&delete_while_scanning))
DBUG_RETURN(TRUE);
-
+
+ if (delete_history)
+ table->vers_write= false;
+
if (with_select)
(void) result->prepare(select_lex->item_list, NULL);
@@ -752,7 +755,7 @@ bool mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds,
while (!(error=info.read_record()) && !thd->killed &&
! thd->is_error())
{
- if (record_should_be_deleted(thd, table, select, explain, truncate_history))
+ if (record_should_be_deleted(thd, table, select, explain, delete_history))
{
table->file->position(table->record[0]);
if (unlikely((error=
@@ -801,10 +804,10 @@ bool mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds,
{
if (delete_while_scanning)
delete_record= record_should_be_deleted(thd, table, select, explain,
- truncate_history);
+ delete_history);
if (delete_record)
{
- if (!truncate_history && table->triggers &&
+ if (!delete_history && table->triggers &&
table->triggers->process_triggers(thd, TRG_EVENT_DELETE,
TRG_ACTION_BEFORE, FALSE))
{
@@ -840,7 +843,7 @@ bool mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds,
if (likely(!error))
{
deleted++;
- if (!truncate_history && table->triggers &&
+ if (!delete_history && table->triggers &&
table->triggers->process_triggers(thd, TRG_EVENT_DELETE,
TRG_ACTION_AFTER, FALSE))
{