mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-01 06:27:03 +03:00
Add a test to verify that binding text with embedded '\000' works. Also
comment changes in os.h. (CVS 2797) FossilOrigin-Name: 31251a9098662ccf08af5bd5bc3afb282a149701
This commit is contained in:
@ -11,7 +11,7 @@
|
||||
# This file implements regression tests for SQLite library. The
|
||||
# focus of this script testing the sqlite_bind API.
|
||||
#
|
||||
# $Id: bind.test,v 1.32 2005/06/22 08:48:07 drh Exp $
|
||||
# $Id: bind.test,v 1.33 2005/12/02 02:44:06 drh Exp $
|
||||
#
|
||||
|
||||
set testdir [file dirname $argv0]
|
||||
@ -500,4 +500,22 @@ ifcapable tclvar {
|
||||
} {1 {unrecognized token: "$abc(123"}}
|
||||
}
|
||||
|
||||
# Test the ability to bind text that contains embedded '\000' characters.
|
||||
# Make sure we can recover the enter input string.
|
||||
#
|
||||
do_test bind-12.1 {
|
||||
execsql {
|
||||
CREATE TABLE t3(x BLOB);
|
||||
}
|
||||
set VM [sqlite3_prepare $DB {INSERT INTO t3 VALUES(?)} -1 TAIL]
|
||||
sqlite_bind $VM 1 not-used blob10
|
||||
sqlite3_step $VM
|
||||
sqlite3_finalize $VM
|
||||
execsql {
|
||||
SELECT typeof(x), length(x), quote(x),
|
||||
length(cast(x AS BLOB)), quote(cast(x AS BLOB)) FROM t3
|
||||
}
|
||||
} {text 3 'abc' 10 X'6162630078797A007071'}
|
||||
|
||||
|
||||
finish_test
|
||||
|
Reference in New Issue
Block a user