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.
13 # This file implements tests for joins, including outer joins.
15 # $Id: join2.test,v 1.2 2005/01/21 03:12:16 danielk1977 Exp $
17 set testdir [file dirname $argv0]
18 source $testdir/tester.tcl
23 INSERT INTO t1 VALUES(1,11);
24 INSERT INTO t1 VALUES(2,22);
25 INSERT INTO t1 VALUES(3,33);
32 INSERT INTO t2 VALUES(11,111);
33 INSERT INTO t2 VALUES(33,333);
34 INSERT INTO t2 VALUES(44,444);
37 } {11 111 33 333 44 444};
41 INSERT INTO t3 VALUES(111,1111);
42 INSERT INTO t3 VALUES(444,4444);
43 INSERT INTO t3 VALUES(555,5555);
46 } {111 1111 444 4444 555 5555}
51 t1 NATURAL JOIN t2 NATURAL JOIN t3
57 t1 NATURAL JOIN t2 NATURAL LEFT OUTER JOIN t3
59 } {1 11 111 1111 3 33 333 {}}
63 t1 NATURAL LEFT OUTER JOIN t2 NATURAL JOIN t3
70 t1 NATURAL LEFT OUTER JOIN (t2 NATURAL JOIN t3)
72 } {1 11 111 1111 2 22 {} {} 3 33 {} {}}