3 # The author disclaims copyright to this source code. In place of
4 # a legal notice, here is a blessing:
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.
10 #***********************************************************************
11 # This file implements regression tests for SQLite library. The
12 # focus of this file is testing that bug [54844eea3f] has been fixed.
15 set testdir [file dirname $argv0]
16 source $testdir/tester.tcl
18 set ::testprefix tkt-54844eea3f
22 CREATE TABLE t1(a INTEGER PRIMARY KEY);
23 INSERT INTO t1 VALUES(1);
24 INSERT INTO t1 VALUES(4);
26 CREATE TABLE t2(b INTEGER PRIMARY KEY);
27 INSERT INTO t2 VALUES(1);
28 INSERT INTO t2 VALUES(2);
29 INSERT INTO t2 SELECT b+2 FROM t2;
30 INSERT INTO t2 SELECT b+4 FROM t2;
31 INSERT INTO t2 SELECT b+8 FROM t2;
32 INSERT INTO t2 SELECT b+16 FROM t2;
34 CREATE TABLE t3(c INTEGER PRIMARY KEY);
35 INSERT INTO t3 VALUES(1);
36 INSERT INTO t3 VALUES(2);
37 INSERT INTO t3 VALUES(3);
43 SELECT 'test-2', t3.c, (
45 FROM t1 JOIN (SELECT DISTINCT t3.c AS p FROM t2) AS x ON t1.a=x.p
49 } {test-2 1 1 test-2 2 0 test-2 3 0}
53 CREATE TABLE t4(a, b, c);
54 INSERT INTO t4 VALUES('a', 1, 'one');
55 INSERT INTO t4 VALUES('a', 2, 'two');
56 INSERT INTO t4 VALUES('b', 1, 'three');
57 INSERT INTO t4 VALUES('b', 2, 'four');
60 SELECT * FROM t4 WHERE a=out.a ORDER BY b LIMIT 10 OFFSET 1