SQLite

Ticket Change Details
Login
Overview

Artifact ID: 8c39a3c9eea9052401592867ebd59dce6f6dbfe8
Ticket: db4d96798da8b9707f76509e57d745d64a92e880
LIMIT does not work with nested views containing UNION ALL
User & Date: drh 2013-01-28 19:34:30
Changes

  1. foundin changed to: "3.7.15.2"
  2. icomment:
    The LIMIT on the final SELECT in the following code does not work:
    
    <verbatim>
    CREATE TABLE t1(x);
    INSERT INTO t1 VALUES(5);
    CREATE VIEW v1 AS SELECT x*2 FROM t1;
    CREATE VIEW v2 AS SELECT * FROM v1 UNION ALL SELECT * FROM v1;
    CREATE VIEW v4 AS SELECT * FROM v2 UNION ALL SELECT * FROM v2;
    SELECT * FROM v4 LIMIT 3;
    </verbatim>
    
    The problem seems to have been introduced by check-ins [3ef468e7046b209]
    or [a79786a961dba8] on 2008-07-01.  The problem first appeared in version
    3.6.1.  The problem was detected during internal testing and has never
    been seen in the wild.
    
  3. login: "drh"
  4. mimetype: "text/x-fossil-wiki"
  5. severity changed to: "Important"
  6. status changed to: "Open"
  7. title changed to:
    LIMIT does not work with nested views containing UNION ALL
    
  8. type changed to: "Code_Defect"