1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-01 06:27:03 +03:00

Ensure the type of an sqlite3_value* is not modified by calls to

sqlite3_value_*() calls. (CVS 1463)

FossilOrigin-Name: ce8b15203413f38a8b7127eb08ae5db1c1eb164a
This commit is contained in:
danielk1977
2004-05-26 13:27:00 +00:00
parent 3cf8606395
commit b77f5dadbf
6 changed files with 137 additions and 129 deletions

View File

@ -11,7 +11,7 @@
# This file implements regression tests for SQLite library. The
# focus of this script testing the callback-free C/C++ API.
#
# $Id: capi3.test,v 1.4 2004/05/26 10:11:07 danielk1977 Exp $
# $Id: capi3.test,v 1.5 2004/05/26 13:27:00 danielk1977 Exp $
#
set testdir [file dirname $argv0]
@ -178,7 +178,7 @@ do_test capi3-5.0 {
execsql {
CREATE TABLE t1(a VARINT, b BLOB, c VARCHAR(16));
INSERT INTO t1 VALUES(1, 2, 3);
INSERT INTO t1 VALUES('one', 'two', 'three');
INSERT INTO t1 VALUES('one', 'two', NULL);
}
set sql "SELECT * FROM t1"
set STMT [sqlite3_prepare $DB $sql -1 TAIL]
@ -208,6 +208,7 @@ do_test capi3-5.4 {
set types
} {INTEGER INTEGER TEXT}
if 0 {
do_test capi3-5.5 {
set ints [list]
foreach i {0 1 2} {lappend ints [sqlite3_column_int $STMT $i]}
@ -219,6 +220,7 @@ do_test capi3-5.6 {
foreach i {0 1 2} {lappend utf8 [sqlite3_column_data $STMT $i]}
set utf8
} {1 2 3}
}
do_test capi3-5.7 {
set utf8 [list]
@ -242,7 +244,7 @@ do_test capi3-5.10 {
set types [list]
foreach i {0 1 2} {lappend types [sqlite3_column_type $STMT $i]}
set types
} {TEXT TEXT TEXT}
} {TEXT TEXT NULL}
do_test capi3-5.11 {
set ints [list]
@ -254,19 +256,19 @@ do_test capi3-5.12 {
set utf8 [list]
foreach i {0 1 2} {lappend utf8 [sqlite3_column_data $STMT $i]}
set utf8
} {one two three}
} {one two {}}
do_test capi3-5.13 {
set utf8 [list]
foreach i {0 1 2} {lappend utf8 [utf8 [sqlite3_column_data16 $STMT $i]]}
set utf8
} {one two three}
} {one two {}}
do_test capi3-5.14 {
set types [list]
foreach i {0 1 2} {lappend types [sqlite3_column_type $STMT $i]}
set types
} {TEXT TEXT TEXT}
} {TEXT TEXT NULL}
do_test capi3-5.15 {
sqlite3_step $STMT