summaryrefslogtreecommitdiff
path: root/storage/innobase/row/row0upd.cc
diff options
context:
space:
mode:
authorAleksey Midenkov <midenok@gmail.com>2020-07-20 18:28:08 +0300
committerAleksey Midenkov <midenok@gmail.com>2020-07-20 18:28:08 +0300
commitaf83ed9f0ed10496c11bea6b054f4d86562e2349 (patch)
treead98c4625ff8a0c79add509acb512914250cf5e3 /storage/innobase/row/row0upd.cc
parentaf57c658090cc52aa20e8cde7d24a563d73ff886 (diff)
downloadmariadb-git-af83ed9f0ed10496c11bea6b054f4d86562e2349.tar.gz
MDEV-20661 Virtual fields are not recalculated on system fields value assignment
Fix stale virtual field value in 4 cases: when virtual field depends on row_start/row_end in timestamp/trx_id versioned table. row_start dep is recalculated in vers_update_fields() (SQL and InnoDB layer). row_end dep is recalculated on history row insert.
Diffstat (limited to 'storage/innobase/row/row0upd.cc')
-rw-r--r--storage/innobase/row/row0upd.cc22
1 files changed, 21 insertions, 1 deletions
diff --git a/storage/innobase/row/row0upd.cc b/storage/innobase/row/row0upd.cc
index 8ce47e74a1c..f2eaef1fd0a 100644
--- a/storage/innobase/row/row0upd.cc
+++ b/storage/innobase/row/row0upd.cc
@@ -3526,5 +3526,25 @@ skip_append:
}
dfield_set_data(&ufield->new_val, update->vers_sys_value, col->len);
-}
+ for (ulint col_no= 0; col_no < dict_table_get_n_v_cols(table); col_no++)
+ {
+
+ const dict_v_col_t *v_col= dict_table_get_nth_v_col(table, col_no);
+ if (!v_col->m_col.ord_part)
+ continue;
+ for (ulint i= 0; i < unsigned(v_col->num_base); i++)
+ {
+ dict_col_t *base_col= v_col->base_col[i];
+ if (base_col->ind == col->ind)
+ {
+ /* Virtual column depends on system field value
+ which we updated above. Remove it from update
+ vector, so it is recalculated in
+ row_upd_store_v_row() (see !update branch). */
+ update->remove(v_col->v_pos);
+ break;
+ }
+ }
+ }
+}