SQLite

View Ticket
Login
Ticket Hash: 388d01d4bb8f9a8b1c798d9453819914134ab603
Title: Crash on join with a virtual table, DISTINCT, and ORDER BY.
Status: Fixed Type: Code_Defect
Severity: Severe Priority: Immediate
Subsystem: Unknown Resolution: Fixed
Last Modified: 2014-04-25 17:37:22
Version Found In:
User Comments:
drh added on 2014-04-25 14:04:18:

The query at the end of the following SQL raises an assertion fault:

CREATE VIRTUAL TABLE fts USING fts4(content TEXT);
CREATE TABLE t1(x TEXT PRIMARY KEY, y);
SELECT DISTINCT fts.rowid, t1.x
  FROM fts, t1
 WHERE fts MATCH 'hello world'
   AND content=x
 ORDER BY y;

This problem was introduced with the Next Generation Query Planner by check-in [0fe31f60cadc5fe5] on 2013-06-26 for version 3.8.0. The problem was first detected by RedHat (see https://bugzilla.redhat.com/show_bug.cgi?id=1075889).