sqlite/test/countofview.test
drh 6ab91a7a7a Add the SQLITE_DEFAULT_DEFENSIVE compile-time option. Fix up test cases
so that they work with DEFENSIVE enabled.

FossilOrigin-Name: 3212733cb6d1a59516d67a86df7c7b1d2456a1b2e5d7080c26b0e87b2609c65d
2018-11-07 02:17:01 +00:00

44 lines
948 B
Plaintext

# 2018-08-04
#
# 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.
#
#***********************************************************************
#
#
set testdir [file dirname $argv0]
source $testdir/tester.tcl
source $testdir/malloc_common.tcl
set testprefix countofview
do_execsql_test 1.0 {
CREATE TABLE t2(c);
CREATE TABLE t3(f);
INSERT INTO t2 VALUES(1), (2);
INSERT INTO t3 VALUES(3);
}
do_execsql_test 1.1 {
select c from t2 union all select f from t3 limit 1 offset 1
} {2}
do_execsql_test 1.2 {
select count(*) from (
select c from t2 union all select f from t3 limit 1 offset 1
)
} {1}
do_execsql_test 1.3 {
select count(*) from (
select c from t2 union all select f from t3
)
} {3}
finish_test