1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-30 19:03:16 +03:00

Improvements to [14b38ae6ab86a314] so that the Tcl interface is better able

to work with boolean values in both Tcl86 and Tcl90.

FossilOrigin-Name: 4e85343d6107a46682b549667410c296d7f4d17e3ac04ded7357afcbbfbe3e6d
This commit is contained in:
drh
2025-01-07 16:36:47 +00:00
parent ece1729958
commit fd11e5c082
3 changed files with 14 additions and 13 deletions

View File

@ -1097,8 +1097,8 @@ static void tclSqlFunc(sqlite3_context *context, int argc, sqlite3_value**argv){
/* Only return a BLOB type if the Tcl variable is a bytearray and
** has no string representation. */
eType = SQLITE_BLOB;
}else if( (c=='b' && strcmp(zType,"boolean")==0)
|| (c=='b' && strcmp(zType,"booleanString")==0 && pVar->bytes==0)
}else if( (c=='b' && pVar->bytes==0 && strcmp(zType,"boolean")==0 )
|| (c=='b' && pVar->bytes==0 && strcmp(zType,"booleanString")==0 )
|| (c=='w' && strcmp(zType,"wideInt")==0)
|| (c=='i' && strcmp(zType,"int")==0)
){
@ -1506,11 +1506,12 @@ static int dbPrepareAndBind(
sqlite3_bind_blob(pStmt, i, data, n, SQLITE_STATIC);
Tcl_IncrRefCount(pVar);
pPreStmt->apParm[iParm++] = pVar;
}else if( (c=='b' && strcmp(zType,"boolean")==0)
|| (c=='b' && strcmp(zType,"booleanString")==0
&& pVar->bytes==0) ){
}else if( c=='b' && pVar->bytes==0
&& (strcmp(zType,"booleanString")==0
|| strcmp(zType,"boolean")==0)
){
int nn;
Tcl_GetIntFromObj(interp, pVar, &nn);
Tcl_GetBooleanFromObj(interp, pVar, &nn);
sqlite3_bind_int(pStmt, i, nn);
}else if( c=='d' && strcmp(zType,"double")==0 ){
double r;