/ Check-in [b0650aa6]
Login

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

Overview
Comment:Additional tests of sqlite3_prepare_v2. (CVS 3577)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: b0650aa6cfcb4c59fd8556b8f5523573538bd7e5
User & Date: drh 2007-01-08 22:40:33
Context
2007-01-09
14:01
When an automatic re-prepare occurs, take care not to reset the internal schema symbol table. Ticket #2156. This change also includes some debugging enhancements. (CVS 3578) check-in: 43fe7fc1 user: drh tags: trunk
2007-01-08
22:40
Additional tests of sqlite3_prepare_v2. (CVS 3577) check-in: b0650aa6 user: drh tags: trunk
21:07
Fix a critical bug in sqlite3_prepare_v2 that can lead to segfaults when the schema changes and the statement is recompiled automatically. Ticket #2154. (CVS 3576) check-in: 3401388d user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to test/capi3c.test.

     9      9   #
    10     10   #***********************************************************************
    11     11   # This file implements regression tests for SQLite library.  
    12     12   #
    13     13   # This is a copy of the capi3.test file that has been adapted to
    14     14   # test the new sqlite3_prepare_v2 interface.
    15     15   #
    16         -# $Id: capi3c.test,v 1.2 2007/01/08 21:07:18 drh Exp $
           16  +# $Id: capi3c.test,v 1.3 2007/01/08 22:40:33 drh Exp $
    17     17   #
    18     18   
    19     19   set testdir [file dirname $argv0]
    20     20   source $testdir/tester.tcl
    21     21   
    22     22   # Return the UTF-16 representation of the supplied UTF-8 string $str.
    23     23   # If $nt is true, append two 0x00 bytes as a nul terminator.
................................................................................
  1123   1123   } two
  1124   1124   do_test capi3c-17.18 {
  1125   1125     sqlite3_step $STMT
  1126   1126   } SQLITE_DONE
  1127   1127   do_test capi3c-17.99 {
  1128   1128     sqlite3_finalize $STMT
  1129   1129   } SQLITE_OK
         1130  +
         1131  +# On the mailing list it has been reported that finalizing after
         1132  +# an SQLITE_BUSY return leads to a segfault.  Here we test that case.
         1133  +#
         1134  +do_test capi3c-18.1 {
         1135  +  sqlite3 db2 test.db
         1136  +  set STMT [sqlite3_prepare_v2 $DB {SELECT max(a) FROM t1} -1 TAIL]
         1137  +  sqlite3_step $STMT
         1138  +} SQLITE_ROW
         1139  +do_test capi3c-18.2 {
         1140  +  sqlite3_column_int $STMT 0
         1141  +} 4
         1142  +do_test capi3c-18.3 {
         1143  +  sqlite3_reset $STMT
         1144  +  db2 eval {BEGIN EXCLUSIVE}
         1145  +  sqlite3_step $STMT
         1146  +} SQLITE_BUSY
         1147  +do_test capi3c-18.4 {
         1148  +  sqlite3_finalize $STMT
         1149  +} SQLITE_BUSY
         1150  +do_test capi3c-18.5 {
         1151  +  db2 eval {COMMIT}
         1152  +  db2 close
         1153  +} {}
         1154  +
  1130   1155   
  1131   1156   
  1132   1157   finish_test