1
0
mirror of https://github.com/sqlite/sqlite.git synced 2026-01-06 08:01:16 +03:00

Documentation improvements and additional test cases.

FossilOrigin-Name: fa71896089538589fb7015d6507e22961e72233b
This commit is contained in:
drh
2011-12-02 15:27:41 +00:00
parent 0661ca6ce2
commit eff1433b6b
5 changed files with 107 additions and 17 deletions

View File

@@ -1,5 +1,5 @@
C Run\squota-stdio\stests\sin\sbinary\smode\sso\sthat\sthey\swork\son\swindows.
D 2011-12-01T22:12:58.579
C Documentation\simprovements\sand\sadditional\stest\scases.
D 2011-12-02T15:27:41.260
F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
F Makefile.in 5b4a3e12a850b021547e43daf886b25133b44c07
F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
@@ -221,7 +221,7 @@ F src/test_onefile.c 40cf9e212a377a6511469384a64b01e6e34b2eec
F src/test_osinst.c 62b0b8ef21ce754cc94e17bb42377ed8795dba32
F src/test_pcache.c a5cd24730cb43c5b18629043314548c9169abb00
F src/test_quota.c 38c23c0fcbc92e0f8fe6fc0a76e66680cdb1b5cb
F src/test_quota.h 118dba604ae5b6903acdd40d2b94a1f319047612
F src/test_quota.h 64240c0f7505dc1d920ff908d63d12ff2bf9c7c0
F src/test_rtree.c 6d06306e29946dc36f528a3a2cdc3add794656f1
F src/test_schema.c 8c06ef9ddb240c7a0fcd31bc221a6a2aade58bf0
F src/test_server.c 2f99eb2837dfa06a4aacf24af24c6affdf66a84f
@@ -634,9 +634,9 @@ F test/printf.test ec9870c4dce8686a37818e0bf1aba6e6a1863552
F test/progress.test 5b075c3c790c7b2a61419bc199db87aaf48b8301
F test/ptrchng.test ef1aa72d6cf35a2bbd0869a649b744e9d84977fc
F test/quick.test 1681febc928d686362d50057c642f77a02c62e57
F test/quota-glob.test bb88e8da2f24f7f8413492967beb35d3222f52a4
F test/quota-glob.test 32901e9eed6705d68ca3faee2a06b73b57cb3c26
F test/quota.test 46e6571b45c3c58ac131cc38f7d600aa9f75974d
F test/quota2.test eabde52ca2606f494be10aad87562b4dd2f4558a
F test/quota2.test b7169f613adf64c22a5336ca607d3b54d7b2ed5a
F test/quote.test 215897dbe8de1a6f701265836d6601cc6ed103e6
F test/randexpr1.tcl 40dec52119ed3a2b8b2a773bce24b63a3a746459
F test/randexpr1.test 1084050991e9ba22c1c10edd8d84673b501cc25a
@@ -979,7 +979,7 @@ F tool/tostr.awk e75472c2f98dd76e06b8c9c1367f4ab07e122d06
F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f
F tool/warnings-clang.sh 9f406d66e750e8ac031c63a9ef3248aaa347ef2a
F tool/warnings.sh fbc018d67fd7395f440c28f33ef0f94420226381
P 253dd7072ef7f4e8742e5b6430658f8e5102e0bb
R 81841ea938699b5dac6d44310547d5e9
P 71e4e97d9c883aa9f1d43d61543685924fc9339a
R 54a98987b22e40be43c533aef3d8d654
U drh
Z 485f7e550a4a58d4cb24ca1e40fc9f7f
Z 0fb6e66eea4239badfef5d9b0c5e6533

View File

@@ -1 +1 @@
71e4e97d9c883aa9f1d43d61543685924fc9339a
fa71896089538589fb7015d6507e22961e72233b

View File

@@ -65,21 +65,27 @@ int sqlite3_quota_shutdown(void);
** The zPattern is always compared against the full pathname of the file.
** Even if APIs are called with relative pathnames, SQLite converts the
** name to a full pathname before comparing it against zPattern. zPattern
** is a standard glob pattern with the following matching rules:
** is a glob pattern with the following matching rules:
**
** '*' Matches any sequence of zero or more characters.
**
** '?' Matches exactly one character.
**
** [...] Matches one character from the enclosed list of
** characters.
** characters. "]" can be part of the list if it is
** the first character. Within the list "X-Y" matches
** characters X or Y or any character in between the
** two. Ex: "[0-9]" matches any digit.
**
** [^...] Matches one character not in the enclosed list.
**
** / Matches either / or \. This allows glob patterns
** containing / to work on both unix and windows.
**
** Note that, unlike unix shell globbing, the directory separator "/"
** can match a wildcard. So, for example, the pattern "/abc/xyz/" "*"
** matches any files anywhere in the directory hierarchy beneath
** /abc/xyz
** /abc/xyz.
**
** If the iLimit for a quota group is set to zero, then the quota group
** is disabled and will be deleted when the last database connection using

View File

