summaryrefslogtreecommitdiff
path: root/sql/sql_delete.cc
diff options
context:
space:
mode:
authorunknown <sanja@montyprogram.com>2014-03-19 11:00:56 +0200
committerunknown <sanja@montyprogram.com>2014-03-19 11:00:56 +0200
commitaf3180ab6fa13b58fa4a4a2b00a89f2969dfa68d (patch)
treedf6af763f1bf35b482da253226f14a6c16c7d7af /sql/sql_delete.cc
parentf1ca1f37c9c7a71456ed5ed0a46904c0a075cc32 (diff)
downloadmariadb-git-af3180ab6fa13b58fa4a4a2b00a89f2969dfa68d.tar.gz
MDEV-9095: Executing triggers on slave in row-based replication
Diffstat (limited to 'sql/sql_delete.cc')
-rw-r--r--sql/sql_delete.cc22
1 files changed, 2 insertions, 20 deletions
diff --git a/sql/sql_delete.cc b/sql/sql_delete.cc
index b92a4cd23f6..a8f4018a53b 100644
--- a/sql/sql_delete.cc
+++ b/sql/sql_delete.cc
@@ -521,16 +521,8 @@ bool mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds,
init_ftfuncs(thd, select_lex, 1);
THD_STAGE_INFO(thd, stage_updating);
- if (table->triggers &&
- table->triggers->has_triggers(TRG_EVENT_DELETE,
- TRG_ACTION_AFTER))
+ if (table->prepare_triggers_for_delete_stmt_or_event())
{
- /*
- The table has AFTER DELETE triggers that might access to subject table
- and therefore might need delete to be done immediately. So we turn-off
- the batching.
- */
- (void) table->file->extra(HA_EXTRA_DELETE_CANNOT_BATCH);
will_batch= FALSE;
}
else
@@ -938,17 +930,7 @@ multi_delete::initialize_tables(JOIN *join)
transactional_tables= 1;
else
normal_tables= 1;
- if (tbl->triggers &&
- tbl->triggers->has_triggers(TRG_EVENT_DELETE,
- TRG_ACTION_AFTER))
- {
- /*
- The table has AFTER DELETE triggers that might access to subject
- table and therefore might need delete to be done immediately.
- So we turn-off the batching.
- */
- (void) tbl->file->extra(HA_EXTRA_DELETE_CANNOT_BATCH);
- }
+ tbl->prepare_triggers_for_delete_stmt_or_event();
tbl->prepare_for_position();
tbl->mark_columns_needed_for_delete();
}