/ Check-in [31a661d4]
Login

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

Overview
Comment:Documentation and tests to show that the cause of a parsing error is available on sqlite3_errmsg after sqlite3_step return SQLITE_SCHEMA. (CVS 3581)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:31a661d424d0fe03eaf78f98031e360102dafeff
User & Date: drh 2007-01-09 15:06:42
Context
2007-01-09
15:32
Work around win2k problems so that single-character filenames can be used. Ticket #2151. (CVS 3582) check-in: c4eb2100 user: drh tags: trunk
15:06
Documentation and tests to show that the cause of a parsing error is available on sqlite3_errmsg after sqlite3_step return SQLITE_SCHEMA. (CVS 3581) check-in: 31a661d4 user: drh tags: trunk
15:02
Updates tests and documentation to justify the behavior observed in ticket #2158. No changes to code. (CVS 3580) check-in: e1f7cf06 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.4 2007/01/09 15:02:03 drh Exp $
           16  +# $Id: capi3c.test,v 1.5 2007/01/09 15:06:42 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.
................................................................................
  1171   1171     sqlite3_step $STMT
  1172   1172   } SQLITE_DONE
  1173   1173   do_test capi3c-19.4 {
  1174   1174     sqlite3_reset $STMT
  1175   1175     db eval {DROP TABLE t3}
  1176   1176     sqlite3_step $STMT
  1177   1177   } SQLITE_SCHEMA
         1178  +do_test capi3c-19.4.2 {
         1179  +  sqlite3_errmsg $DB
         1180  +} {no such table: t3}
  1178   1181   do_test capi3c-19.5 {
  1179   1182     sqlite3_reset $STMT
  1180   1183     db eval {
  1181   1184        CREATE TABLE t3(x,y);
  1182   1185        INSERT INTO t3 VALUES(1,2);
  1183   1186     }
  1184   1187     sqlite3_step $STMT

Changes to www/capi3ref.tcl.

     1         -set rcsid {$Id: capi3ref.tcl,v 1.48 2007/01/09 15:02:03 drh Exp $}
            1  +set rcsid {$Id: capi3ref.tcl,v 1.49 2007/01/09 15:06:42 drh Exp $}
     2      2   source common.tcl
     3      3   header {C/C++ Interface For SQLite Version 3}
     4      4   puts {
     5      5   <h2>C/C++ Interface For SQLite Version 3</h2>
     6      6   }
     7      7   
     8      8   proc api {name prototype desc {notused x}} {
................................................................................
  1192   1192    <li>
  1193   1193    If the database schema changes, instead of returning SQLITE_SCHEMA as it
  1194   1194    always used to do, sqlite3_step() will automatically recompile the SQL
  1195   1195    statement and try to run it again.  If the schema has changed in a way
  1196   1196    that makes the statement no longer valid, sqlite3_step() will still
  1197   1197    return SQLITE_SCHEMA.  But unlike the legacy behavior, SQLITE_SCHEMA is
  1198   1198    now a fatal error.  Calling sqlite3_prepare_v2() again will not make the
  1199         - error go away.
         1199  + error go away.  Note: use sqlite3_errmsg() to find the text of the parsing
         1200  + error that results in an SQLITE_SCHEMA return.
  1200   1201    </li>
  1201   1202   
  1202   1203    <li>
  1203   1204    When an error occurs, 
  1204   1205    sqlite3_step() will return one of the detailed result-codes
  1205   1206    like SQLITE_IOERR or SQLITE_FULL or SQLITE_SCHEMA directly. The
  1206   1207    legacy behavior was that sqlite3_step() would only return a generic