From db68d801221ec988797ac03a6ebe0b2f76c1c80d Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Wed, 16 Apr 2014 00:33:47 +0000 Subject: 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. --- mansearch.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'mansearch.c') 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; -- cgit