/ Check-in [62dfc51a]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Adding test case for ticket [002caede898]
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | tkt-002caede898
Files: files | file ages | folders
SHA1: 62dfc51a495be017605cf315d72e2db91bfa28f7
User & Date: drh 2011-09-15 19:39:42
Context
2011-09-15
23:58
Materialize subqueries using a subroutine and invoke that subroutine prior to each use of the materialization. Fix for ticket [002caede898aee4] check-in: 4b8357ee user: drh tags: tkt-002caede898
19:39
Adding test case for ticket [002caede898] check-in: 62dfc51a user: drh tags: tkt-002caede898
00:40
Cleanup/fix error handling when no arguments are supplied to the SQLite analyzer. check-in: 3fc566ac user: mistachkin tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to test/tkt-31338dca7e.test.

    69     69      CREATE INDEX t4x ON t4(x);
    70     70       SELECT * FROM t3, t4, t5
    71     71        WHERE (v=111 AND x=w AND z!=999) OR (v=333 AND x=444)
    72     72        ORDER BY v, w, x, y, z;
    73     73     }
    74     74   } {111 222 222 333 888 333 444 444 555 888 333 444 444 555 999}
    75     75   
           76  +
           77  +# Ticket [2c2de252666662f5459904fc33a9f2956cbff23c]
           78  +#
           79  +do_test tkt-31338-3.1 {
           80  +  foreach x [db eval {SELECT name FROM sqlite_master WHERE type='table'}] {
           81  +     db eval "DROP TABLE $x"
           82  +  }
           83  +  db eval {
           84  +    CREATE TABLE t1(a,b,c,d);
           85  +    CREATE TABLE t2(e,f);
           86  +    INSERT INTO t1 VALUES(1,2,3,4);
           87  +    INSERT INTO t2 VALUES(10,-8);
           88  +    CREATE INDEX t1a ON t1(a);
           89  +    CREATE INDEX t1b ON t1(b);
           90  +    CREATE TABLE t3(g);
           91  +    INSERT INTO t3 VALUES(4);
           92  +    CREATE TABLE t4(h);
           93  +    INSERT INTO t4 VALUES(5);
           94  +    
           95  +    SELECT * FROM t3 LEFT JOIN t1 ON d=g LEFT JOIN t4 ON c=h
           96  +     WHERE (a=1 AND h=4)
           97  +         OR (b IN (
           98  +               SELECT x FROM (SELECT e+f AS x, e FROM t2 ORDER BY 1 LIMIT 2)
           99  +               GROUP BY e
          100  +            ));
          101  +  }    
          102  +} {4 1 2 3 4 {}}
          103  +do_test tkt-31338-3.2 {
          104  +  db eval {    
          105  +    SELECT * FROM t3 LEFT JOIN t1 ON d=g LEFT JOIN t4 ON c=h
          106  +     WHERE (a=1 AND h=4)
          107  +         OR (b=2 AND b NOT IN (
          108  +               SELECT x+1 FROM (SELECT e+f AS x, e FROM t2 ORDER BY 1 LIMIT 2)
          109  +               GROUP BY e
          110  +            ));
          111  +  }    
          112  +} {4 1 2 3 4 {}}
          113  +
    76    114   
    77    115   finish_test