sqlite
[Ported from github.com/sqlite/sqlite] Fix bugs in and improve the interface to the ".check" command of the CLI.
Brought by drakestapleton
| 1 | # 2023-03-17 |
| 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 | # |
| 12 | # Test cases for SQL functions with names that are the same as join |
| 13 | # keywords: CROSS FULL INNER LEFT NATURAL OUTER RIGHT |
| 14 | # |
| 15 | set testdir [file dirname $argv0] |
| 16 | source $testdir/tester.tcl |
| 17 | |
| 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); |
| 41 | } |
| 42 | do_execsql_test func8-110 { |
| 43 | SELECT cross(cross,full,inner,left,natural,outer,right) FROM cross; |
| 44 | } cross-1-2-3-4-5-6-7 |
| 45 | do_execsql_test func8-120 { |
| 46 | SELECT full(cross,full,inner,left,natural,outer,right) FROM full; |
| 47 | } full-1-2-3-4-5-6-7 |
| 48 | do_execsql_test func8-130 { |
| 49 | SELECT inner(cross,full,inner,left,natural,outer,right) FROM inner; |
| 50 | } inner-1-2-3-4-5-6-7 |
| 51 | do_execsql_test func8-140 { |
| 52 | SELECT left(cross,full,inner,left,natural,outer,right) FROM left; |
| 53 | } left-1-2-3-4-5-6-7 |
| 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; |
| 59 | } outer-1-2-3-4-5-6-7 |
| 60 | do_execsql_test func8-170 { |
| 61 | SELECT right(cross,full,inner,left,natural,outer,right) FROM right; |
| 62 | } right-1-2-3-4-5-6-7 |
| 63 | |
| 64 | finish_test |