SQLite
Ticket Change Details
Not logged in
Overview

Artifact ID: 20f0d40ca31e132ae529d94400eb0eff4f00abb4
Ticket: bfbf38e5e9956ac69f9491e5112636ff2ecef923
Segfault on a nested join
Date: 2012-11-02 12:30:55
User: drh
Changes

  1. Change comment to:

    Reported on the mailing list:

    CREATE TABLE AAA (
      aaa_id       INTEGER PRIMARY KEY AUTOINCREMENT
    );
    CREATE TABLE RRR (
      rrr_id      INTEGER     PRIMARY KEY AUTOINCREMENT,
      rrr_date    INTEGER     NOT NULL,
      rrr_aaa     INTEGER
    );
    CREATE TABLE TTT (
      ttt_id      INTEGER PRIMARY KEY AUTOINCREMENT,
      target_aaa  INTEGER NOT NULL,
      source_aaa  INTEGER NOT NULL
    );
    insert into AAA (aaa_id) values (2);
    insert into TTT (ttt_id, target_aaa, source_aaa)
    values (4469, 2, 2);
    insert into TTT (ttt_id, target_aaa, source_aaa)
    values (4476, 2, 1);
    insert into RRR (rrr_id, rrr_date, rrr_aaa)
    values (0, 0, NULL);
    insert into RRR (rrr_id, rrr_date, rrr_aaa)
    values (2, 4312, 2);
    SELECT i.aaa_id,
      (SELECT sum(CASE WHEN (t.source_aaa == i.aaa_id) THEN 1 ELSE 0 END)
         FROM TTT t
      ) AS segfault
    FROM
     (SELECT curr.rrr_aaa as aaa_id
        FROM RRR curr
          -- you also can comment out the next line
          -- it causes segfault to happen after one row is outputted
          INNER JOIN AAA a ON (curr.rrr_aaa = aaa_id)
          LEFT JOIN RRR r ON (r.rrr_id <> 0 AND r.rrr_date < curr.rrr_date)
       GROUP BY curr.rrr_id
      HAVING r.rrr_date IS NULL
    ) i;
    
  2. Change detected to "Application_Fault"
  3. Change foundin to "trunk:2012-11-02"
  4. Change private_contact to "21acf606a926cf9bbf2ac304bb3928dcd0e489fe"
  5. Change severity to "Critical"
  6. Change status to "Open"
  7. Change subsystem to "Unknown"
  8. Change title to "Segfault on a nested join"
  9. Change type to "Code_Defect"