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 #***********************************************************************
11 # This file implements regression tests for SQLite library. The
12 # focus of this file is testing VIEW statements.
14 set testdir [file dirname $argv0]
15 source $testdir/tester.tcl
17 # Omit this entire file if the library is not configured with views enabled.
24 # Ticket [d58ccbb3f1b]: Prevent Table.nRef overflow.
30 INSERT INTO t1 VALUES(5);
31 CREATE VIEW v1 AS SELECT x*2 FROM t1;
32 CREATE VIEW v2 AS SELECT * FROM v1 UNION SELECT * FROM v1;
33 CREATE VIEW v4 AS SELECT * FROM v2 UNION SELECT * FROM v2;
34 CREATE VIEW v8 AS SELECT * FROM v4 UNION SELECT * FROM v4;
35 CREATE VIEW v16 AS SELECT * FROM v8 UNION SELECT * FROM v8;
36 CREATE VIEW v32 AS SELECT * FROM v16 UNION SELECT * FROM v16;
37 CREATE VIEW v64 AS SELECT * FROM v32 UNION SELECT * FROM v32;
38 CREATE VIEW v128 AS SELECT * FROM v64 UNION SELECT * FROM v64;
39 CREATE VIEW v256 AS SELECT * FROM v128 UNION SELECT * FROM v128;
40 CREATE VIEW v512 AS SELECT * FROM v256 UNION SELECT * FROM v256;
41 CREATE VIEW v1024 AS SELECT * FROM v512 UNION SELECT * FROM v512;
42 CREATE VIEW v2048 AS SELECT * FROM v1024 UNION SELECT * FROM v1024;
43 CREATE VIEW v4096 AS SELECT * FROM v2048 UNION SELECT * FROM v2048;
44 CREATE VIEW v8192 AS SELECT * FROM v4096 UNION SELECT * FROM v4096;
45 CREATE VIEW v16384 AS SELECT * FROM v8192 UNION SELECT * FROM v8192;
46 CREATE VIEW v32768 AS SELECT * FROM v16384 UNION SELECT * FROM v16384;
47 SELECT * FROM v32768 UNION SELECT * FROM v32768;
49 } {1 {too many references to "v1": max 65535}}
52 db progress 1000 {expr 1}