@@ -32,13 +32,50 @@ foreach {testnum pattern text ans} {
8 abcdefg abcdef? 0
9 abcdef? abcdef? 1
10 abc/def abc/def 1
11 abc/def abc\\def 1
11 abc//def abc/def 0
12 */abc/* x/abc/y 1
13 */abc/* /abc/ 1
16 */abc/* x///a/ab/abc 0
17 */abc/* x//a/ab/abc/ 1
16 */abc/* x///a/ab/abc 0
17 */abc/* x//a/ab/abc/ 1
18 **/abc/** x//a/ab/abc/ 1
19 *?/abc/*? x//a/ab/abc/y 1
20 ?*/abc/?* x//a/ab/abc/y 1
21 {abc[cde]efg} abcbefg 0
22 {abc[cde]efg} abccefg 1
23 {abc[cde]efg} abcdefg 1
24 {abc[cde]efg} abceefg 1
25 {abc[cde]efg} abcfefg 0
26 {abc[^cde]efg} abcbefg 1
27 {abc[^cde]efg} abccefg 0
28 {abc[^cde]efg} abcdefg 0
29 {abc[^cde]efg} abceefg 0
30 {abc[^cde]efg} abcfefg 1
31 {abc[c-e]efg} abcbefg 0
32 {abc[c-e]efg} abccefg 1
33 {abc[c-e]efg} abcdefg 1
34 {abc[c-e]efg} abceefg 1
35 {abc[c-e]efg} abcfefg 0
36 {abc[^c-e]efg} abcbefg 1
37 {abc[^c-e]efg} abccefg 0
38 {abc[^c-e]efg} abcdefg 0
39 {abc[^c-e]efg} abceefg 0
40 {abc[^c-e]efg} abcfefg 1
41 {abc[c-e]efg} abc-efg 0
42 {abc[-ce]efg} abc-efg 1
43 {abc[ce-]efg} abc-efg 1
44 {abc[][*?]efg} {abc]efg} 1
45 {abc[][*?]efg} {abc*efg} 1
46 {abc[][*?]efg} {abc?efg} 1
47 {abc[][*?]efg} {abc[efg} 1
48 {abc[^][*?]efg} {abc]efg} 0
49 {abc[^][*?]efg} {abc*efg} 0
50 {abc[^][*?]efg} {abc?efg} 0
51 {abc[^][*?]efg} {abc[efg} 0
52 {abc[^][*?]efg} {abcdefg} 1
53 {*[xyz]efg} {abcxefg} 1
54 {*[xyz]efg} {abcwefg} 0
} {
do_test quota-glob-$testnum.1 {
sqlite3_quota_glob $::pattern $::text

View File

@@ -17,10 +17,10 @@ source $testdir/malloc_common.tcl
db close
sqlite3_quota_initialize "" 1
file delete -force quota2a
file delete -force quota2b
file mkdir quota2a
file mkdir quota2b
foreach dir {quota2a quota2b quota2c} {
file delete -force $dir
file mkdir $dir
}
# The standard_path procedure converts a pathname into a standard format
# that is the same across platforms.
@@ -119,6 +119,53 @@ do_test quota1-1.13 {
} {{*/quota2b/* 5000 0} {*/quota2a/* 4000 0}}
set quota {}
do_test quota2-2.1 {
set ::h1 [sqlite3_quota_fopen quota2c/xyz.txt w+b]
sqlite3_quota_fwrite $::h1 1 7000 $bigtext
} {7000}
do_test quota2-2.2 {
set ::quota
} {}
do_test quota2-2.3 {
sqlite3_quota_rewind $::h1
set ::x [sqlite3_quota_fread $::h1 1001 7]
string length $::x
} {6006}
do_test quota2-2.4 {
string match $::x [string range $::bigtext 0 6005]
} {1}
do_test quota2-2.5 {
sqlite3_quota_fseek $::h1 0 SEEK_END
sqlite3_quota_ftell $::h1
} {7000}
do_test quota2-2.6 {
sqlite3_quota_fseek $::h1 -100 SEEK_END
sqlite3_quota_ftell $::h1
} {6900}
do_test quota2-2.7 {
sqlite3_quota_fseek $::h1 -100 SEEK_CUR
sqlite3_quota_ftell $::h1
} {6800}
do_test quota2-2.8 {
sqlite3_quota_fseek $::h1 50 SEEK_CUR
sqlite3_quota_ftell $::h1
} {6850}
do_test quota2-2.9 {
sqlite3_quota_fseek $::h1 50 SEEK_SET
sqlite3_quota_ftell $::h1
} {50}
do_test quota2-2.10 {
sqlite3_quota_rewind $::h1
sqlite3_quota_ftell $::h1
} {0}
do_test quota2-2.11 {
standard_path [sqlite3_quota_dump]
} {{*/quota2b/* 5000 0} {*/quota2a/* 4000 0}}
do_test quota1-2.12 {
sqlite3_quota_fclose $::h1
standard_path [sqlite3_quota_dump]
} {{*/quota2b/* 5000 0} {*/quota2a/* 4000 0}}
catch { sqlite3_quota_shutdown }
catch { unset quota_request_ok }