summaryrefslogtreecommitdiff
path: root/sql/sql_update.cc
diff options
context:
space:
mode:
authorunknown <mskold/marty@linux.site>2007-04-04 17:03:31 +0200
committerunknown <mskold/marty@linux.site>2007-04-04 17:03:31 +0200
commit7279edc72dd951e356db1cf9842115452a5773a1 (patch)
treedd37944358fa408c8d0b0528e0d416320718c1e4 /sql/sql_update.cc
parent2770bf0bfcc73c78b37320c4662c27c72b9d9e12 (diff)
parent59a64c2b1604649be464d38141e2345c79d27bd3 (diff)
downloadmariadb-git-7279edc72dd951e356db1cf9842115452a5773a1.tar.gz
Merge mysql.com:/windows/Linux_space/MySQL/mysql-5.1
into mysql.com:/windows/Linux_space/MySQL/mysql-5.1-new-ndb include/my_base.h: Auto merged sql/ha_ndbcluster.h: Auto merged sql/mysql_priv.h: Auto merged sql/sql_delete.cc: Auto merged sql/sql_insert.cc: Auto merged sql/sql_load.cc: Auto merged sql/sql_trigger.h: Auto merged sql/sql_update.cc: Auto merged sql/ha_ndbcluster.cc: Merge
Diffstat (limited to 'sql/sql_update.cc')
-rw-r--r--sql/sql_update.cc26
1 files changed, 25 insertions, 1 deletions
diff --git a/sql/sql_update.cc b/sql/sql_update.cc
index 0b4632edfbe..19c171b1be0 100644
--- a/sql/sql_update.cc
+++ b/sql/sql_update.cc
@@ -452,7 +452,20 @@ int mysql_update(THD *thd,
(thd->variables.sql_mode &
(MODE_STRICT_TRANS_TABLES |
MODE_STRICT_ALL_TABLES)));
- will_batch= !table->file->start_bulk_update();
+ if (table->triggers &&
+ table->triggers->has_triggers(TRG_EVENT_UPDATE,
+ TRG_ACTION_AFTER))
+ {
+ /*
+ The table has AFTER UPDATE triggers that might access to subject
+ table and therefore might need update to be done immediately.
+ So we turn-off the batching.
+ */
+ (void) table->file->extra(HA_EXTRA_UPDATE_CANNOT_BATCH);
+ will_batch= FALSE;
+ }
+ else
+ will_batch= !table->file->start_bulk_update();
/*
We can use compare_record() to optimize away updates if
@@ -1121,6 +1134,17 @@ int multi_update::prepare(List<Item> &not_used_values,
table->no_keyread=1;
table->covering_keys.clear_all();
table->pos_in_table_list= tl;
+ if (table->triggers &&
+ table->triggers->has_triggers(TRG_EVENT_UPDATE,
+ TRG_ACTION_AFTER))
+ {
+ /*
+ The table has AFTER UPDATE triggers that might access to subject
+ table and therefore might need update to be done immediately.
+ So we turn-off the batching.
+ */
+ (void) table->file->extra(HA_EXTRA_UPDATE_CANNOT_BATCH);
+ }
}
}