mirror of
https://github.com/sqlite/sqlite.git
synced 2025-07-30 19:03:16 +03:00
In the TCL bindings, if a TCL variable has a bytearray representation and
the host parameter starts with @ instead of $, then always store the content as a BLOB not as a string even if a string representation is also available. (CVS 4092) FossilOrigin-Name: dcb104bd41f5e992d4c84b8947cb5099ae746891
This commit is contained in:
@ -15,7 +15,7 @@
|
||||
# interface is pretty well tested. This file contains some addition
|
||||
# tests for fringe issues that the main test suite does not cover.
|
||||
#
|
||||
# $Id: tclsqlite.test,v 1.57 2007/05/01 17:49:49 danielk1977 Exp $
|
||||
# $Id: tclsqlite.test,v 1.58 2007/06/19 17:15:47 drh Exp $
|
||||
|
||||
set testdir [file dirname $argv0]
|
||||
source $testdir/tester.tcl
|
||||
@ -454,4 +454,32 @@ do_test tcl-12.1 {
|
||||
expr $a*1000000 + $b*1000 + $c
|
||||
} [sqlite3_libversion_number]
|
||||
|
||||
|
||||
# Check to see that when bindings of the form @aaa are used instead
|
||||
# of $aaa, that objects with a bytearray representation are inserted
|
||||
# as BLOBs even if they also have a string representation.
|
||||
#
|
||||
do_test tcl-13.1 {
|
||||
db eval {CREATE TABLE t5(x BLOB)}
|
||||
set x abc123
|
||||
db eval {INSERT INTO t5 VALUES($x)}
|
||||
db eval {SELECT typeof(x) FROM t5}
|
||||
} {text}
|
||||
do_test tcl-13.2 {
|
||||
binary scan $x H notUsed
|
||||
db eval {
|
||||
DELETE FROM t5;
|
||||
INSERT INTO t5 VALUES($x);
|
||||
SELECT typeof(x) FROM t5;
|
||||
}
|
||||
} {text}
|
||||
do_test tcl-13.3 {
|
||||
btree_breakpoint
|
||||
db eval {
|
||||
DELETE FROM t5;
|
||||
INSERT INTO t5 VALUES(@x);
|
||||
SELECT typeof(x) FROM t5;
|
||||
}
|
||||
} {blob}
|
||||
|
||||
finish_test
|
||||
|
Reference in New Issue
Block a user