diff options
author | Sergey Poznyakoff <gray@gnu.org> | 2018-12-08 12:03:40 +0200 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org> | 2018-12-08 12:03:40 +0200 |
commit | 602f4d93070ac0e762e0cbe3ef72ba792f9c4811 (patch) | |
tree | 8047168c6b23de38973b494b6ec794a81faf3576 /NEWS | |
parent | 2a684f1cdd7723c2ded277ea2c7e66227b6f3ae1 (diff) | |
download | vmod-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-- | NEWS | 31 |
1 files changed, 29 insertions, 2 deletions
@@ -1,9 +1,9 @@ | |||
1 | vmod-dbrw -- history of user-visible changes. 2018-01-30 | 1 | vmod-dbrw -- history of user-visible changes. 2018-12-08 |
2 | See the end of file for copying conditions. | 2 | See the end of file for copying conditions. |
3 | 3 | ||
4 | Please send vmod-dbrw bug reports to <gray@gnu.org> | 4 | Please send vmod-dbrw bug reports to <gray@gnu.org> |
5 | 5 | ||
6 | Version 2.2.90 (Git) | 6 | Version 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 | |||
23 | The SQL templates support the use of $() constructs for invoking | ||
24 | built-in functions. So far one function is implemented: | ||
25 | |||
26 | $(urlprefixes PATH) | ||
27 | |||
28 | It expands to comma-separated list of properly quoted pathname | ||
29 | prefixes, constructed from its argument. Optional query part is | ||
30 | stripped off the argument prior to expansion. For example | ||
31 | |||
32 | $(urlprefixes "/local/user/local?a=1") | ||
33 | |||
34 | expands to: | ||
35 | |||
36 | '/local/user/local','/local/user','/local' | ||
37 | |||
38 | This construct is intended for use in SQL IN conditionals, for | ||
39 | example: | ||
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 | ||
22 | Version 2.2, 2017-08-10 | 49 | Version 2.2, 2017-08-10 |
23 | 50 | ||