diff options
author | unknown <mskold/marty@mysql.com/linux.site> | 2007-04-05 08:39:12 +0200 |
---|---|---|
committer | unknown <mskold/marty@mysql.com/linux.site> | 2007-04-05 08:39:12 +0200 |
commit | 499d058c2d4a3a21ece73ccfccebca62672a6517 (patch) | |
tree | 65f485d2be885f33d90600d09460d7d0e3505d99 /sql/sql_update.cc | |
parent | 865cd0108a718d0231daf98367f64fce0c46d3f3 (diff) | |
parent | cfe2d1da886ea48c445076a3509b76ea1242e54d (diff) | |
download | mariadb-git-499d058c2d4a3a21ece73ccfccebca62672a6517.tar.gz |
Merge mysql.com:/windows/Linux_space/MySQL/mysql-5.0
into mysql.com:/windows/Linux_space/MySQL/mysql-5.0-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.cc | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/sql/sql_update.cc b/sql/sql_update.cc index 27d38114885..e7e54d8ca1d 100644 --- a/sql/sql_update.cc +++ b/sql/sql_update.cc @@ -436,7 +436,19 @@ int mysql_update(THD *thd, MODE_STRICT_ALL_TABLES))); if (table->triggers) + { table->triggers->mark_fields_used(thd, TRG_EVENT_UPDATE); + if (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); + } + } /* We can use compare_record() to optimize away updates if @@ -1001,6 +1013,20 @@ int multi_update::prepare(List<Item> ¬_used_values, table->no_keyread=1; table->used_keys.clear_all(); table->pos_in_table_list= tl; + if (table->triggers) + { + table->triggers->mark_fields_used(thd, TRG_EVENT_UPDATE); + if (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); + } + } } } |