Thank you for the succinct bug report!

A ticket for this problem can be seen here:
https://www.sqlite.org/src/info/1079ad19993d13fa

The problem is in the query flattener optimization
(https://www.sqlite.org/optoverview.html#subquery_flattening) when
applied to queries that use the new FILTER clause on aggregate
functions.  We have a candidate fix now.  We are merely testing and
analyzing the fix to try to ensure that it is complete and accurate.
Expect a patch soon.

On 10/8/19, Simon Charette <charett...@gmail.com> wrote:
> While trying to enable support for FILTER (WHERE) on SQLite 3.30 for
> the Django ORM we discovered a crash that can be reduced to the
> following
>
> sqlite> CREATE TABLE item (id int, price int);
> sqlite> INSERT INTO item (id, price) VALUES (1, 1);
> sqlite> SELECT COUNT(id) FILTER (WHERE double_price > 42) FROM (SELECT
> id, (price * 2) as double_price FROM item);
> Erreur de segmentation (core dumped)
>
> Cheers,
> Simon
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>


-- 
D. Richard Hipp
d...@sqlite.org
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to