aboutsummaryrefslogtreecommitdiff
path: root/src/tclsqlite.c
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2007-06-19 23:01:41 +0000
committerdrh <drh@noemail.net>2007-06-19 23:01:41 +0000
commit1c747819de690f0ba49dee10b05048f1052520b7 (patch)
tree071cf7c23893d64da00744a730a9776a8e9e5129 /src/tclsqlite.c
parent59fffd02de811cecd9146a79c5fec3fb4e0d87f8 (diff)
downloadsqlite-1c747819de690f0ba49dee10b05048f1052520b7.tar.gz
sqlite-1c747819de690f0ba49dee10b05048f1052520b7.zip
Change the TCL bindings so that @aaa always treats the variable aaa as
a bytearray and binds the value as a BLOB. This change is backwards compatible since the $ behavior is unchanged and @ was not accepted until the current round of changes. (CVS 4094) FossilOrigin-Name: 6f7d55acedc92eeaf988425c719addd56209187f
Diffstat (limited to 'src/tclsqlite.c')
-rw-r--r--src/tclsqlite.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/tclsqlite.c b/src/tclsqlite.c
index 49fd776e6..dc01b533d 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.191 2007/06/19 17:48:57 drh Exp $
+** $Id: tclsqlite.c,v 1.192 2007/06/19 23:01:42 drh Exp $
*/
#include "tcl.h"
#include <errno.h>
@@ -1593,10 +1593,10 @@ static int DbObjCmd(void *cd, Tcl_Interp *interp, int objc,Tcl_Obj *const*objv){
u8 *data;
char *zType = pVar->typePtr ? pVar->typePtr->name : "";
char c = zType[0];
- if( c=='b' && strcmp(zType,"bytearray")==0
- && (pVar->bytes==0 || zVar[0]=='@') ){
- /* Only load a BLOB type if the Tcl variable is a bytearray and
- ** either it has no string representation or the host
+ if( zVar[0]=='@' ||
+ (c=='b' && strcmp(zType,"bytearray")==0 && pVar->bytes==0) ){
+ /* Load a BLOB type if the Tcl variable is a bytearray and
+ ** it has no string representation or the host
** parameter name begins with "@". */
data = Tcl_GetByteArrayFromObj(pVar, &n);
sqlite3_bind_blob(pStmt, i, data, n, SQLITE_STATIC);