On Thu, Apr 12, 2018 at 07:45:37PM +0200, Sergei Golubchik wrote:
Hi, Sergey!
Forgot to mention it in my first reply, sorry
On Apr 12, Sergey Petrunia wrote:
diff --git a/sql/item.h b/sql/item.h index 9574bdc63bf..e391e7810c4 100644 --- a/sql/item.h +++ b/sql/item.h @@ -2023,6 +2023,7 @@ class Item: public Value_source, { marker &= ~EXTRACTION_MASK; } + virtual TABLE *rowid_table() const { return 0; }
I am concerned about this approach bloating class Item's vtable.
There is (and likely will ever be) only one class with a different implementation, the check for this is made only in one place - why not check Item's type() or functype(), etc?
I know, I don't like this either. But the alternative was
if (item->type() == FUNC_ITEM && ((Item_func*)item)->functype() == ROWID_FUNC && ((Item_temptable_rowid*)item)->table == tbl) ...
that is, I need to compare both item->type() and item_func->functype(). So I thought it'd be better to add a method.
I can revert back to type()/functype() comparison, if you prefer that.
I would prefer that, if several checks are needed a short static/inline function will be more readable... BR Sergei -- Sergei Petrunia, Software Developer MariaDB Corporation | Skype: sergefp | Blog: http://s.petrunia.net/blog