1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-12-15 12:06:13 +03:00

Add the sqlite_version() SQL function as a built-in. (CVS 777)

FossilOrigin-Name: 7c8c0e7633dca00bde7bc7c22075f688c034c200
This commit is contained in:
drh
2002-11-04 19:32:25 +00:00
parent 7bc09d3111
commit 647cb0e159
5 changed files with 37 additions and 12 deletions

View File

@@ -16,7 +16,7 @@
** sqliteRegisterBuildinFunctions() found at the bottom of the file.
** All other code has file scope.
**
** $Id: func.c,v 1.22 2002/07/07 16:52:47 drh Exp $
** $Id: func.c,v 1.23 2002/11/04 19:32:25 drh Exp $
*/
#include <ctype.h>
#include <math.h>
@@ -247,6 +247,14 @@ static void nullifFunc(sqlite_func *context, int argc, const char **argv){
}
}
/*
** Implementation of the VERSION(*) function. The result is the version
** of the SQLite library that is running.
*/
static void versionFunc(sqlite_func *context, int argc, const char **argv){
sqlite_set_result_string(context, sqlite_version, -1);
}
#ifdef SQLITE_TEST
/*
** This function generates a string of random characters. Used for
@@ -481,6 +489,7 @@ void sqliteRegisterBuiltinFunctions(sqlite *db){
{ "like", 2, SQLITE_NUMERIC, likeFunc },
{ "glob", 2, SQLITE_NUMERIC, globFunc },
{ "nullif", 2, SQLITE_ARGS, nullifFunc },
{ "sqlite_version",0,SQLITE_TEXT, versionFunc},
#ifdef SQLITE_TEST
{ "randstr", 2, SQLITE_TEXT, randStr },
#endif