/ Ticket Change Details
Login
Overview

Artifact ID: b9784104c00b3912ca9d3902b5621b6280cf7782aa871a59a1b0944b25334cc7
Ticket: cb91bf4290c211de24389bcefd8a06d56c099d9f
Assertion fault following PRAGMA reverse_unordered_selects=ON
User & Date: drh 2017-08-01 18:21:15
Changes

  1. foundin changed to: "3.20.0"
  2. icomment:
    When assert()s are enabled (which is to say when SQLite is compiled using
    -DSQLITE_DEBUG) the following SQL causes an assertion fault in the 
    byte-code engine:
    
    <blockquote><verbatim>
    PRAGMA reverse_unordered_selects=on;
    CREATE TABLE t1(a,b);
    INSERT INTO t1 VALUES(1,2);
    CREATE INDEX t1b ON t1(b);
    SELECT a FROM t1 WHERE b=-99 OR b>1;
    </verbatim></blockquote>
    
    Bisecting shows that this bug was introduced with check-in [663473850c] 
    on 2016-11-15 and first appeared in release 3.16.0.  As far as we can
    determine at this time, the bug is harmless in the sense that SQLite
    functions normally and computes the correct answer when assert()s are
    disabled.  However, the assertion fault does indicate that the logic
    is confused and needs to be refactored for long-term maintainability.
    
    This problem was discovered by [https://github.com/google/oss-fuzz|OSSFuzz].
    
  3. login: "drh"
  4. mimetype: "text/x-fossil-wiki"
  5. severity changed to: "Minor"
  6. status changed to: "Open"
  7. title changed to:
    Assertion fault following PRAGMA reverse_unordered_selects=ON
    
  8. type changed to: "Code_Defect"