SQLite

View Ticket
Login
Ticket Hash: c2ad16f997ee9c8ed9d3cc4bc5a3da5397a074ec
Title: Segfault on query involving deeply nested aggregate views
Status: Fixed Type: Code_Defect
Severity: Critical Priority: Immediate
Subsystem: Unknown Resolution: Fixed
Last Modified: 2012-05-21 21:26:35
Version Found In: 3.7.12
Description:
Running the attached script (which consists of the schema of
[http://www.skrooge.org | Skrooge] following by a single query)
results in a segfault.  The original bug report can be seen
at [https://bugs.kde.org/show_bug.cgi?id=300183] and the report
on the SQLite mailing list is at [http://www.mail-archive.com/sqlite-users%40sqlite.org/msg70289.html]

Bisecting suggests that the problem was inserted by
check-in [430bb59d798286a86c351].

<hr><i>drh added on 2012-05-21 16:54:14:</i><br>
Simpler test case:

<blockquote><pre>
CREATE TABLE t1(x,y);
SELECT max((SELECT a FROM (SELECT count(1) AS a FROM t1))) FROM t1;
</pre></blockquote>

<hr><i>drh added on 2012-05-21 17:14:14:</i><br>
Another simple test case:

<blockquote><pre>
CREATE TABLE t1(x);
CREATE TABLE t2(y);
SELECT max((SELECT avg(x) FROM t2)) FROM t1;
</pre></blockquote>

Attachments: