SQLite

Check-in [d4fbc05df9]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Add a test case for the problem fixed by [1d134ba2ed].
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: d4fbc05df9501a09623d420fcd5b2bce3a57201b
User & Date: dan 2014-03-05 15:04:36.099
Context
2014-03-05
15:52
Count the number of elements in a SrcList object using an "int" rather than a "u8", to avoid overflows and to work around an issue in the C compiler on AIX. (check-in: eee2a13f2c user: drh tags: trunk)
15:04
Add a test case for the problem fixed by [1d134ba2ed]. (check-in: d4fbc05df9 user: dan tags: trunk)
14:40
When converting a result type from TEXT to BLOB using the sqlite3_value_blob() interface, continue to report SQLITE_TEXT as the true type from sqlite3_value_text() as long as that text is still valid. The maintains legacy behavior from before the noMemType change. (check-in: 1d134ba2ed user: drh tags: trunk)
Changes
Unified Diff Show Whitespace Changes Patch
Changes to test/capi3.test.
12
13
14
15
16
17
18

19
20
21
22
23
24
25
# focus of this script testing the callback-free C/C++ API.
#
# $Id: capi3.test,v 1.70 2009/01/09 02:49:32 drh Exp $
#

set testdir [file dirname $argv0]
source $testdir/tester.tcl


# Do not use a codec for tests in this file, as the database file is
# manipulated directly using tcl scripts (using the [hexio_write] command).
#
do_not_use_codec

# Return the UTF-16 representation of the supplied UTF-8 string $str.







>







12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# focus of this script testing the callback-free C/C++ API.
#
# $Id: capi3.test,v 1.70 2009/01/09 02:49:32 drh Exp $
#

set testdir [file dirname $argv0]
source $testdir/tester.tcl
set ::testprefix capi3

# Do not use a codec for tests in this file, as the database file is
# manipulated directly using tcl scripts (using the [hexio_write] command).
#
do_not_use_codec

# Return the UTF-16 representation of the supplied UTF-8 string $str.
1216
1217
1218
1219
1220
1221
1222

















1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
# Ticket #3134.  Prepare a statement with an nBytes parameter of 0.
# Make sure this works correctly and does not reference memory out of
# range.
#
do_test capi3-19.1 {
  sqlite3_prepare_tkt3134 db
} {}


















# Tests of the interface when no VFS is registered.
#
if {![info exists tester_do_binarylog]} {
  db close
  vfs_unregister_all
  do_test capi3-20.1 {
    sqlite3_sleep 100
  } {0}
  vfs_reregister_all
}

finish_test







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>













1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
# Ticket #3134.  Prepare a statement with an nBytes parameter of 0.
# Make sure this works correctly and does not reference memory out of
# range.
#
do_test capi3-19.1 {
  sqlite3_prepare_tkt3134 db
} {}

# Test that calling sqlite3_column_blob() on a TEXT value does not change
# the return type of subsequent calls to sqlite3_column_type().
#
do_execsql_test 20.1 {
  CREATE TABLE t4(x);
  INSERT INTO t4 VALUES('abcdefghij');
}
do_test 20.2 {
  set stmt [sqlite3_prepare db "SELECT * FROM t4" -1 dummy]
  sqlite3_step $stmt
} {SQLITE_ROW}
do_test 20.3 { sqlite3_column_type $stmt 0 } {TEXT}
do_test 20.4 { sqlite3_column_blob $stmt 0 } {abcdefghij}
do_test 20.5 { sqlite3_column_type $stmt 0 } {TEXT}
do_test 20.6 { sqlite3_finalize $stmt } SQLITE_OK


# Tests of the interface when no VFS is registered.
#
if {![info exists tester_do_binarylog]} {
  db close
  vfs_unregister_all
  do_test capi3-20.1 {
    sqlite3_sleep 100
  } {0}
  vfs_reregister_all
}

finish_test