summaryrefslogtreecommitdiff
path: root/test/regexp1.sql
blob: 46f2b4af46cb5c2e53d4d69f1d1dd68a2087cae1 (plain) (blame)
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
#!sqlite3
#
# 2025-12-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.
#
#***********************************************************************
#
# Test cases for the oversized patterns in the REGEXP extension found
# at ext/misc/regexp.c.
#
.open :memory:
.mode list
.testcase 100
--                       0         1         2         3         4
--                        123456789 123456789 123456789 123456789 123
SELECT 'abcdefg' REGEXP '((((((((((((((((((abcdefg))))))))))))))))))';
.check 1

.testcase 110
.limit like_pattern_length 42
SELECT 'abcdefg' REGEXP '((((((((((((((((((abcdefg))))))))))))))))))';
.check -glob "*rror near line *: REGEXP pattern too big*"

.testcase 120
.limit like_pattern_length 43
SELECT 'abcdefg' REGEXP '((((((((((((((((((abcdefg))))))))))))))))))';
.check 1