maria-developers team mailing list archive
Mailing list archive
Re: [Commits] 62021f3: MDEV-12070 - Introduce thd_query_safe() from MySQL 5.7
On Jun 23, Sergey Vojtovich wrote:
> > Okay. But as neither thd_query_string() nor thd_query() are part of the
> > plugin API, I'd suggest to remove them, they're inherently unsafe and
> > should not be used. Few other engines use thd_query_string() need to be
> > fixed too (but they bypass the plugin API and we don't promise stability
> > for internal functions).
> thd_query() - yes, this looks fairly broken.
> thd_query_string() - I'd say this one should stay, because in most cases
> we need to access query_string from the same thread; in this case we better
> avoid mutex for performance reasons.
Makes sense. May be you can enforce it with an assert?
At least, make sure that a function comment says that thd_query_string
can only be used by the THD owner thread.
Chief Architect MariaDB