On Mon, Sep 2, 2013 at 11:07 PM, Alexandre Courbot <gnu...@gmail.com> wrote:
> Hi everyone, (not subscribed to the ML, please CC) > > The following happens since 3.8.0 (tested on both 3.8.0 and 3.8.0.1): > > Could this be related to the new query planner? > No. This seems to be due to the new optimization that strives to omit unused tables from the query. The optimizer was under the impression that the second table (the one on the right of the LEFT JOIN) is not being used and so it is omitted. Somehow the optimizaer is missing the fact that the second table is used in the ORDER BY clause. The line of code at http://www.sqlite.org/src/artifact/a37169b46fc?ln=5912 should detect that the second table is used in the ORDER BY clause, but somehow it is not. However this happens, the cursor object for this table is never opened, and so when ORDER BY clause goes to try to extract values from the cursor, it dereferences a NULL pointer and segfaults. You can disable the optimization in the shell using: .testctrl optimizations 0x400 Or from C code: sqlite3_test_control(SQLITE_TESTCTRL_OPTIMIZATIONS, db, 0x400); We should have a proper fix before too long. -- D. Richard Hipp d...@sqlite.org _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users