mirror of
https://github.com/sqlite/sqlite.git
synced 2025-10-24 09:53:10 +03:00
Ensure the type of an sqlite3_value* is not modified by calls to
sqlite3_value_*() calls. (CVS 1463) FossilOrigin-Name: ce8b15203413f38a8b7127eb08ae5db1c1eb164a
This commit is contained in:
28
src/test1.c
28
src/test1.c
@@ -13,7 +13,7 @@
|
||||
** is not included in the SQLite library. It is used for automated
|
||||
** testing of the SQLite library.
|
||||
**
|
||||
** $Id: test1.c,v 1.57 2004/05/26 10:11:06 danielk1977 Exp $
|
||||
** $Id: test1.c,v 1.58 2004/05/26 13:27:00 danielk1977 Exp $
|
||||
*/
|
||||
#include "sqliteInt.h"
|
||||
#include "tcl.h"
|
||||
@@ -695,30 +695,6 @@ static int test_register_func(
|
||||
return TCL_OK;
|
||||
}
|
||||
|
||||
/*
|
||||
** This SQLite callback records the datatype of all columns.
|
||||
**
|
||||
** The pArg argument is really a pointer to a TCL interpreter. The
|
||||
** column names are inserted as the result of this interpreter.
|
||||
**
|
||||
** This routine returns non-zero which causes the query to abort.
|
||||
*/
|
||||
static int rememberDataTypes(void *pArg, int nCol, char **argv, char **colv){
|
||||
int i;
|
||||
Tcl_Interp *interp = (Tcl_Interp*)pArg;
|
||||
Tcl_Obj *pList, *pElem;
|
||||
if( colv[nCol+1]==0 ){
|
||||
return 1;
|
||||
}
|
||||
pList = Tcl_NewObj();
|
||||
for(i=0; i<nCol; i++){
|
||||
pElem = Tcl_NewStringObj(colv[i+nCol] ? colv[i+nCol] : "NULL", -1);
|
||||
Tcl_ListObjAppendElement(interp, pList, pElem);
|
||||
}
|
||||
Tcl_SetObjResult(interp, pList);
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*
|
||||
** Usage: sqlite3_finalize STMT
|
||||
**
|
||||
@@ -742,7 +718,7 @@ static int test_finalize(
|
||||
if( getStmtPointer(interp, Tcl_GetString(objv[1]), &pStmt) ) return TCL_ERROR;
|
||||
|
||||
rc = sqlite3_finalize(pStmt);
|
||||
Tcl_SetResult(interp, errorName(rc), TCL_STATIC);
|
||||
Tcl_SetResult(interp, (char *)errorName(rc), TCL_STATIC);
|
||||
if( rc ){
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user