Artifact d837c42249c0d8ad1a2912270e22cf2f303790a611f85c0be3a58e42a3696e3d:
- File
ext/fts5/test/fts5ai.test
— part of check-in
[732f90d6]
at
2017-07-07 19:43:23
on branch trunk
— Change the error message text for SQLITE_ERROR to omit the part about
"missing database" as that meaning is now obsolete (since approx SQLite 2.0).
(user:
drh
size: 1376)
[more...]
0000: 23 20 32 30 31 34 20 4a 75 6e 65 20 31 37 0a 23 # 2014 June 17.#
0010: 0a 23 20 54 68 65 20 61 75 74 68 6f 72 20 64 69 .# The author di
0020: 73 63 6c 61 69 6d 73 20 63 6f 70 79 72 69 67 68 sclaims copyrigh
0030: 74 20 74 6f 20 74 68 69 73 20 73 6f 75 72 63 65 t to this source
0040: 20 63 6f 64 65 2e 20 20 49 6e 20 70 6c 61 63 65 code. In place
0050: 20 6f 66 0a 23 20 61 20 6c 65 67 61 6c 20 6e 6f of.# a legal no
0060: 74 69 63 65 2c 20 68 65 72 65 20 69 73 20 61 20 tice, here is a
0070: 62 6c 65 73 73 69 6e 67 3a 0a 23 0a 23 20 20 20 blessing:.#.#
0080: 20 4d 61 79 20 79 6f 75 20 64 6f 20 67 6f 6f 64 May you do good
0090: 20 61 6e 64 20 6e 6f 74 20 65 76 69 6c 2e 0a 23 and not evil..#
00a0: 20 20 20 20 4d 61 79 20 79 6f 75 20 66 69 6e 64 May you find
00b0: 20 66 6f 72 67 69 76 65 6e 65 73 73 20 66 6f 72 forgiveness for
00c0: 20 79 6f 75 72 73 65 6c 66 20 61 6e 64 20 66 6f yourself and fo
00d0: 72 67 69 76 65 20 6f 74 68 65 72 73 2e 0a 23 20 rgive others..#
00e0: 20 20 20 4d 61 79 20 79 6f 75 20 73 68 61 72 65 May you share
00f0: 20 66 72 65 65 6c 79 2c 20 6e 65 76 65 72 20 74 freely, never t
0100: 61 6b 69 6e 67 20 6d 6f 72 65 20 74 68 61 6e 20 aking more than
0110: 79 6f 75 20 67 69 76 65 2e 0a 23 0a 23 2a 2a 2a you give..#.#***
0120: 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a ****************
0130: 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a ****************
0140: 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a ****************
0150: 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a ****************
0160: 2a 2a 2a 2a 2a 2a 0a 23 20 54 68 69 73 20 66 69 ******.# This fi
0170: 6c 65 20 69 6d 70 6c 65 6d 65 6e 74 73 20 72 65 le implements re
0180: 67 72 65 73 73 69 6f 6e 20 74 65 73 74 73 20 66 gression tests f
0190: 6f 72 20 53 51 4c 69 74 65 20 6c 69 62 72 61 72 or SQLite librar
01a0: 79 2e 20 20 54 68 65 0a 23 20 66 6f 63 75 73 20 y. The.# focus
01b0: 6f 66 20 74 68 69 73 20 73 63 72 69 70 74 20 69 of this script i
01c0: 73 20 74 65 73 74 69 6e 67 20 74 68 65 20 46 54 s testing the FT
01d0: 53 35 20 6d 6f 64 75 6c 65 2e 0a 23 0a 23 20 53 S5 module..#.# S
01e0: 70 65 63 69 66 69 63 61 6c 6c 79 2c 20 69 74 20 pecifically, it
01f0: 74 65 73 74 73 20 74 72 61 6e 73 61 63 74 69 6f tests transactio
0200: 6e 73 20 61 6e 64 20 73 61 76 65 70 6f 69 6e 74 ns and savepoint
0210: 73 0a 23 0a 0a 73 6f 75 72 63 65 20 5b 66 69 6c s.#..source [fil
0220: 65 20 6a 6f 69 6e 20 5b 66 69 6c 65 20 64 69 72 e join [file dir
0230: 6e 61 6d 65 20 5b 69 6e 66 6f 20 73 63 72 69 70 name [info scrip
0240: 74 5d 5d 20 66 74 73 35 5f 63 6f 6d 6d 6f 6e 2e t]] fts5_common.
0250: 74 63 6c 5d 0a 73 65 74 20 74 65 73 74 70 72 65 tcl].set testpre
0260: 66 69 78 20 66 74 73 35 61 69 0a 0a 23 20 49 66 fix fts5ai..# If
0270: 20 53 51 4c 49 54 45 5f 45 4e 41 42 4c 45 5f 46 SQLITE_ENABLE_F
0280: 54 53 35 20 69 73 20 64 65 66 69 6e 65 64 2c 20 TS5 is defined,
0290: 6f 6d 69 74 20 74 68 69 73 20 66 69 6c 65 2e 0a omit this file..
02a0: 69 66 63 61 70 61 62 6c 65 20 21 66 74 73 35 20 ifcapable !fts5
02b0: 7b 0a 20 20 66 69 6e 69 73 68 5f 74 65 73 74 0a {. finish_test.
02c0: 20 20 72 65 74 75 72 6e 0a 7d 0a 0a 66 6f 72 65 return.}..fore
02d0: 61 63 68 5f 64 65 74 61 69 6c 5f 6d 6f 64 65 20 ach_detail_mode
02e0: 24 74 65 73 74 70 72 65 66 69 78 20 7b 0a 0a 64 $testprefix {..d
02f0: 6f 5f 65 78 65 63 73 71 6c 5f 74 65 73 74 20 31 o_execsql_test 1
0300: 2e 30 20 7b 0a 20 20 43 52 45 41 54 45 20 56 49 .0 {. CREATE VI
0310: 52 54 55 41 4c 20 54 41 42 4c 45 20 74 31 20 55 RTUAL TABLE t1 U
0320: 53 49 4e 47 20 66 74 73 35 28 61 2c 20 64 65 74 SING fts5(a, det
0330: 61 69 6c 3d 25 44 45 54 41 49 4c 25 29 3b 0a 7d ail=%DETAIL%);.}
0340: 20 7b 7d 0a 0a 64 6f 5f 65 78 65 63 73 71 6c 5f {}..do_execsql_
0350: 74 65 73 74 20 31 2e 31 20 7b 0a 20 20 42 45 47 test 1.1 {. BEG
0360: 49 4e 3b 0a 20 20 20 20 49 4e 53 45 52 54 20 49 IN;. INSERT I
0370: 4e 54 4f 20 74 31 20 56 41 4c 55 45 53 28 27 61 NTO t1 VALUES('a
0380: 20 62 20 63 27 29 3b 0a 20 20 20 20 49 4e 53 45 b c');. INSE
0390: 52 54 20 49 4e 54 4f 20 74 31 20 56 41 4c 55 45 RT INTO t1 VALUE
03a0: 53 28 27 64 20 65 20 66 27 29 3b 0a 20 20 20 20 S('d e f');.
03b0: 53 41 56 45 50 4f 49 4e 54 20 6f 6e 65 3b 0a 20 SAVEPOINT one;.
03c0: 20 20 20 20 20 49 4e 53 45 52 54 20 49 4e 54 4f INSERT INTO
03d0: 20 74 31 20 56 41 4c 55 45 53 28 27 67 20 68 20 t1 VALUES('g h
03e0: 69 27 29 3b 0a 20 20 20 20 20 20 53 41 56 45 50 i');. SAVEP
03f0: 4f 49 4e 54 20 74 77 6f 3b 0a 20 20 20 20 20 20 OINT two;.
0400: 20 20 49 4e 53 45 52 54 20 49 4e 54 4f 20 74 31 INSERT INTO t1
0410: 20 56 41 4c 55 45 53 28 27 6a 20 6b 20 6c 27 29 VALUES('j k l')
0420: 3b 0a 20 20 20 20 52 4f 4c 4c 42 41 43 4b 20 54 ;. ROLLBACK T
0430: 4f 20 6f 6e 65 3b 0a 20 20 20 20 20 20 49 4e 53 O one;. INS
0440: 45 52 54 20 49 4e 54 4f 20 74 31 20 56 41 4c 55 ERT INTO t1 VALU
0450: 45 53 28 27 6d 20 6e 20 6f 27 29 3b 0a 20 20 20 ES('m n o');.
0460: 20 20 20 20 20 53 41 56 45 50 4f 49 4e 54 20 74 SAVEPOINT t
0470: 77 6f 3b 0a 20 20 20 20 20 20 20 20 49 4e 53 45 wo;. INSE
0480: 52 54 20 49 4e 54 4f 20 74 31 20 56 41 4c 55 45 RT INTO t1 VALUE
0490: 53 28 27 70 20 71 20 72 27 29 3b 0a 20 20 20 20 S('p q r');.
04a0: 52 45 4c 45 41 53 45 20 6f 6e 65 3b 0a 20 20 20 RELEASE one;.
04b0: 20 53 41 56 45 50 4f 49 4e 54 20 6f 6e 65 3b 0a SAVEPOINT one;.
04c0: 20 20 20 20 20 20 49 4e 53 45 52 54 20 49 4e 54 INSERT INT
04d0: 4f 20 74 31 20 56 41 4c 55 45 53 28 27 73 20 74 O t1 VALUES('s t
04e0: 20 75 27 29 3b 0a 20 20 20 20 52 4f 4c 4c 42 41 u');. ROLLBA
04f0: 43 4b 20 54 4f 20 6f 6e 65 3b 0a 20 20 43 4f 4d CK TO one;. COM
0500: 4d 49 54 3b 0a 7d 0a 0a 64 6f 5f 65 78 65 63 73 MIT;.}..do_execs
0510: 71 6c 5f 74 65 73 74 20 31 2e 32 20 7b 0a 20 20 ql_test 1.2 {.
0520: 49 4e 53 45 52 54 20 49 4e 54 4f 20 74 31 28 74 INSERT INTO t1(t
0530: 31 29 20 56 41 4c 55 45 53 28 27 69 6e 74 65 67 1) VALUES('integ
0540: 72 69 74 79 2d 63 68 65 63 6b 27 29 3b 0a 7d 0a rity-check');.}.
0550: 7d 0a 0a 0a 66 69 6e 69 73 68 5f 74 65 73 74 0a }...finish_test.