3 # The author disclaims copyright to this source code. In place of
4 # a legal notice, here is a blessing:
6 # May you do good and not evil.
7 # May you find forgiveness for yourself and forgive others.
8 # May you share freely, never taking more than you give.
10 #***********************************************************************
12 # This file implements tests for CARRAY extension
15 set testdir [file dirname $argv0]
16 source $testdir/tester.tcl
17 set testprefix carray01
23 load_static_extension db carray
25 # Parameter $stmt must be a prepared statement created using
26 # the sqlite3_prepare_v2 command and with parameters fullly bound.
27 # This routine simply runs the statement, gathers the result, and
28 # returns a list containing the result.
30 # If the optional second argument is true, then the stmt is finalized
33 proc run_stmt {stmt {finalizeFlag 0}} {
35 while {[sqlite3_step $stmt]=="SQLITE_ROW"} {
36 for {set i 0} {$i<[sqlite3_data_count $stmt]} {incr i} {
37 lappend r [sqlite3_column_text $stmt $i]
41 sqlite3_finalize $stmt
49 set STMT [sqlite3_prepare_v2 db {SELECT 5 IN carray(?3)} -1]
50 sqlite3_carray_bind $STMT 3 1 2 3 4 5 6 7
54 sqlite3_carray_bind -static $STMT 3 1 2 3 4 5 6 7
58 sqlite3_carray_bind $STMT 3 1 2 3 4 6 7
62 sqlite3_carray_bind -int64 $STMT 3 1 2 3 4 5 6 7
66 sqlite3_carray_bind -int64 -transient $STMT 3 1 2 3 4 5 6 7
70 sqlite3_carray_bind -int64 -static $STMT 3 1 2 3 4 5 6 7
74 sqlite3_carray_bind -int32 -transient $STMT 3 1 2 3 4 5 6 7
78 sqlite3_carray_bind -int32 -static $STMT 3 1 2 3 4 5 6 7
82 sqlite3_carray_bind -int32 $STMT 3 1 2 3 4 5 6 7
86 sqlite3_carray_bind -int64 $STMT 3 1 2 3 4 6 7
90 sqlite3_carray_bind -int64 -transient $STMT 3 1 2 3 4 6 7
94 sqlite3_carray_bind -int64 -static $STMT 3 1 2 3 4 6 7
98 sqlite3_carray_bind -double $STMT 3 1 2 3 4 5 6 7
102 sqlite3_carray_bind -double -transient $STMT 3 1 2 3 4 5 6 7
106 sqlite3_carray_bind -double -static $STMT 3 1 2 3 4 5 6 7
110 sqlite3_carray_bind -double $STMT 3 1 2 3 4 6 7
114 sqlite3_carray_bind -double $STMT 3 1 2 3 4 5 6 7
118 sqlite3_carray_bind -text -static $STMT 3 1 2 3 4 6 7
122 sqlite3_carray_bind -text -transient $STMT 3 1 2 3 4 5 6 7
126 sqlite3_carray_bind $STMT 3
130 sqlite3_finalize $STMT