Vtab scalar function overloading in aggregate queries

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Vtab scalar function overloading in aggregate queries

Jake
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.

-Jake
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Vtab scalar function overloading in aggregate queries

Dan Kennedy-4

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).

Dan.



_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users