summaryrefslogtreecommitdiff
path: root/sql/sql_update.cc
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2017-09-21 08:12:19 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2017-09-21 08:12:19 +0300
commite3d44f5d62672478c40294d6e46d9f066e418cac (patch)
tree44b4d1b9d94ced780d4f369f84eddc36791470be /sql/sql_update.cc
parentd176be8aeaecdb20a963fbd126929ddcd5bd98f3 (diff)
parentf70865bc9e540767d8afc3cc2cbe0e1c92a8c0be (diff)
downloadmariadb-git-e3d44f5d62672478c40294d6e46d9f066e418cac.tar.gz
Merge bb-10.2-ext into 10.3
Diffstat (limited to 'sql/sql_update.cc')
-rw-r--r--sql/sql_update.cc20
1 files changed, 20 insertions, 0 deletions
diff --git a/sql/sql_update.cc b/sql/sql_update.cc
index 02a5a4a15e6..3f39765b531 100644
--- a/sql/sql_update.cc
+++ b/sql/sql_update.cc
@@ -2311,6 +2311,26 @@ int multi_update::do_updates()
do_update= 0; // Don't retry this function
if (!found)
DBUG_RETURN(0);
+
+ /*
+ Update read_set to include all fields that virtual columns may depend on.
+ Usually they're already in the read_set, but if the previous access
+ method was keyread, only the virtual column itself will be in read_set,
+ not its dependencies
+ */
+ while(TABLE *tbl= check_opt_it++)
+ {
+ if (tbl->vcol_set)
+ {
+ bitmap_clear_all(tbl->vcol_set);
+ for (Field **vf= tbl->vfield; *vf; vf++)
+ {
+ if (bitmap_is_set(tbl->read_set, (*vf)->field_index))
+ tbl->mark_virtual_col(*vf);
+ }
+ }
+ }
+
for (cur_table= update_tables; cur_table; cur_table= cur_table->next_local)
{
bool can_compare_record;