summaryrefslogtreecommitdiffstats
path: root/lib/libsqlite3/src/test_func.c
diff options
context:
space:
mode:
authorjturner <jturner@openbsd.org>2015-04-19 14:21:33 +0000
committerjturner <jturner@openbsd.org>2015-04-19 14:21:33 +0000
commit195e5996de6de62491ca3cfe673e94ad6087aad7 (patch)
tree4ee42085a9591772cf064f0d1a9b78ecd61e7c61 /lib/libsqlite3/src/test_func.c
parentDecouple the token code for "no request or macro" from the individual (diff)
downloadwireguard-openbsd-195e5996de6de62491ca3cfe673e94ad6087aad7.tar.xz
wireguard-openbsd-195e5996de6de62491ca3cfe673e94ad6087aad7.zip
Update sqlite3 to 3.8.9. Changes available here:
http://sqlite.org/releaselog/3_8_9.html Tested in bulk and ok landry@
Diffstat (limited to 'lib/libsqlite3/src/test_func.c')
-rw-r--r--lib/libsqlite3/src/test_func.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/lib/libsqlite3/src/test_func.c b/lib/libsqlite3/src/test_func.c
index c7850631d7b..2e34fa074ef 100644
--- a/lib/libsqlite3/src/test_func.c
+++ b/lib/libsqlite3/src/test_func.c
@@ -600,12 +600,26 @@ static void test_decode(
Tcl_DecrRefCount(pRet);
}
+/*
+** The implementation of scalar SQL function "test_zeroblob()". This is
+** similar to the built-in zeroblob() function, except that it does not
+** check that the integer parameter is within range before passing it
+** to sqlite3_result_zeroblob().
+*/
+static void test_zeroblob(
+ sqlite3_context *context,
+ int argc,
+ sqlite3_value **argv
+){
+ int nZero = sqlite3_value_int(argv[0]);
+ sqlite3_result_zeroblob(context, nZero);
+}
static int registerTestFunctions(sqlite3 *db){
static const struct {
char *zName;
signed char nArg;
- unsigned char eTextRep; /* 1: UTF-16. 0: UTF-8 */
+ unsigned int eTextRep; /* 1: UTF-16. 0: UTF-8 */
void (*xFunc)(sqlite3_context*,int,sqlite3_value **);
} aFuncs[] = {
{ "randstr", 2, SQLITE_UTF8, randStr },
@@ -626,6 +640,7 @@ static int registerTestFunctions(sqlite3 *db){
{ "real2hex", 1, SQLITE_UTF8, real2hex},
{ "test_decode", 1, SQLITE_UTF8, test_decode},
{ "test_extract", 2, SQLITE_UTF8, test_extract},
+ { "test_zeroblob", 1, SQLITE_UTF8|SQLITE_DETERMINISTIC, test_zeroblob},
};
int i;