/ Check-in [d4fbc05d]
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 | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: d4fbc05df9501a09623d420fcd5b2bce3a57201b
User & Date: dan 2014-03-05 15:04:36
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: eee2a13f user: drh tags: trunk
15:04
Add a test case for the problem fixed by [1d134ba2ed]. check-in: d4fbc05d 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: 1d134ba2 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to test/capi3.test.

    12     12   # focus of this script testing the callback-free C/C++ API.
    13     13   #
    14     14   # $Id: capi3.test,v 1.70 2009/01/09 02:49:32 drh Exp $
    15     15   #
    16     16   
    17     17   set testdir [file dirname $argv0]
    18     18   source $testdir/tester.tcl
           19  +set ::testprefix capi3
    19     20   
    20     21   # Do not use a codec for tests in this file, as the database file is
    21     22   # manipulated directly using tcl scripts (using the [hexio_write] command).
    22     23   #
    23     24   do_not_use_codec
    24     25   
    25     26   # Return the UTF-16 representation of the supplied UTF-8 string $str.
................................................................................
  1216   1217   # Ticket #3134.  Prepare a statement with an nBytes parameter of 0.
  1217   1218   # Make sure this works correctly and does not reference memory out of
  1218   1219   # range.
  1219   1220   #
  1220   1221   do_test capi3-19.1 {
  1221   1222     sqlite3_prepare_tkt3134 db
  1222   1223   } {}
         1224  +
         1225  +# Test that calling sqlite3_column_blob() on a TEXT value does not change
         1226  +# the return type of subsequent calls to sqlite3_column_type().
         1227  +#
         1228  +do_execsql_test 20.1 {
         1229  +  CREATE TABLE t4(x);
         1230  +  INSERT INTO t4 VALUES('abcdefghij');
         1231  +}
         1232  +do_test 20.2 {
         1233  +  set stmt [sqlite3_prepare db "SELECT * FROM t4" -1 dummy]
         1234  +  sqlite3_step $stmt
         1235  +} {SQLITE_ROW}
         1236  +do_test 20.3 { sqlite3_column_type $stmt 0 } {TEXT}
         1237  +do_test 20.4 { sqlite3_column_blob $stmt 0 } {abcdefghij}
         1238  +do_test 20.5 { sqlite3_column_type $stmt 0 } {TEXT}
         1239  +do_test 20.6 { sqlite3_finalize $stmt } SQLITE_OK
         1240  +
  1223   1241   
  1224   1242   # Tests of the interface when no VFS is registered.
  1225   1243   #
  1226   1244   if {![info exists tester_do_binarylog]} {
  1227   1245     db close
  1228   1246     vfs_unregister_all
  1229   1247     do_test capi3-20.1 {
  1230   1248       sqlite3_sleep 100
  1231   1249     } {0}
  1232   1250     vfs_reregister_all
  1233   1251   }
  1234   1252   
  1235   1253   finish_test