summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2014-04-16 00:33:47 +0000
committerIngo Schwarze <schwarze@openbsd.org>2014-04-16 00:33:47 +0000
commitdb68d801221ec988797ac03a6ebe0b2f76c1c80d (patch)
tree432c6d52c0d89171da32881ec3ee61cebc60f68b
parent2b2eab1f9ec714c29cb6de32730c0434a7c9f273 (diff)
downloadmandoc-db68d801221ec988797ac03a6ebe0b2f76c1c80d.tar.gz
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--mansearch.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/mansearch.c b/mansearch.c
index 8918f1d1..a6b223e7 100644
--- a/mansearch.c
+++ b/mansearch.c
@@ -253,10 +253,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;