← Back to team overview

maria-developers team mailing list archive

Re: b1b38b64598: MDEV-29181 Potential corruption on FK update on a table with vcol index


Hi, Nikita,

On Sep 01, Sergei Golubchik wrote:
> > This new solution simply does the following:
> > * Sets up a referenced table list in TABLE instance (sql_base.cc)
> > * Iterates through it along with dict_table_t::referenced_set
> >   (row_upd_check_references_constraints)
> > * Passes corresponding prebuilt through a call chain to
> >   row_ins_foreign_check_on_constraint
> > * Sets up newly created upd_node_t::prebuilt field and uses it
> > accordingly is cascade update.
> Is this upd_node_t::prebuilt used anywhere? As a prebuilt, I mean.
> I couldn't find it (it's a complex patch, so I couldn've missed it).
> As far as I can see, it's only used to store a pointer to TABLE.
> So it seems to me than a simpler fix for this bug could be:
> * remove vc_templ caching (mysql_table and mysql_table_query_id)
> * store TABLE* in upd_node_t.

I've spent more time on this issue, and it looks like there is no
structure in InnoDB with the life time till the end of the statement
(or, at least, nothing easily usable). So I suggest to keep the
mysql_table_query_id/mysql_table caching, but move it from dict_table_t
to upd_node_t. The life time will be till the end of the connection,
over many statements, that's why mysql_table_query_id will be still

Even better solution would be to put mysql_table_query_id/mysql_table
pair into ib_vcol_row and store ib_vcol_row in upd_node_t, instead of
creating it again for every row, saving on thousands of mallocs.
But I'm not sure it'll work for online alter in 10.11.

VP of MariaDB Server Engineering
and security@xxxxxxxxxxx

Follow ups