persistentstorage/sqlite3api/TEST/TclScript/tkt3201.test
changeset 0 08ec8eefde2f
equal deleted inserted replaced
-1:000000000000 0:08ec8eefde2f
       
     1 # 2008 July 4
       
     2 #
       
     3 # The author disclaims copyright to this source code.  In place of
       
     4 # a legal notice, here is a blessing:
       
     5 #
       
     6 #    May you do good and not evil.
       
     7 #    May you find forgiveness for yourself and forgive others.
       
     8 #    May you share freely, never taking more than you give.
       
     9 #
       
    10 #***********************************************************************
       
    11 # This file implements regression tests for SQLite library. 
       
    12 # Specifically, it tests that bug #3201 has been fixed.
       
    13 #
       
    14 # $Id: tkt3201.test,v 1.3 2008/07/12 14:52:21 drh Exp $
       
    15 
       
    16 set testdir [file dirname $argv0]
       
    17 source $testdir/tester.tcl
       
    18 
       
    19 do_test tkt3201-1 {
       
    20   execsql {
       
    21     CREATE TABLE t1(a INTEGER PRIMARY KEY, b TEXT);
       
    22     INSERT INTO t1 VALUES(1, 'one');
       
    23     INSERT INTO t1 VALUES(2, 'two');
       
    24   }
       
    25 } {}
       
    26 
       
    27 do_test tkt3201-2 {
       
    28   execsql {
       
    29     SELECT l.a, r.a FROM t1 AS l, t1 AS r WHERE l.a < r.a;
       
    30   }
       
    31 } {1 2}
       
    32 
       
    33 do_test tkt3201-3 {
       
    34   execsql {
       
    35     CREATE TABLE t2(a INTEGER PRIMARY KEY, b TEXT);
       
    36     INSERT INTO t2 VALUES(2, 'two');
       
    37   }
       
    38   execsql {
       
    39     SELECT l.a, r.a FROM t1 AS l, t2 AS r WHERE l.a < r.a;
       
    40   }
       
    41 } {1 2}
       
    42 
       
    43 do_test tkt3201-4 {
       
    44   execsql {
       
    45     DELETE FROM t1 WHERE a = 2;
       
    46   }
       
    47   execsql {
       
    48     SELECT l.a, r.a FROM t1 AS l, t2 AS r WHERE l.a < r.a;
       
    49   }
       
    50 } {1 2}
       
    51 
       
    52 do_test tkt3201-5 {
       
    53   execsql {
       
    54     DELETE FROM t1 WHERE a = 2;
       
    55   }
       
    56   execsql {
       
    57     SELECT t1.a, t1.b, t2.a, t2.b FROM t1, t2;
       
    58   }
       
    59 } {1 one 2 two}
       
    60 
       
    61 do_test tkt3201-6 {
       
    62   execsql {
       
    63     CREATE TABLE t3(c INTEGER PRIMARY KEY, d TEXT);
       
    64     INSERT INTO t3 VALUES(2, 'two');
       
    65   }
       
    66   execsql { SELECT a, b, c, d FROM t1, t3 }
       
    67 } {1 one 2 two}
       
    68 
       
    69 do_test tkt3201-7 {
       
    70   execsql { SELECT a, b, c, d FROM t1, t3 WHERE a < c }
       
    71 } {1 one 2 two}
       
    72 
       
    73 
       
    74 finish_test