aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2007-06-26 22:55:37 +0000
committerdrh <drh@noemail.net>2007-06-26 22:55:37 +0000
commit985e0c63fcdd321dd398a0fbb079341c383a049c (patch)
treeff9d68fac9b4fc8112ea37d6ed9a5b8e3232da99 /src
parent99bcd30bfb9ac64102b04a2a603b466b88d7a03b (diff)
downloadsqlite-985e0c63fcdd321dd398a0fbb079341c383a049c.tar.gz
sqlite-985e0c63fcdd321dd398a0fbb079341c383a049c.zip
Make sure the TCL bindings always use Tcl_GetWideIntFromObj() even if the
reported type is "int" because on x86-64 and "int" type is 64-bits. Ticket #2465. (CVS 4135) FossilOrigin-Name: 5c93324b937b4d8394b0eb7d7fe74f7965623cbe
Diffstat (limited to 'src')
-rw-r--r--src/tclsqlite.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/tclsqlite.c b/src/tclsqlite.c
index dc01b533d..649270ead 100644
--- a/src/tclsqlite.c
+++ b/src/tclsqlite.c
@@ -12,7 +12,7 @@
** A TCL Interface to SQLite. Append this file to sqlite3.c and
** compile the whole thing to build a TCL-enabled version of SQLite.
**
-** $Id: tclsqlite.c,v 1.192 2007/06/19 23:01:42 drh Exp $
+** $Id: tclsqlite.c,v 1.193 2007/06/26 22:55:38 drh Exp $
*/
#include "tcl.h"
#include <errno.h>
@@ -721,15 +721,15 @@ static void tclSqlFunc(sqlite3_context *context, int argc, sqlite3_value**argv){
** has no string representation. */
data = Tcl_GetByteArrayFromObj(pVar, &n);
sqlite3_result_blob(context, data, n, SQLITE_TRANSIENT);
- }else if( (c=='b' && strcmp(zType,"boolean")==0) ||
- (c=='i' && strcmp(zType,"int")==0) ){
+ }else if( c=='b' && strcmp(zType,"boolean")==0 ){
Tcl_GetIntFromObj(0, pVar, &n);
sqlite3_result_int(context, n);
}else if( c=='d' && strcmp(zType,"double")==0 ){
double r;
Tcl_GetDoubleFromObj(0, pVar, &r);
sqlite3_result_double(context, r);
- }else if( c=='w' && strcmp(zType,"wideInt")==0 ){
+ }else if( (c=='w' && strcmp(zType,"wideInt")==0) ||
+ (c=='i' && strcmp(zType,"int")==0) ){
Tcl_WideInt v;
Tcl_GetWideIntFromObj(0, pVar, &v);
sqlite3_result_int64(context, v);
@@ -1602,15 +1602,15 @@ static int DbObjCmd(void *cd, Tcl_Interp *interp, int objc,Tcl_Obj *const*objv){
sqlite3_bind_blob(pStmt, i, data, n, SQLITE_STATIC);
Tcl_IncrRefCount(pVar);
apParm[nParm++] = pVar;
- }else if( (c=='b' && strcmp(zType,"boolean")==0) ||
- (c=='i' && strcmp(zType,"int")==0) ){
+ }else if( c=='b' && strcmp(zType,"boolean")==0 ){
Tcl_GetIntFromObj(interp, pVar, &n);
sqlite3_bind_int(pStmt, i, n);
}else if( c=='d' && strcmp(zType,"double")==0 ){
double r;
Tcl_GetDoubleFromObj(interp, pVar, &r);
sqlite3_bind_double(pStmt, i, r);
- }else if( c=='w' && strcmp(zType,"wideInt")==0 ){
+ }else if( (c=='w' && strcmp(zType,"wideInt")==0) ||
+ (c=='i' && strcmp(zType,"int")==0) ){
Tcl_WideInt v;
Tcl_GetWideIntFromObj(interp, pVar, &v);
sqlite3_bind_int64(pStmt, i, v);