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 #***********************************************************************
14 set testdir [file dirname $argv0]
15 source $testdir/tester.tcl
16 source $testdir/malloc_common.tcl
17 set testprefix countofview
23 INSERT INTO t2 VALUES(1), (2);
24 INSERT INTO t3 VALUES(3);
28 select c from t2 union all select f from t3 limit 1 offset 1
32 select count(*) from (
33 select c from t2 union all select f from t3 limit 1 offset 1
38 select count(*) from (
39 select c from t2 union all select f from t3
46 INSERT INTO t1 VALUES(1),(99),('abc');
47 CREATE VIEW v1(x,y) AS SELECT x,1 FROM t1 UNION ALL SELECT x,2 FROM t1;
48 SELECT count(*) FROM v1 WHERE x<>1;
51 SELECT count(*) FROM v1 GROUP BY y;