summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorunknown <ibabaev@bk-internal.mysql.com>2007-03-20 03:59:32 +0100
committerunknown <ibabaev@bk-internal.mysql.com>2007-03-20 03:59:32 +0100
commitc242662096e1ce16b249c478702be54c190d3f5e (patch)
treeae26e8d36846418db751ae2a3b17df8b8f8ee404 /sql
parent6bb4208084654c0e7c1218ff1d70cb6298514ab8 (diff)
parentc71bff6d1c009cb28b007b67e92d62591615921e (diff)
downloadmariadb-git-c242662096e1ce16b249c478702be54c190d3f5e.tar.gz
Merge bk-internal.mysql.com:/data0/bk/mysql-5.1
into bk-internal.mysql.com:/data0/bk/mysql-5.1-opt sql/sql_insert.cc: Auto merged
Diffstat (limited to 'sql')
-rw-r--r--sql/sql_insert.cc29
1 files changed, 15 insertions, 14 deletions
diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc
index 3ba8963a700..d24230eb379 100644
--- a/sql/sql_insert.cc
+++ b/sql/sql_insert.cc
@@ -1260,22 +1260,23 @@ int write_record(THD *thd, TABLE *table,COPY_INFO *info)
compare_record(table))
{
info->updated++;
+ /*
+ If ON DUP KEY UPDATE updates a row instead of inserting one, it's
+ like a regular UPDATE statement: it should not affect the value of a
+ next SELECT LAST_INSERT_ID() or mysql_insert_id().
+ Except if LAST_INSERT_ID(#) was in the INSERT query, which is
+ handled separately by THD::arg_of_last_insert_id_function.
+ */
+ insert_id_for_cur_row= table->file->insert_id_for_cur_row= 0;
+ if (table->next_number_field)
+ table->file->adjust_next_insert_id_after_explicit_value(
+ table->next_number_field->val_int());
+ trg_error= (table->triggers &&
+ table->triggers->process_triggers(thd, TRG_EVENT_UPDATE,
+ TRG_ACTION_AFTER, TRUE));
info->copied++;
}
- /*
- If ON DUP KEY UPDATE updates a row instead of inserting one, it's
- like a regular UPDATE statement: it should not affect the value of a
- next SELECT LAST_INSERT_ID() or mysql_insert_id().
- Except if LAST_INSERT_ID(#) was in the INSERT query, which is
- handled separately by THD::arg_of_last_insert_id_function.
- */
- insert_id_for_cur_row= table->file->insert_id_for_cur_row= 0;
- if (table->next_number_field)
- table->file->adjust_next_insert_id_after_explicit_value(
- table->next_number_field->val_int());
- trg_error= (table->triggers &&
- table->triggers->process_triggers(thd, TRG_EVENT_UPDATE,
- TRG_ACTION_AFTER, TRUE));
+
goto ok_or_after_trg_err;
}
else /* DUP_REPLACE */