1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/persistentdata/persistentstorage/sqlite3api/TEST/TclScript/tkt3201.test Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,74 @@
1.4 +# 2008 July 4
1.5 +#
1.6 +# The author disclaims copyright to this source code. In place of
1.7 +# a legal notice, here is a blessing:
1.8 +#
1.9 +# May you do good and not evil.
1.10 +# May you find forgiveness for yourself and forgive others.
1.11 +# May you share freely, never taking more than you give.
1.12 +#
1.13 +#***********************************************************************
1.14 +# This file implements regression tests for SQLite library.
1.15 +# Specifically, it tests that bug #3201 has been fixed.
1.16 +#
1.17 +# $Id: tkt3201.test,v 1.3 2008/07/12 14:52:21 drh Exp $
1.18 +
1.19 +set testdir [file dirname $argv0]
1.20 +source $testdir/tester.tcl
1.21 +
1.22 +do_test tkt3201-1 {
1.23 + execsql {
1.24 + CREATE TABLE t1(a INTEGER PRIMARY KEY, b TEXT);
1.25 + INSERT INTO t1 VALUES(1, 'one');
1.26 + INSERT INTO t1 VALUES(2, 'two');
1.27 + }
1.28 +} {}
1.29 +
1.30 +do_test tkt3201-2 {
1.31 + execsql {
1.32 + SELECT l.a, r.a FROM t1 AS l, t1 AS r WHERE l.a < r.a;
1.33 + }
1.34 +} {1 2}
1.35 +
1.36 +do_test tkt3201-3 {
1.37 + execsql {
1.38 + CREATE TABLE t2(a INTEGER PRIMARY KEY, b TEXT);
1.39 + INSERT INTO t2 VALUES(2, 'two');
1.40 + }
1.41 + execsql {
1.42 + SELECT l.a, r.a FROM t1 AS l, t2 AS r WHERE l.a < r.a;
1.43 + }
1.44 +} {1 2}
1.45 +
1.46 +do_test tkt3201-4 {
1.47 + execsql {
1.48 + DELETE FROM t1 WHERE a = 2;
1.49 + }
1.50 + execsql {
1.51 + SELECT l.a, r.a FROM t1 AS l, t2 AS r WHERE l.a < r.a;
1.52 + }
1.53 +} {1 2}
1.54 +
1.55 +do_test tkt3201-5 {
1.56 + execsql {
1.57 + DELETE FROM t1 WHERE a = 2;
1.58 + }
1.59 + execsql {
1.60 + SELECT t1.a, t1.b, t2.a, t2.b FROM t1, t2;
1.61 + }
1.62 +} {1 one 2 two}
1.63 +
1.64 +do_test tkt3201-6 {
1.65 + execsql {
1.66 + CREATE TABLE t3(c INTEGER PRIMARY KEY, d TEXT);
1.67 + INSERT INTO t3 VALUES(2, 'two');
1.68 + }
1.69 + execsql { SELECT a, b, c, d FROM t1, t3 }
1.70 +} {1 one 2 two}
1.71 +
1.72 +do_test tkt3201-7 {
1.73 + execsql { SELECT a, b, c, d FROM t1, t3 WHERE a < c }
1.74 +} {1 one 2 two}
1.75 +
1.76 +
1.77 +finish_test