aboutsummaryrefslogtreecommitdiff
path: root/NEWS
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org>2018-12-08 12:03:40 +0200
committerSergey Poznyakoff <gray@gnu.org>2018-12-08 12:03:40 +0200
commit602f4d93070ac0e762e0cbe3ef72ba792f9c4811 (patch)
tree8047168c6b23de38973b494b6ec794a81faf3576 /NEWS
parent2a684f1cdd7723c2ded277ea2c7e66227b6f3ae1 (diff)
downloadvmod-dbrw-602f4d93070ac0e762e0cbe3ef72ba792f9c4811.tar.gz
vmod-dbrw-602f4d93070ac0e762e0cbe3ef72ba792f9c4811.tar.bz2
Implement the $(urlprefixes) built-in function.
* NEWS: Update. * README: Update. * configure.ac: Version 2.2.91 * doc/vmod-dbrw.3: Document the use of $(urlprefixes) built-in * doc/vmod-dbrw.texi: Likewise. * src/vmod_dbrw.c (parse_flags): Make sure status string is null-terminated. (do_rewrite): Expand built-in functions in $(). Support urlprefixes. On debug_level=100, produce detailed trace of expansions. * src/wordsplit.c: Pull from grecs commit 9097d529. * src/wordsplit.h: Likewise. * tests/initdb.at (rewrite): Change the url column. * tests/rewrite01.at: Use $(urlprefixes) in the SQL templates. * tests/rewrite02.at: Likewise. * tests/rewrite03.at: Likewise. * tests/rewrite04.at: Likewise. * tests/rewrite05.at: Likewise. * tests/rewrite06.at: Likewise.
Diffstat (limited to 'NEWS')
-rw-r--r--NEWS31
1 files changed, 29 insertions, 2 deletions
diff --git a/NEWS b/NEWS
index 913b0f9..c700564 100644
--- a/NEWS
+++ b/NEWS
@@ -1,9 +1,9 @@
1vmod-dbrw -- history of user-visible changes. 2018-01-30 1vmod-dbrw -- history of user-visible changes. 2018-12-08
2See the end of file for copying conditions. 2See the end of file for copying conditions.
3 3
4Please send vmod-dbrw bug reports to <gray@gnu.org> 4Please send vmod-dbrw bug reports to <gray@gnu.org>
5 5
6Version 2.2.90 (Git) 6Version 2.2.91 (Git)
7 7
8* SQL idle timeout 8* SQL idle timeout
9 9
@@ -18,6 +18,33 @@ e.g.:
18 {"select dest,pattern,value,flags from rewrite where 18 {"select dest,pattern,value,flags from rewrite where
19 locate(url,'$url') = 1 order by weight asc;"}); 19 locate(url,'$url') = 1 order by weight asc;"});
20 20
21* The $() functions in SQL templates
22
23The SQL templates support the use of $() constructs for invoking
24built-in functions. So far one function is implemented:
25
26 $(urlprefixes PATH)
27
28It expands to comma-separated list of properly quoted pathname
29prefixes, constructed from its argument. Optional query part is
30stripped off the argument prior to expansion. For example
31
32 $(urlprefixes "/local/user/local?a=1")
33
34expands to:
35
36 '/local/user/local','/local/user','/local'
37
38This construct is intended for use in SQL IN conditionals, for
39example:
40
41 SELECT dest,pattern,value,flags
42 FROM rewrite
43 WHERE host='$host'
44 AND url IN ($(urlprefixes $url))
45 ORDER BY length(dest),value,weight DESC
46
47
21 48
22Version 2.2, 2017-08-10 49Version 2.2, 2017-08-10
23 50

Return to:

Send suggestions and report system problems to the System administrator.