sqlite/test/rowvalueA.test
drh d5e040b6f0 Add string_agg(X,Y) as an alias for group_concat(X,Y), for compatibility
with SQLServer and PG.

FossilOrigin-Name: b91c19bf2680f60d7826ab5d9e7902e2dc2a55d847bbea565a6489d47f2cc8f1
2023-10-20 20:19:30 +00:00

77 lines
1.7 KiB
Plaintext

# 2021 July 6
#
# The author disclaims copyright to this source code. In place of
# a legal notice, here is a blessing:
#
# May you do good and not evil.
# May you find forgiveness for yourself and forgive others.
# May you share freely, never taking more than you give.
#
#***********************************************************************
# This file implements regression tests for SQLite library.
#
set testdir [file dirname $argv0]
source $testdir/tester.tcl
set testprefix rowvalueA
do_execsql_test 1.0 {
SELECT (1, 2) IN ( (3, 4), (5, 6), (1, 3) );
} {0}
do_execsql_test 1.1 {
SELECT (1, 2) IN ( (3, 4), (5, 6), (1, 2) );
} {1}
do_execsql_test 1.2 {
SELECT (1, 2) IN ( (3, 2) );
} {0}
do_execsql_test 1.3 {
SELECT (1, 2) IN ( (1, 2) );
} {1}
do_execsql_test 1.4 {
SELECT (1, 2) IN ( );
} {0}
do_execsql_test 1.5 {
SELECT (1, 2) NOT IN ( );
} {1}
for {set ii 0} {$ii < 2000} {incr ii} {
lappend L "($ii, $ii)"
}
do_execsql_test 1.6.1 "
SELECT (400,400) IN ( [join $L ,] )
" 1
do_execsql_test 1.6.2 "
SELECT (1500,1500) IN ( [join $L ,] )
" 1
do_execsql_test 1.6.2 "
SELECT (1500,1499) IN ( [join $L ,] )
" 0
#-------------------------------------------------------------------------
do_catchsql_test 2.0 {
SELECT (1, 2) IN ( (1, 2), (3, 4, 5), (5, 6) )
} {1 {IN(...) element has 3 terms - expected 2}}
do_catchsql_test 2.1 {
SELECT (1, 2) IN ( (1, 2), 4, (5, 6) )
} {1 {IN(...) element has 1 term - expected 2}}
do_catchsql_test 2.2 {
SELECT (1, 2, 3) IN ( (1, 2), (3, 4), (5, 6) )
} {1 {IN(...) element has 2 terms - expected 3}}
do_catchsql_test 2.3 {
SELECT 2 IN ( (1, 2), (3, 4), (5, 6) )
} {1 {row value misused}}
finish_test