Snapshot of upstream SQLite 3.42.0
[sqlcipher.git] / ext / fts5 / test / fts5limits.test
blob90d175aa3108f1892a1eedc33c198c40241ba5c1
1 # 2023 May 16
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 #*************************************************************************
13 source [file join [file dirname [info script]] fts5_common.tcl]
14 set testprefix fts5limits
15 return_if_no_fts5
18 do_execsql_test 1.0 {
19   CREATE VIRTUAL TABLE ft USING fts5(x);
22 # Default limit for expression depth is 256
24 foreach {tn nRepeat op bErr} {
25   1  200  AND  0
26   2  200  NOT  0
27   3  200  OR   0
29   4  260  AND  0
30   5  260  NOT  1
31   6  260  OR   0
32 } {
33   set L [string repeat "abc " $nRepeat]
34   set Q [join $L " $op "]
36   set res {0 {}}
37   if {$bErr} {
38     set res "1 {fts5 expression tree is too large (maximum depth 256)}"
39   }
41   do_catchsql_test 1.$tn {
42     SELECT * FROM ft($Q)
43   } $res
46 finish_test