diff options
author | Aditya A <aditya.a@oracle.com> | 2019-04-27 05:54:37 +0530 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2019-07-25 12:39:39 +0300 |
commit | 60069a9829f3dc3e76af53e07b845d7aa83028d3 (patch) | |
tree | 2836b4146c4d5d486868e99310b897efcb810b21 /storage/innobase/handler | |
parent | b6ac67389dfed3255004b82d29625577c3335a0a (diff) | |
download | mariadb-git-60069a9829f3dc3e76af53e07b845d7aa83028d3.tar.gz |
Bug #29127203 VIRTUAL GENERATED COLUMN INDEX DATA INCONSISTENCY
PROBLEM
-------
Index defined on a virtual column whose base column was in a fk
relation was not getting updated. This is because while getting
the updated field information from the update vector of the parent
table we were comparing the column number of the base column (for
virtual column) in child table with the associated column number
in the parent table. There was a mismatch in this column number
because of which this update field information was skipped and
subsequently index was not getting updated.
FIX
Diffstat (limited to 'storage/innobase/handler')
-rw-r--r-- | storage/innobase/handler/ha_innodb.cc | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index 40c7e3b8ec7..7fab6d04194 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -21654,7 +21654,7 @@ innobase_rename_vc_templ( given col_no. @param[in] foreign foreign key information @param[in] update updated parent vector. -@param[in] col_no column position of the table +@param[in] col_no base column position of the child table to check @return updated field from the parent update vector, else NULL */ static dfield_t* @@ -21670,6 +21670,10 @@ innobase_get_field_from_update_vector( ulint prefix_col_no; for (ulint i = 0; i < foreign->n_fields; i++) { + if (dict_index_get_nth_col_no(foreign->foreign_index, i) + != col_no) { + continue; + } parent_col_no = dict_index_get_nth_col_no(parent_index, i); parent_field_no = dict_table_get_nth_col_pos( @@ -21679,8 +21683,7 @@ innobase_get_field_from_update_vector( upd_field_t* parent_ufield = &update->fields[j]; - if (parent_ufield->field_no == parent_field_no - && parent_col_no == col_no) { + if (parent_ufield->field_no == parent_field_no) { return(&parent_ufield->new_val); } } |