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 #*************************************************************************
12 # Test cases for SQL functions with names that are the same as join
13 # keywords: CROSS FULL INNER LEFT NATURAL OUTER RIGHT
15 set testdir [file dirname $argv0]
16 source $testdir/tester.tcl
18 proc joinx {args} {return [join $args -]}
19 db func cross {joinx cross}
20 db func full {joinx full}
21 db func inner {joinx inner}
22 db func left {joinx left}
23 db func natural {joinx natural}
24 db func outer {joinx outer}
25 db func right {joinx right}
26 do_execsql_test func8-100 {
27 CREATE TABLE cross(cross,full,inner,left,natural,outer,right);
28 CREATE TABLE full(cross,full,inner,left,natural,outer,right);
29 CREATE TABLE inner(cross,full,inner,left,natural,outer,right);
30 CREATE TABLE left(cross,full,inner,left,natural,outer,right);
31 CREATE TABLE natural(cross,full,inner,left,natural,outer,right);
32 CREATE TABLE outer(cross,full,inner,left,natural,outer,right);
33 CREATE TABLE right(cross,full,inner,left,natural,outer,right);
34 INSERT INTO cross VALUES(1,2,3,4,5,6,7);
35 INSERT INTO full VALUES(1,2,3,4,5,6,7);
36 INSERT INTO inner VALUES(1,2,3,4,5,6,7);
37 INSERT INTO left VALUES(1,2,3,4,5,6,7);
38 INSERT INTO natural VALUES(1,2,3,4,5,6,7);
39 INSERT INTO outer VALUES(1,2,3,4,5,6,7);
40 INSERT INTO right VALUES(1,2,3,4,5,6,7);
42 do_execsql_test func8-110 {
43 SELECT cross(cross,full,inner,left,natural,outer,right) FROM cross;
45 do_execsql_test func8-120 {
46 SELECT full(cross,full,inner,left,natural,outer,right) FROM full;
48 do_execsql_test func8-130 {
49 SELECT inner(cross,full,inner,left,natural,outer,right) FROM inner;
51 do_execsql_test func8-140 {
52 SELECT left(cross,full,inner,left,natural,outer,right) FROM left;
54 do_execsql_test func8-150 {
55 SELECT natural(cross,full,inner,left,natural,outer,right) FROM natural;
56 } natural-1-2-3-4-5-6-7
57 do_execsql_test func8-160 {
58 SELECT outer(cross,full,inner,left,natural,outer,right) FROM outer;
60 do_execsql_test func8-170 {
61 SELECT right(cross,full,inner,left,natural,outer,right) FROM right;