Re: Vtab scalar function overloading in aggregate queries
On 27/2/62 05:47, Jake Thaw wrote:
> This may not strictly be a bug, but currently (3.27.2) a vtab cannot
> overload scalar functions in aggregate queries.
> Adding a check for TK_AGG_COLUMN in sqlite3VtabOverloadFunction makes
> my use case function as expected.
I think it has always been this way.
The tricky case is when there is a GROUP BY with an expression list that
the virtual table cannot optimize as an ORDER BY. In that case the
virtual table cursor will be closed before the overloaded function is
invoked, which breaks the implementation of most overloaded functions
(including the built-in ones).