sqlite3/sqlite3-tcl85.diff

74 lines
2.1 KiB
Diff

Index: sqlite/test/tclsqlite.test
RCS File: /sqlite/sqlite/test/tclsqlite.test,v
================================================================================
--- Makefile.in
+++ Makefile.in
@@ -392,7 +392,7 @@
libtclsqlite3.la: tclsqlite.lo libsqlite3.la
$(LTLINK) -o $@ tclsqlite.lo \
- $(LIBOBJ) @TCL_STUB_LIB_SPEC@ $(TLIBS) \
+ libsqlite3.la @TCL_STUB_LIB_SPEC@ $(TLIBS) \
-rpath "$(libdir)/sqlite" \
-version-info "8:6:8"
--- src/test1.c
+++ src/test1.c
@@ -2621,8 +2621,20 @@
if( getStmtPointer(interp, Tcl_GetString(objv[1]), &pStmt) ) return TCL_ERROR;
if( Tcl_GetIntFromObj(interp, objv[2], &idx) ) return TCL_ERROR;
- if( Tcl_GetDoubleFromObj(interp, objv[3], &value) ) return TCL_ERROR;
+ /* Intercept the string "NaN" and generate a NaN value for it.
+ ** All other strings are passed through to Tcl_GetDoubleFromObj().
+ ** Tcl_GetDoubleFromObj() should understand "NaN" but some versions
+ ** contain a bug.
+ */
+ if( strcmp(Tcl_GetString(objv[3]), "NaN")==0 ){
+ sqlite3_int64 i;
+ i = 0xfff80000;
+ i <<= 32;
+ value = *(double*)(char*)&i;
+ }else if( Tcl_GetDoubleFromObj(interp, objv[3], &value) ){
+ return TCL_ERROR;
+ }
rc = sqlite3_bind_double(pStmt, idx, value);
if( sqlite3TestErrCode(interp, StmtToDb(pStmt), rc) ) return TCL_ERROR;
if( rc!=SQLITE_OK ){
--- test/tclsqlite.test
+++ test/tclsqlite.test
@@ -69,15 +69,15 @@
} msg]
lappend v $msg
} {0 {}}
+catch {expr x*} msg
do_test tcl-1.6 {
set v [catch {
db eval {SELECT * FROM t1} data {
expr x*
}
} msg]
- regsub {:.*$} $msg {} msg
lappend v $msg
-} {1 {syntax error in expression "x*"}}
+} [list 1 $msg]
do_test tcl-1.7 {
set v [catch {db} msg]
lappend v $msg
--- test/types3.test
+++ test/types3.test
@@ -74,10 +74,11 @@
set V [db one {SELECT 123}]
tcl_variable_type V
} int
+set Vx [expr {1+wide(123456789123456)}]
do_test types3-2.3 {
set V [db one {SELECT 1234567890123456}]
tcl_variable_type V
-} wideInt
+} [tcl_variable_type Vx]
do_test types3-2.4.1 {
set V [db one {SELECT 1234567890123456.1}]
tcl_variable_type V