1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-27 20:41:58 +03:00

Move the sqlite3_sleep() and sqlite3_clear_bindings() interfaces into the

main library and make this official. (CVS 3316)

FossilOrigin-Name: eb3442c44ef1dbf8895195bb08fbeeea315b44c1
This commit is contained in:
drh
2006-06-27 20:06:44 +00:00
parent 0c07fb9aa1
commit f9cb7f58a7
6 changed files with 94 additions and 22 deletions

View File

@ -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.37 2006/01/23 18:42:21 drh Exp $
# $Id: bind.test,v 1.38 2006/06/27 20:06:45 drh Exp $
#
set testdir [file dirname $argv0]
@ -501,7 +501,7 @@ ifcapable tclvar {
if {[execsql {pragma encoding}]=="UTF-8"} {
# Test the ability to bind text that contains embedded '\000' characters.
# Make sure we can recover the enter input string.
# Make sure we can recover the entire input string.
#
do_test bind-12.1 {
execsql {
@ -524,4 +524,36 @@ if {[execsql {pragma encoding}]=="UTF-8"} {
} {X'6162630078797A007071'}
}
# Test the operation of sqlite3_clear_bindings
#
do_test bind-13.1 {
set VM [sqlite3_prepare $DB {SELECT ?,?,?} -1 TAIL]
sqlite3_step $VM
list [sqlite3_column_type $VM 0] [sqlite3_column_type $VM 1] \
[sqlite3_column_type $VM 2]
} {NULL NULL NULL}
do_test bind-13.2 {
sqlite3_reset $VM
sqlite3_bind_int $VM 1 1
sqlite3_bind_int $VM 2 2
sqlite3_bind_int $VM 3 3
sqlite3_step $VM
list [sqlite3_column_type $VM 0] [sqlite3_column_type $VM 1] \
[sqlite3_column_type $VM 2]
} {INTEGER INTEGER INTEGER}
do_test bind-13.3 {
sqlite3_reset $VM
sqlite3_step $VM
list [sqlite3_column_type $VM 0] [sqlite3_column_type $VM 1] \
[sqlite3_column_type $VM 2]
} {INTEGER INTEGER INTEGER}
do_test bind-13.4 {
sqlite3_reset $VM
sqlite3_clear_bindings $VM
sqlite3_step $VM
list [sqlite3_column_type $VM 0] [sqlite3_column_type $VM 1] \
[sqlite3_column_type $VM 2]
} {NULL NULL NULL}
sqlite3_finalize $VM
finish_test

View File

@ -13,7 +13,7 @@
# This file implements tests for miscellanous features that were
# left out of other test files.
#
# $Id: misc1.test,v 1.40 2006/01/17 09:35:02 danielk1977 Exp $
# $Id: misc1.test,v 1.41 2006/06/27 20:06:45 drh Exp $
set testdir [file dirname $argv0]
source $testdir/tester.tcl
@ -577,4 +577,9 @@ do_test misc1-17.1 {
} {2 3}
}
do_test misc1-18.1 {
set n [sqlite3_sleep 100]
expr {$n>=100}
} {1}
finish_test