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 #***********************************************************************
13 set testdir [file dirname $argv0]
14 source $testdir/tester.tcl
18 # Test that using bind_value() on a REAL sqlite3_value that was stored
19 # as an INTEGER works properly.
21 # 1.1: An IntReal value read from a table,
22 # 1.2: IntReal values obtained via the sqlite3_preupdate_old|new()
26 CREATE TABLE t1(a REAL);
27 INSERT INTO t1 VALUES(42.0);
32 set stmt [sqlite3_prepare db "SELECT ?" -1 tail]
33 sqlite3_bind_value_from_select $stmt 1 "SELECT a FROM t1"
35 sqlite3_column_text $stmt 0
37 sqlite3_finalize $stmt
39 ifcapable !preupdate {
45 set stmt [sqlite3_prepare db "SELECT ?" -1 tail]
46 sqlite3_bind_value_from_preupdate $stmt 1 old 0
48 lappend ::reslist [sqlite3_column_text $stmt 0]
50 sqlite3_bind_value_from_preupdate $stmt 1 new 0
52 lappend ::reslist [sqlite3_column_text $stmt 0]
53 sqlite3_finalize $stmt
55 db preupdate hook preup
59 execsql { UPDATE t1 SET a=43; }