The patch for
MDEV-7824 is going to add a few useful helper methods.
During review, Sergei suggested to use these new methods in the other code parts:
This is ok, but then, please, see what other places in the code you can
change to use your new helpers. In a separate commit, of course. I
suspect there's a lot of code that's doing, like
(this is from create_tmp_table() in sql_select.cc)