Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/sqlite/blob/master/test/view3.test # sqlite [Ported from github.com/sqlite/sqlite] Fix bugs in and improve the interface to the ".check" command of the CLI. Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `master` Branches Tags History `sqlite / test / view3.test` 60 lines ยท 2162 bytes Raw Blame History 1 # 2022 July 19 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 # This file implements regression tests for SQLite library. The 12 # focus of this file is testing VIEW statements. 13 # 14 set testdir [file dirname $argv0] 15 source $testdir/tester.tcl 16 17 # Omit this entire file if the library is not configured with views enabled. 18 ifcapable !view { 19 finish_test 20 return 21 } 22 set testprefix view3 23 24 # Ticket [`d58ccbb3f1b`]: Prevent Table.nRef overflow. 25 db close 26 sqlite3 db :memory: 27 do_test 1.1 { 28 catchsql { 29 CREATE TABLE t1(x); 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; 48 } 49 } {1 {too many references to "v1": max 65535}} 50 ifcapable progress { 51 do_test 1.2 { 52 db progress 1000 {expr 1} 53 catchsql { 54 SELECT * FROM v32768; 55 } 56 } {1 interrupted} 57 } 58 59 60 finish_test