SQLite
Ticket Change Details
Not logged in
Overview

Artifact ID: 62ed131e6031d3af5e1268334b5c97da52a2ed94
Ticket: bfbf38e5e9956ac69f9491e5112636ff2ecef923
Segfault on a nested join
Date: 2012-11-02 14:43:51
User: drh
Changes

  1. Appended to comment:

    drh added on 2012-11-02 14:43:51:
    Here is another simplification of the script that avoids the use of LEFT JOIN and silly constructs like a GROUP BY on a PRIMARY KEY:

    CREATE TABLE t1 (
      id1 INTEGER,
      value1 INTEGER,
      x1 INTEGER
    );
    INSERT INTO t1 VALUES(4469,2,98),(4469,1,99),(4469,3,97);
    CREATE TABLE t2 (
      value2 INTEGER
    );
    INSERT INTO t2 VALUES(1);
    pragma vdbe_listing=on; pragma vdbe_trace=on;
    SELECT
     (SELECT sum(value2==xyz) FROM t2)
    FROM
     (SELECT value1 as xyz, max(x1) AS pqr
        FROM t1
       GROUP BY id1);