xref: /sqlite-3.40.0/test/join7.test (revision ac8c438a)
1# 2022-04-09
2#
3# The author disclaims copyright to this source code.  In place of
4# a legal notice, here is a blessing:
5#
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.
9#
10#***********************************************************************
11# This file implements regression tests for SQLite library.
12#
13# This file implements tests for RIGHT and FULL OUTER JOINs.
14
15set testdir [file dirname $argv0]
16source $testdir/tester.tcl
17
18do_execsql_test join7-1.1 {
19  CREATE TABLE t1(a int,b int);
20  INSERT INTO t1 VALUES(1,2),(1,3),(1,4);
21  CREATE INDEX t1a ON t1(a);
22  CREATE TABLE t2(c int,d int);
23  INSERT INTO t2 VALUES(3,33),(4,44),(5,55);
24  CREATE INDEX t2c ON t2(c);
25  SELECT quote(b), quote(d), '|' FROM t1 FULL OUTER JOIN t2 ON b=c ORDER BY b;
26} {NULL 55 | 2 NULL | 3 33 | 4 44 |}
27
28finish_test
29