2 #pragma ident "%Z%%M% %I% %E% SMI"
6 # The author disclaims copyright to this source code. In place of
7 # a legal notice, here is a blessing:
9 # May you do good and not evil.
10 # May you find forgiveness for yourself and forgive others.
11 # May you share freely, never taking more than you give.
13 #***********************************************************************
14 # This file implements regression tests for SQLite library.
16 # This file implements tests for joins, including outer joins.
18 # $Id: join2.test,v 1.1 2004/01/24 20:18:13 drh Exp $
20 set testdir [file dirname $argv0]
21 source $testdir/tester.tcl
26 INSERT INTO t1 VALUES(1,11);
27 INSERT INTO t1 VALUES(2,22);
28 INSERT INTO t1 VALUES(3,33);
35 INSERT INTO t2 VALUES(11,111);
36 INSERT INTO t2 VALUES(33,333);
37 INSERT INTO t2 VALUES(44,444);
40 } {11 111 33 333 44 444};
44 INSERT INTO t3 VALUES(111,1111);
45 INSERT INTO t3 VALUES(444,4444);
46 INSERT INTO t3 VALUES(555,5555);
49 } {111 1111 444 4444 555 5555}
54 t1 NATURAL JOIN t2 NATURAL JOIN t3
60 t1 NATURAL JOIN t2 NATURAL LEFT OUTER JOIN t3
62 } {1 11 111 1111 3 33 333 {}}
66 t1 NATURAL LEFT OUTER JOIN t2 NATURAL JOIN t3
72 t1 NATURAL LEFT OUTER JOIN (t2 NATURAL JOIN t3)
74 } {1 11 111 1111 2 22 {} {} 3 33 {} {}}