diff options
author | danielk1977 <danielk1977@noemail.net> | 2004-05-24 12:39:02 +0000 |
---|---|---|
committer | danielk1977 <danielk1977@noemail.net> | 2004-05-24 12:39:02 +0000 |
commit | 51ad0ecd282d94a8ba1eb19e46de198a7bfe3d1e (patch) | |
tree | 964e04b82d07c0b64938db3fce12fe9a43cb244d /src/tclsqlite.c | |
parent | 7e435458a0b32d07f314be2323905c8b9b45ddac (diff) | |
download | sqlite-51ad0ecd282d94a8ba1eb19e46de198a7bfe3d1e.tar.gz sqlite-51ad0ecd282d94a8ba1eb19e46de198a7bfe3d1e.zip |
Non-aggregate SQL functions use sqlite_value* instead of const char * for
argument values. (CVS 1449)
FossilOrigin-Name: 1e47d7384d5fdfceb6ec737c656f70be59ba5b01
Diffstat (limited to 'src/tclsqlite.c')
-rw-r--r-- | src/tclsqlite.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/tclsqlite.c b/src/tclsqlite.c index a846ad6bc..cf60288cf 100644 --- a/src/tclsqlite.c +++ b/src/tclsqlite.c @@ -11,7 +11,7 @@ ************************************************************************* ** A TCL Interface to SQLite ** -** $Id: tclsqlite.c,v 1.66 2004/05/22 09:21:21 danielk1977 Exp $ +** $Id: tclsqlite.c,v 1.67 2004/05/24 12:39:02 danielk1977 Exp $ */ #ifndef NO_TCL /* Omit this whole file if TCL is unavailable */ @@ -379,7 +379,7 @@ static int DbCommitHandler(void *cd){ ** This routine is called to evaluate an SQL function implemented ** using TCL script. */ -static void tclSqlFunc(sqlite_func *context, int argc, const char **argv){ +static void tclSqlFunc(sqlite_func *context, int argc, sqlite3_value **argv){ SqlFunc *p = sqlite3_user_data(context); Tcl_DString cmd; int i; @@ -388,7 +388,11 @@ static void tclSqlFunc(sqlite_func *context, int argc, const char **argv){ Tcl_DStringInit(&cmd); Tcl_DStringAppend(&cmd, p->zScript, -1); for(i=0; i<argc; i++){ - Tcl_DStringAppendElement(&cmd, argv[i] ? argv[i] : ""); + if( SQLITE3_NULL==sqlite3_value_type(argv[i]) ){ + Tcl_DStringAppendElement(&cmd, ""); + }else{ + Tcl_DStringAppendElement(&cmd, sqlite3_value_data(argv[i])); + } } rc = Tcl_Eval(p->interp, Tcl_DStringValue(&cmd)); if( rc ){ |