summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorschwarze <schwarze@openbsd.org>2014-04-16 00:33:24 +0000
committerschwarze <schwarze@openbsd.org>2014-04-16 00:33:24 +0000
commit757013dc9307ff096985d4b99e9527bd8496adf2 (patch)
treecaf17783ec618730b085a4a1aff6657f9ef651c0
parenthave nvme_poll return the status bigs from the completion ring (diff)
downloadwireguard-openbsd-757013dc9307ff096985d4b99e9527bd8496adf2.tar.xz
wireguard-openbsd-757013dc9307ff096985d4b99e9527bd8496adf2.zip
Pass the function flags SQLITE_UTF8 (because SQLITE_ANY is deprecated)
and SQLITE_DETERMINISTIC when creating deterministic functions; best practice measure suggested by espie@ and jeremy@; as expected by jeremy@, no measurable effect on performance.
-rw-r--r--usr.bin/mandoc/mansearch.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/usr.bin/mandoc/mansearch.c b/usr.bin/mandoc/mansearch.c
index a419542524f..5447bf35ef4 100644
--- a/usr.bin/mandoc/mansearch.c
+++ b/usr.bin/mandoc/mansearch.c
@@ -1,4 +1,4 @@
-/* $Id: mansearch.c,v 1.20 2014/04/15 23:47:57 schwarze Exp $ */
+/* $Id: mansearch.c,v 1.21 2014/04/16 00:33:24 schwarze Exp $ */
/*
* Copyright (c) 2012 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2013, 2014 Ingo Schwarze <schwarze@openbsd.org>
@@ -245,10 +245,12 @@ mansearch(const struct mansearch *search,
*/
c = sqlite3_create_function(db, "match", 2,
- SQLITE_ANY, NULL, sql_match, NULL, NULL);
+ SQLITE_UTF8 | SQLITE_DETERMINISTIC,
+ NULL, sql_match, NULL, NULL);
assert(SQLITE_OK == c);
c = sqlite3_create_function(db, "regexp", 2,
- SQLITE_ANY, NULL, sql_regexp, NULL, NULL);
+ SQLITE_UTF8 | SQLITE_DETERMINISTIC,
+ NULL, sql_regexp, NULL, NULL);
assert(SQLITE_OK == c);
j = 1;