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 @@
-vmod-dbrw -- history of user-visible changes. 2018-01-30
+vmod-dbrw -- history of user-visible changes. 2018-12-08
See the end of file for copying conditions.
Please send vmod-dbrw bug reports to <gray@gnu.org>
-Version 2.2.90 (Git)
+Version 2.2.91 (Git)
* SQL idle timeout
@@ -18,6 +18,33 @@ e.g.:
{"select dest,pattern,value,flags from rewrite where
locate(url,'$url') = 1 order by weight asc;"});
+* The $() functions in SQL templates
+
+The SQL templates support the use of $() constructs for invoking
+built-in functions. So far one function is implemented:
+
+ $(urlprefixes PATH)
+
+It expands to comma-separated list of properly quoted pathname
+prefixes, constructed from its argument. Optional query part is
+stripped off the argument prior to expansion. For example
+
+ $(urlprefixes "/local/user/local?a=1")
+
+expands to:
+
+ '/local/user/local','/local/user','/local'
+
+This construct is intended for use in SQL IN conditionals, for
+example:
+
+ SELECT dest,pattern,value,flags
+ FROM rewrite
+ WHERE host='$host'
+ AND url IN ($(urlprefixes $url))
+ ORDER BY length(dest),value,weight DESC
+
+
Version 2.2, 2017-08-10

Return to:

Send suggestions and report system problems to the System administrator.