/ Check-in [c370338c]
Login

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

Overview
Comment:Add tests to tkt-80ba201079.test.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: c370338c772bcd0797a23f83c3f6dc019640c6dd
User & Date: dan 2010-12-07 07:57:50
Context
2010-12-07
14:32
Run some of the existing test scripts with optimizations disabled as part of all.test. check-in: b0634d2f user: dan tags: trunk
07:57
Add tests to tkt-80ba201079.test. check-in: c370338c user: dan tags: trunk
2010-12-06
21:09
Fix the build so that it once again works with SQLITE_OMIT_SHARED_CACHE and SQLITE_OMIT_AUTOVACUUM. check-in: fabcb6b9 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to test/tkt-80ba201079.test.

    13     13   # resolved.  That ticket is about an incorrect result that appears when
    14     14   # an index is added.  The root cause is that a constant is being used
    15     15   # without initialization when the OR optimization applies in the WHERE clause.
    16     16   #
    17     17   
    18     18   set testdir [file dirname $argv0]
    19     19   source $testdir/tester.tcl
           20  +set ::testprefix tkt-80ba2
    20     21   
    21     22   do_test tkt-80ba2-100 {
    22     23     db eval {
    23     24       CREATE TABLE t1(a);
    24     25       INSERT INTO t1 VALUES('A');
    25     26       CREATE TABLE t2(b);
    26     27       INSERT INTO t2 VALUES('B');
................................................................................
   132    133        WHERE (entry_types.name = 'cli_command' AND entry_id=2114)
   133    134           OR (entry_types.name = 'object_change'
   134    135                AND entry_id IN (SELECT change_id
   135    136                                 FROM object_changes
   136    137                                  WHERE obj_context = 'exported_pools'));
   137    138     }
   138    139   } {300 object_change 2048}
          140  +
          141  +#-------------------------------------------------------------------------
          142  +#
          143  +
          144  +drop_all_tables
          145  +do_execsql_test 301 {
          146  +  CREATE TABLE t1(a, b, c);
          147  +  CREATE INDEX i1 ON t1(a);
          148  +  CREATE INDEX i2 ON t1(b);
          149  +  CREATE TABLE t2(d, e);
          150  +
          151  +  INSERT INTO t1 VALUES('A', 'B', 'C');
          152  +  INSERT INTO t2 VALUES('D', 'E');
          153  +}
          154  +
          155  +do_execsql_test 302 {
          156  +  SELECT * FROM t1, t2 WHERE
          157  +    (a='A' AND d='E') OR
          158  +    (b='B' AND c IN ('C', 'D', 'E'))
          159  +} {A B C D E}
          160  +
          161  +do_execsql_test 303 {
          162  +  SELECT * FROM t1, t2 WHERE
          163  +    (a='A' AND d='E') OR
          164  +    (b='B' AND c IN (SELECT c FROM t1))
          165  +} {A B C D E}
          166  +
          167  +do_execsql_test 304 {
          168  +  SELECT * FROM t1, t2 WHERE
          169  +    (a='A' AND d='E') OR
          170  +    (b='B' AND c IN (SELECT 'B' UNION SELECT 'C' UNION SELECT 'D'))
          171  +} {A B C D E}
          172  +
          173  +do_execsql_test 305 {
          174  +  SELECT * FROM t1, t2 WHERE
          175  +    (b='B' AND c IN ('C', 'D', 'E')) OR
          176  +    (a='A' AND d='E')
          177  +} {A B C D E}
          178  +
          179  +do_execsql_test 306 {
          180  +  SELECT * FROM t1, t2 WHERE
          181  +    (b='B' AND c IN (SELECT c FROM t1)) OR
          182  +    (a='A' AND d='E')
          183  +} {A B C D E}
          184  +
          185  +do_execsql_test 307 {
          186  +  SELECT * FROM t1, t2 WHERE
          187  +    (b='B' AND c IN (SELECT 'B' UNION SELECT 'C' UNION SELECT 'D')) OR
          188  +    (a='A' AND d='E')
          189  +} {A B C D E}
   139    190   
   140    191   finish_test