From 094f4cf77890c5a747a57cf2bed149b0b6933507 Mon Sep 17 00:00:00 2001 From: Igor Babaev Date: Fri, 9 Nov 2012 23:51:51 -0800 Subject: Fixed bug mdev-3845. If triggers are used for an insert/update/delete statement than the values of all virtual columns must be computed as any of them may be used by the triggers. --- sql/sql_delete.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'sql/sql_delete.cc') diff --git a/sql/sql_delete.cc b/sql/sql_delete.cc index 72a5b9703b3..90ca139d17b 100644 --- a/sql/sql_delete.cc +++ b/sql/sql_delete.cc @@ -313,7 +313,9 @@ bool mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds, while (!(error=info.read_record(&info)) && !thd->killed && ! thd->is_error()) { - update_virtual_fields(thd, table); + update_virtual_fields(thd, table, + triggers_applicable ? VCOL_UPDATE_ALL : + VCOL_UPDATE_FOR_READ); thd->examined_row_count++; // thd->is_error() is tested to disallow delete row on error if (!select || select->skip_record(thd) > 0) -- cgit v1.2.1