File: fts5limits.test

package info (click to toggle)
sqlcipher 4.11.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 120,460 kB
  • sloc: ansic: 310,189; tcl: 24,097; javascript: 13,561; java: 8,138; sh: 7,586; makefile: 2,448; yacc: 1,727; cpp: 312; cs: 307; sql: 59
file content (47 lines) | stat: -rw-r--r-- 974 bytes parent folder | download | duplicates (11)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# 2023 May 16
#
# 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.
#
#*************************************************************************
#

source [file join [file dirname [info script]] fts5_common.tcl]
set testprefix fts5limits
return_if_no_fts5


do_execsql_test 1.0 {
  CREATE VIRTUAL TABLE ft USING fts5(x);
}

# Default limit for expression depth is 256
#
foreach {tn nRepeat op bErr} {
  1  200  AND  0
  2  200  NOT  0
  3  200  OR   0

  4  260  AND  0
  5  260  NOT  1
  6  260  OR   0
} {
  set L [string repeat "abc " $nRepeat]
  set Q [join $L " $op "]

  set res {0 {}}
  if {$bErr} {
    set res "1 {fts5 expression tree is too large (maximum depth 256)}"
  }

  do_catchsql_test 1.$tn {
    SELECT * FROM ft($Q)
  } $res
}

finish_test