2N/A#pragma ident "%Z%%M% %I% %E% SMI"
2N/A# The author disclaims copyright to this source code. In place of
2N/A# a legal notice, here is a blessing:
2N/A# May you do good and not evil.
2N/A# May you find forgiveness for yourself and forgive others.
2N/A# May you share freely, never taking more than you give.
2N/A#***********************************************************************
2N/A# This file implements regression tests for SQLite library.
2N/A# This file implements tests for joins, including outer joins.
2N/Aset testdir [file dirname $argv0]
2N/A CREATE TABLE t1(a,b);
2N/A INSERT INTO t1 VALUES(1,11);
2N/A INSERT INTO t1 VALUES(2,22);
2N/A INSERT INTO t1 VALUES(3,33);
2N/A CREATE TABLE t2(b,c);
2N/A INSERT INTO t2 VALUES(11,111);
2N/A INSERT INTO t2 VALUES(33,333);
2N/A INSERT INTO t2 VALUES(44,444);
2N/A} {11 111 33 333 44 444};
2N/A CREATE TABLE t3(c,d);
2N/A INSERT INTO t3 VALUES(111,1111);
2N/A INSERT INTO t3 VALUES(444,4444);
2N/A INSERT INTO t3 VALUES(555,5555);
2N/A} {111 1111 444 4444 555 5555}
2N/A t1 NATURAL JOIN t2 NATURAL JOIN t3
2N/A t1 NATURAL JOIN t2 NATURAL LEFT OUTER JOIN t3
2N/A} {1 11 111 1111 3 33 333 {}}
2N/A t1 NATURAL LEFT OUTER JOIN t2 NATURAL JOIN t3
2N/A t1 NATURAL LEFT OUTER JOIN (t2 NATURAL JOIN t3)
2N/A} {1 11 111 1111 2 22 {} {} 3 33 {} {}}