sqllogictest
Check-in [1b31f96adf]
Not logged in

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

Overview
Comment:Update the built-in SQLite to the 3.20.0 release candidate.
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 1b31f96adf7460a807b31c75ed34a9d54d4e23cd
User & Date: drh 2017-07-15 14:42:44
Context
2017-07-25
18:42
Update the built-in SQLite to the second release candidate for 3.20.0. check-in: 0dfbb06ddb user: drh tags: trunk
2017-07-15
14:42
Update the built-in SQLite to the 3.20.0 release candidate. check-in: 1b31f96adf user: drh tags: trunk
2017-07-14
00:22
Update the built-in SQLite to the first 3.20.0 beta. check-in: 7ff30b6479 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/sqlite3.c.

  1148   1148   **
  1149   1149   ** See also: [sqlite3_libversion()],
  1150   1150   ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
  1151   1151   ** [sqlite_version()] and [sqlite_source_id()].
  1152   1152   */
  1153   1153   #define SQLITE_VERSION        "3.20.0"
  1154   1154   #define SQLITE_VERSION_NUMBER 3020000
  1155         -#define SQLITE_SOURCE_ID      "2017-07-13 22:39:15 889968bdbf1c258238cb68d82f059e16366c4a40c2d541dd4a1811ab72e693cb"
         1155  +#define SQLITE_SOURCE_ID      "2017-07-15 13:49:56 47cf83a0682b7b3219cf255457f5fbe05f3c1f46be42f6bbab33b78a57a252f6"
  1156   1156   
  1157   1157   /*
  1158   1158   ** CAPI3REF: Run-Time Library Version Numbers
  1159   1159   ** KEYWORDS: sqlite3_version sqlite3_sourceid
  1160   1160   **
  1161   1161   ** These interfaces provide the same information as the [SQLITE_VERSION],
  1162   1162   ** [SQLITE_VERSION_NUMBER], and [SQLITE_SOURCE_ID] C preprocessor macros
................................................................................
  1260   1260   **
  1261   1261   ** Each open SQLite database is represented by a pointer to an instance of
  1262   1262   ** the opaque structure named "sqlite3".  It is useful to think of an sqlite3
  1263   1263   ** pointer as an object.  The [sqlite3_open()], [sqlite3_open16()], and
  1264   1264   ** [sqlite3_open_v2()] interfaces are its constructors, and [sqlite3_close()]
  1265   1265   ** and [sqlite3_close_v2()] are its destructors.  There are many other
  1266   1266   ** interfaces (such as
  1267         -** [sqlite3_prepare_v3()], [sqlite3_create_function()], and
         1267  +** [sqlite3_prepare_v2()], [sqlite3_create_function()], and
  1268   1268   ** [sqlite3_busy_timeout()] to name but three) that are methods on an
  1269   1269   ** sqlite3 object.
  1270   1270   */
  1271   1271   typedef struct sqlite3 sqlite3;
  1272   1272   
  1273   1273   /*
  1274   1274   ** CAPI3REF: 64-Bit Integer Types
................................................................................
  1364   1364   typedef int (*sqlite3_callback)(void*,int,char**, char**);
  1365   1365   
  1366   1366   /*
  1367   1367   ** CAPI3REF: One-Step Query Execution Interface
  1368   1368   ** METHOD: sqlite3
  1369   1369   **
  1370   1370   ** The sqlite3_exec() interface is a convenience wrapper around
  1371         -** [sqlite3_prepare_v3()], [sqlite3_step()], and [sqlite3_finalize()],
         1371  +** [sqlite3_prepare_v2()], [sqlite3_step()], and [sqlite3_finalize()],
  1372   1372   ** that allows an application to run multiple statements of SQL
  1373   1373   ** without having to use a lot of C code. 
  1374   1374   **
  1375   1375   ** ^The sqlite3_exec() interface runs zero or more UTF-8 encoded,
  1376   1376   ** semicolon-separate SQL statements passed into its 2nd argument,
  1377   1377   ** in the context of the [database connection] passed in as its 1st
  1378   1378   ** argument.  ^If the callback function of the 3rd argument to
................................................................................
  3033   3033   ** is an integer - non-zero to disable checkpoints-on-close, or zero (the
  3034   3034   ** default) to enable them. The second parameter is a pointer to an integer
  3035   3035   ** into which is written 0 or 1 to indicate whether checkpoints-on-close
  3036   3036   ** have been disabled - 0 if they are not disabled, 1 if they are.
  3037   3037   ** </dd>
  3038   3038   **
  3039   3039   ** <dt>SQLITE_DBCONFIG_ENABLE_QPSG</dt>
  3040         -** <dd>The SQLITE_DBCONFIG_ENABLE_QPSG option activates or deactivates
         3040  +** <dd>^(The SQLITE_DBCONFIG_ENABLE_QPSG option activates or deactivates
  3041   3041   ** the [query planner stability guarantee] (QPSG).  When the QPSG is active,
  3042   3042   ** a single SQL query statement will always use the same algorithm regardless
  3043         -** of values of [bound parameters].  The QPSG disables some query optimizations
         3043  +** of values of [bound parameters].)^ The QPSG disables some query optimizations
  3044   3044   ** that look at the values of bound parameters, which can make some queries
  3045   3045   ** slower.  But the QPSG has the advantage of more predictable behavior.  With
  3046   3046   ** the QPSG active, SQLite will always use the same query plan in the field as
  3047   3047   ** was used during testing in the lab.
  3048   3048   ** </dd>
  3049   3049   **
  3050   3050   ** </dl>
................................................................................
  3726   3726   ** to perform various actions, the authorizer callback is invoked to
  3727   3727   ** see if those actions are allowed.  ^The authorizer callback should
  3728   3728   ** return [SQLITE_OK] to allow the action, [SQLITE_IGNORE] to disallow the
  3729   3729   ** specific action but allow the SQL statement to continue to be
  3730   3730   ** compiled, or [SQLITE_DENY] to cause the entire SQL statement to be
  3731   3731   ** rejected with an error.  ^If the authorizer callback returns
  3732   3732   ** any value other than [SQLITE_IGNORE], [SQLITE_OK], or [SQLITE_DENY]
  3733         -** then the [sqlite3_prepare_v3()] or equivalent call that triggered
         3733  +** then the [sqlite3_prepare_v2()] or equivalent call that triggered
  3734   3734   ** the authorizer will fail with an error message.
  3735   3735   **
  3736   3736   ** When the callback returns [SQLITE_OK], that means the operation
  3737   3737   ** requested is ok.  ^When the callback returns [SQLITE_DENY], the
  3738         -** [sqlite3_prepare_v3()] or equivalent call that triggered the
         3738  +** [sqlite3_prepare_v2()] or equivalent call that triggered the
  3739   3739   ** authorizer will fail with an error message explaining that
  3740   3740   ** access is denied. 
  3741   3741   **
  3742   3742   ** ^The first parameter to the authorizer callback is a copy of the third
  3743   3743   ** parameter to the sqlite3_set_authorizer() interface. ^The second parameter
  3744   3744   ** to the callback is an integer [SQLITE_COPY | action code] that specifies
  3745   3745   ** the particular action to be authorized. ^The third through sixth parameters
................................................................................
  3782   3782   ** ^(Only a single authorizer can be in place on a database connection
  3783   3783   ** at a time.  Each call to sqlite3_set_authorizer overrides the
  3784   3784   ** previous call.)^  ^Disable the authorizer by installing a NULL callback.
  3785   3785   ** The authorizer is disabled by default.
  3786   3786   **
  3787   3787   ** The authorizer callback must not do anything that will modify
  3788   3788   ** the database connection that invoked the authorizer callback.
  3789         -** Note that [sqlite3_prepare_v3()] and [sqlite3_step()] both modify their
         3789  +** Note that [sqlite3_prepare_v2()] and [sqlite3_step()] both modify their
  3790   3790   ** database connections for the meaning of "modify" in this paragraph.
  3791   3791   **
  3792         -** ^When [sqlite3_prepare_v3()] is used to prepare a statement, the
         3792  +** ^When [sqlite3_prepare_v2()] is used to prepare a statement, the
  3793   3793   ** statement might be re-prepared during [sqlite3_step()] due to a 
  3794   3794   ** schema change.  Hence, the application should ensure that the
  3795   3795   ** correct authorizer callback remains in place during the [sqlite3_step()].
  3796   3796   **
  3797   3797   ** ^Note that the authorizer callback is invoked only during
  3798   3798   ** [sqlite3_prepare()] or its variants.  Authorization is not
  3799   3799   ** performed during statement evaluation in [sqlite3_step()], unless
  3800   3800   ** as stated in the previous paragraph, sqlite3_step() invokes
  3801         -** sqlite3_prepare_v3() to reprepare a statement after a schema change.
         3801  +** sqlite3_prepare_v2() to reprepare a statement after a schema change.
  3802   3802   */
  3803   3803   SQLITE_API int sqlite3_set_authorizer(
  3804   3804     sqlite3*,
  3805   3805     int (*xAuth)(void*,int,const char*,const char*,const char*,const char*),
  3806   3806     void *pUserData
  3807   3807   );
  3808   3808   
................................................................................
  4030   4030   **
  4031   4031   ** ^If the progress callback returns non-zero, the operation is
  4032   4032   ** interrupted.  This feature can be used to implement a
  4033   4033   ** "Cancel" button on a GUI progress dialog box.
  4034   4034   **
  4035   4035   ** The progress handler callback must not do anything that will modify
  4036   4036   ** the database connection that invoked the progress handler.
  4037         -** Note that [sqlite3_prepare_v3()] and [sqlite3_step()] both modify their
         4037  +** Note that [sqlite3_prepare_v2()] and [sqlite3_step()] both modify their
  4038   4038   ** database connections for the meaning of "modify" in this paragraph.
  4039   4039   **
  4040   4040   */
  4041   4041   SQLITE_API void sqlite3_progress_handler(sqlite3*, int, int(*)(void*), void*);
  4042   4042   
  4043   4043   /*
  4044   4044   ** CAPI3REF: Opening A New Database Connection
................................................................................
  4384   4384   ** original SQL text is source code.  A prepared statement object 
  4385   4385   ** is the compiled object code.  All SQL must be converted into a
  4386   4386   ** prepared statement before it can be run.
  4387   4387   **
  4388   4388   ** The life-cycle of a prepared statement object usually goes like this:
  4389   4389   **
  4390   4390   ** <ol>
  4391         -** <li> Create the prepared statement object using [sqlite3_prepare_v3()].
         4391  +** <li> Create the prepared statement object using [sqlite3_prepare_v2()].
  4392   4392   ** <li> Bind values to [parameters] using the sqlite3_bind_*()
  4393   4393   **      interfaces.
  4394   4394   ** <li> Run the SQL by calling [sqlite3_step()] one or more times.
  4395   4395   ** <li> Reset the prepared statement using [sqlite3_reset()] then go back
  4396   4396   **      to step 2.  Do this zero or more times.
  4397   4397   ** <li> Destroy the object using [sqlite3_finalize()].
  4398   4398   ** </ol>
................................................................................
  4466   4466   ** <dd>The maximum depth of the parse tree on any expression.</dd>)^
  4467   4467   **
  4468   4468   ** [[SQLITE_LIMIT_COMPOUND_SELECT]] ^(<dt>SQLITE_LIMIT_COMPOUND_SELECT</dt>
  4469   4469   ** <dd>The maximum number of terms in a compound SELECT statement.</dd>)^
  4470   4470   **
  4471   4471   ** [[SQLITE_LIMIT_VDBE_OP]] ^(<dt>SQLITE_LIMIT_VDBE_OP</dt>
  4472   4472   ** <dd>The maximum number of instructions in a virtual machine program
  4473         -** used to implement an SQL statement.  If [sqlite3_prepare_v3()] or
         4473  +** used to implement an SQL statement.  If [sqlite3_prepare_v2()] or
  4474   4474   ** the equivalent tries to allocate space for more than this many opcodes
  4475   4475   ** in a single prepared statement, an SQLITE_NOMEM error is returned.</dd>)^
  4476   4476   **
  4477   4477   ** [[SQLITE_LIMIT_FUNCTION_ARG]] ^(<dt>SQLITE_LIMIT_FUNCTION_ARG</dt>
  4478   4478   ** <dd>The maximum number of arguments on a function.</dd>)^
  4479   4479   **
  4480   4480   ** [[SQLITE_LIMIT_ATTACHED]] ^(<dt>SQLITE_LIMIT_ATTACHED</dt>
................................................................................
  4519   4519   **
  4520   4520   ** New flags may be added in future releases of SQLite.
  4521   4521   **
  4522   4522   ** <dl>
  4523   4523   ** [[SQLITE_PREPARE_PERSISTENT]] ^(<dt>SQLITE_PREPARE_PERSISTENT</dt>
  4524   4524   ** <dd>The SQLITE_PREPARE_PERSISTENT flag is a hint to the query planner
  4525   4525   ** that the prepared statement will be retained for a long time and
  4526         -** probably reused many times. ^Without this flag, [sqlite3_prepare_v3()]
         4526  +** probably reused many times.)^ ^Without this flag, [sqlite3_prepare_v3()]
  4527   4527   ** and [sqlite3_prepare16_v3()] assume that the prepared statement will 
  4528   4528   ** be used just once or at most a few times and then destroyed using
  4529   4529   ** [sqlite3_finalize()] relatively soon. The current implementation acts
  4530   4530   ** on this hint by avoiding the use of [lookaside memory] so as not to
  4531   4531   ** deplete the limited store of lookaside memory. Future versions of
  4532   4532   ** SQLite may act on this hint differently.
  4533   4533   ** </dl>
................................................................................
  4828   4828   
  4829   4829   /*
  4830   4830   ** CAPI3REF: Binding Values To Prepared Statements
  4831   4831   ** KEYWORDS: {host parameter} {host parameters} {host parameter name}
  4832   4832   ** KEYWORDS: {SQL parameter} {SQL parameters} {parameter binding}
  4833   4833   ** METHOD: sqlite3_stmt
  4834   4834   **
  4835         -** ^(In the SQL statement text input to [sqlite3_prepare_v3()] and its variants,
         4835  +** ^(In the SQL statement text input to [sqlite3_prepare_v2()] and its variants,
  4836   4836   ** literals may be replaced by a [parameter] that matches one of following
  4837   4837   ** templates:
  4838   4838   **
  4839   4839   ** <ul>
  4840   4840   ** <li>  ?
  4841   4841   ** <li>  ?NNN
  4842   4842   ** <li>  :VVV
................................................................................
  4847   4847   ** In the templates above, NNN represents an integer literal,
  4848   4848   ** and VVV represents an alphanumeric identifier.)^  ^The values of these
  4849   4849   ** parameters (also called "host parameter names" or "SQL parameters")
  4850   4850   ** can be set using the sqlite3_bind_*() routines defined here.
  4851   4851   **
  4852   4852   ** ^The first argument to the sqlite3_bind_*() routines is always
  4853   4853   ** a pointer to the [sqlite3_stmt] object returned from
  4854         -** [sqlite3_prepare_v3()] or its variants.
         4854  +** [sqlite3_prepare_v2()] or its variants.
  4855   4855   **
  4856   4856   ** ^The second argument is the index of the SQL parameter to be set.
  4857   4857   ** ^The leftmost SQL parameter has an index of 1.  ^When the same named
  4858   4858   ** SQL parameter is used more than once, second and subsequent
  4859   4859   ** occurrences have the same index as the first occurrence.
  4860   4860   ** ^The index for named parameters can be looked up using the
  4861   4861   ** [sqlite3_bind_parameter_index()] API if desired.  ^The index
................................................................................
  5330   5330   ** </table></blockquote>
  5331   5331   **
  5332   5332   ** <b>Details:</b>
  5333   5333   **
  5334   5334   ** ^These routines return information about a single column of the current
  5335   5335   ** result row of a query.  ^In every case the first argument is a pointer
  5336   5336   ** to the [prepared statement] that is being evaluated (the [sqlite3_stmt*]
  5337         -** that was returned from [sqlite3_prepare_v3()] or one of its variants)
         5337  +** that was returned from [sqlite3_prepare_v2()] or one of its variants)
  5338   5338   ** and the second argument is the index of the column for which information
  5339   5339   ** should be returned. ^The leftmost column of the result set has the index 0.
  5340   5340   ** ^The number of columns in the result can be determined using
  5341   5341   ** [sqlite3_column_count()].
  5342   5342   **
  5343   5343   ** If the SQL statement does not currently point to a valid row, or if the
  5344   5344   ** column index is out of range, the result is undefined.
................................................................................
  5764   5764   ** datatype of the value
  5765   5765   ** <tr><td><b>sqlite3_value_numeric_type&nbsp;&nbsp;</b>
  5766   5766   ** <td>&rarr;&nbsp;&nbsp;<td>Best numeric datatype of the value
  5767   5767   ** </table></blockquote>
  5768   5768   **
  5769   5769   ** <b>Details:</b>
  5770   5770   **
  5771         -** This routine extract type, size, and content information from
         5771  +** These routines extract type, size, and content information from
  5772   5772   ** [protected sqlite3_value] objects.  Protected sqlite3_value objects
  5773   5773   ** are used to pass parameter information into implementation of
  5774   5774   ** [application-defined SQL functions] and [virtual tables].
  5775   5775   **
  5776   5776   ** These routines work only with [protected sqlite3_value] objects.
  5777   5777   ** Any attempt to use these routines on an [unprotected sqlite3_value]
  5778   5778   ** is not threadsafe.
................................................................................
  6512   6512   ** CAPI3REF: Find The Database Handle Of A Prepared Statement
  6513   6513   ** METHOD: sqlite3_stmt
  6514   6514   **
  6515   6515   ** ^The sqlite3_db_handle interface returns the [database connection] handle
  6516   6516   ** to which a [prepared statement] belongs.  ^The [database connection]
  6517   6517   ** returned by sqlite3_db_handle is the same [database connection]
  6518   6518   ** that was the first argument
  6519         -** to the [sqlite3_prepare_v3()] call (or its variants) that was used to
         6519  +** to the [sqlite3_prepare_v2()] call (or its variants) that was used to
  6520   6520   ** create the statement in the first place.
  6521   6521   */
  6522   6522   SQLITE_API sqlite3 *sqlite3_db_handle(sqlite3_stmt*);
  6523   6523   
  6524   6524   /*
  6525   6525   ** CAPI3REF: Return The Filename For A Database Connection
  6526   6526   ** METHOD: sqlite3
................................................................................
  6588   6588   ** The commit and rollback hook callbacks are not reentrant.
  6589   6589   ** The callback implementation must not do anything that will modify
  6590   6590   ** the database connection that invoked the callback.  Any actions
  6591   6591   ** to modify the database connection must be deferred until after the
  6592   6592   ** completion of the [sqlite3_step()] call that triggered the commit
  6593   6593   ** or rollback hook in the first place.
  6594   6594   ** Note that running any other SQL statements, including SELECT statements,
  6595         -** or merely calling [sqlite3_prepare_v3()] and [sqlite3_step()] will modify
         6595  +** or merely calling [sqlite3_prepare_v2()] and [sqlite3_step()] will modify
  6596   6596   ** the database connections for the meaning of "modify" in this paragraph.
  6597   6597   **
  6598   6598   ** ^Registering a NULL function disables the callback.
  6599   6599   **
  6600   6600   ** ^When the commit hook callback routine returns zero, the [COMMIT]
  6601   6601   ** operation is allowed to continue normally.  ^If the commit hook
  6602   6602   ** returns non-zero, then the [COMMIT] is converted into a [ROLLBACK].
................................................................................
  6648   6648   ** The exceptions defined in this paragraph might change in a future
  6649   6649   ** release of SQLite.
  6650   6650   **
  6651   6651   ** The update hook implementation must not do anything that will modify
  6652   6652   ** the database connection that invoked the update hook.  Any actions
  6653   6653   ** to modify the database connection must be deferred until after the
  6654   6654   ** completion of the [sqlite3_step()] call that triggered the update hook.
  6655         -** Note that [sqlite3_prepare_v3()] and [sqlite3_step()] both modify their
         6655  +** Note that [sqlite3_prepare_v2()] and [sqlite3_step()] both modify their
  6656   6656   ** database connections for the meaning of "modify" in this paragraph.
  6657   6657   **
  6658   6658   ** ^The sqlite3_update_hook(D,C,P) function
  6659   6659   ** returns the P argument from the previous call
  6660   6660   ** on the same [database connection] D, or NULL for
  6661   6661   ** the first call on D.
  6662   6662   **
................................................................................
106272 106272     UNUSED_PARAMETER(NotUsed);
106273 106273     assert( i>=0 && i<ArraySize(azType) );
106274 106274     assert( SQLITE_INTEGER==1 );
106275 106275     assert( SQLITE_FLOAT==2 );
106276 106276     assert( SQLITE_TEXT==3 );
106277 106277     assert( SQLITE_BLOB==4 );
106278 106278     assert( SQLITE_NULL==5 );
       106279  +  /* EVIDENCE-OF: R-01470-60482 The sqlite3_value_type(V) interface returns
       106280  +  ** the datatype code for the initial datatype of the sqlite3_value object
       106281  +  ** V. The returned value is one of SQLITE_INTEGER, SQLITE_FLOAT,
       106282  +  ** SQLITE_TEXT, SQLITE_BLOB, or SQLITE_NULL. */
106279 106283     sqlite3_result_text(context, azType[i], -1, SQLITE_STATIC);
106280 106284   }
106281 106285   
106282 106286   
106283 106287   /*
106284 106288   ** Implementation of the length() function
106285 106289   */
................................................................................
117172 117176     sqlite3 *db,              /* Database handle. */
117173 117177     const char *zSql,         /* UTF-8 encoded SQL statement. */
117174 117178     int nBytes,               /* Length of zSql in bytes. */
117175 117179     sqlite3_stmt **ppStmt,    /* OUT: A pointer to the prepared statement */
117176 117180     const char **pzTail       /* OUT: End of parsed string */
117177 117181   ){
117178 117182     int rc;
       117183  +  /* EVIDENCE-OF: R-37923-12173 The sqlite3_prepare_v2() interface works
       117184  +  ** exactly the same as sqlite3_prepare_v3() with a zero prepFlags
       117185  +  ** parameter.
       117186  +  **
       117187  +  ** Proof in that the 5th parameter to sqlite3LockAndPrepare is 0 */
117179 117188     rc = sqlite3LockAndPrepare(db,zSql,nBytes,SQLITE_PREPARE_SAVESQL,0,
117180 117189                                ppStmt,pzTail);
117181         -  assert( rc==SQLITE_OK || ppStmt==0 || *ppStmt==0 );  /* VERIFY: F13021 */
       117190  +  assert( rc==SQLITE_OK || ppStmt==0 || *ppStmt==0 );
117182 117191     return rc;
117183 117192   }
117184 117193   SQLITE_API int sqlite3_prepare_v3(
117185 117194     sqlite3 *db,              /* Database handle. */
117186 117195     const char *zSql,         /* UTF-8 encoded SQL statement. */
117187 117196     int nBytes,               /* Length of zSql in bytes. */
117188 117197     unsigned int prepFlags,   /* Zero or more SQLITE_PREPARE_* flags */
117189 117198     sqlite3_stmt **ppStmt,    /* OUT: A pointer to the prepared statement */
117190 117199     const char **pzTail       /* OUT: End of parsed string */
117191 117200   ){
117192 117201     int rc;
       117202  +  /* EVIDENCE-OF: R-56861-42673 sqlite3_prepare_v3() differs from
       117203  +  ** sqlite3_prepare_v2() only in having the extra prepFlags parameter,
       117204  +  ** which is a bit array consisting of zero or more of the
       117205  +  ** SQLITE_PREPARE_* flags.
       117206  +  **
       117207  +  ** Proof by comparison to the implementation of sqlite3_prepare_v2()
       117208  +  ** directly above. */
117193 117209     rc = sqlite3LockAndPrepare(db,zSql,nBytes,
117194 117210                    SQLITE_PREPARE_SAVESQL|(prepFlags&SQLITE_PREPARE_MASK),
117195 117211                    0,ppStmt,pzTail);
117196         -  assert( rc==SQLITE_OK || ppStmt==0 || *ppStmt==0 );  /* VERIFY: F13021 */
       117212  +  assert( rc==SQLITE_OK || ppStmt==0 || *ppStmt==0 );
117197 117213     return rc;
117198 117214   }
117199 117215   
117200 117216   
117201 117217   #ifndef SQLITE_OMIT_UTF16
117202 117218   /*
117203 117219   ** Compile the UTF-16 encoded SQL statement zSql into a statement handle.
................................................................................
142285 142301   */
142286 142302   SQLITE_API int sqlite3_db_config(sqlite3 *db, int op, ...){
142287 142303     va_list ap;
142288 142304     int rc;
142289 142305     va_start(ap, op);
142290 142306     switch( op ){
142291 142307       case SQLITE_DBCONFIG_MAINDBNAME: {
       142308  +      /* IMP: R-06824-28531 */
       142309  +      /* IMP: R-36257-52125 */
142292 142310         db->aDb[0].zDbSName = va_arg(ap,char*);
142293 142311         rc = SQLITE_OK;
142294 142312         break;
142295 142313       }
142296 142314       case SQLITE_DBCONFIG_LOOKASIDE: {
142297 142315         void *pBuf = va_arg(ap, void*); /* IMP: R-26835-10964 */
142298 142316         int sz = va_arg(ap, int);       /* IMP: R-47871-25994 */
................................................................................
200197 200215   static void fts5SourceIdFunc(
200198 200216     sqlite3_context *pCtx,          /* Function call context */
200199 200217     int nArg,                       /* Number of args */
200200 200218     sqlite3_value **apUnused        /* Function arguments */
200201 200219   ){
200202 200220     assert( nArg==0 );
200203 200221     UNUSED_PARAM2(nArg, apUnused);
200204         -  sqlite3_result_text(pCtx, "fts5: 2017-07-13 22:39:15 889968bdbf1c258238cb68d82f059e16366c4a40c2d541dd4a1811ab72e693cb", -1, SQLITE_TRANSIENT);
       200222  +  sqlite3_result_text(pCtx, "fts5: 2017-07-15 13:49:56 47cf83a0682b7b3219cf255457f5fbe05f3c1f46be42f6bbab33b78a57a252f6", -1, SQLITE_TRANSIENT);
200205 200223   }
200206 200224   
200207 200225   static int fts5Init(sqlite3 *db){
200208 200226     static const sqlite3_module fts5Mod = {
200209 200227       /* iVersion      */ 2,
200210 200228       /* xCreate       */ fts5CreateMethod,
200211 200229       /* xConnect      */ fts5ConnectMethod,
................................................................................
204084 204102   /* #include "sqlite3ext.h" */
204085 204103   #endif
204086 204104   SQLITE_EXTENSION_INIT1
204087 204105   /* #include <assert.h> */
204088 204106   /* #include <string.h> */
204089 204107   
204090 204108   #ifndef SQLITE_OMIT_VIRTUALTABLE
204091         -
204092         -/*
204093         -** The following macros are used to cast pointers to integers.
204094         -** The way you do this varies from one compiler
204095         -** to the next, so we have developed the following set of #if statements
204096         -** to generate appropriate macros for a wide range of compilers.
204097         -*/
204098         -#if defined(__PTRDIFF_TYPE__)  /* This case should work for GCC */
204099         -# define SQLITE_PTR_TO_INT64(X)  ((sqlite3_int64)(__PTRDIFF_TYPE__)(X))
204100         -#elif !defined(__GNUC__)       /* Works for compilers other than LLVM */
204101         -# define SQLITE_PTR_TO_INT64(X)  ((sqlite3_int64)(((char*)X)-(char*)0))
204102         -#elif defined(HAVE_STDINT_H)   /* Use this case if we have ANSI headers */
204103         -# define SQLITE_PTR_TO_INT64(X)  ((sqlite3_int64)(intptr_t)(X))
204104         -#else                          /* Generates a warning - but it always works */
204105         -# define SQLITE_PTR_TO_INT64(X)  ((sqlite3_int64)(X))
204106         -#endif
204107         -
204108 204109   
204109 204110   /* stmt_vtab is a subclass of sqlite3_vtab which will
204110 204111   ** serve as the underlying representation of a stmt virtual table
204111 204112   */
204112 204113   typedef struct stmt_vtab stmt_vtab;
204113 204114   struct stmt_vtab {
204114 204115     sqlite3_vtab base;  /* Base class - must be first */
................................................................................
204147 204148     sqlite3_vtab **ppVtab,
204148 204149     char **pzErr
204149 204150   ){
204150 204151     stmt_vtab *pNew;
204151 204152     int rc;
204152 204153   
204153 204154   /* Column numbers */
204154         -#define STMT_COLUMN_PTR     0   /* Numeric value of the statement pointer */
204155         -#define STMT_COLUMN_SQL     1   /* SQL for the statement */
204156         -#define STMT_COLUMN_NCOL    2   /* Number of result columns */
204157         -#define STMT_COLUMN_RO      3   /* True if read-only */
204158         -#define STMT_COLUMN_BUSY    4   /* True if currently busy */
204159         -#define STMT_COLUMN_NSCAN   5   /* SQLITE_STMTSTATUS_FULLSCAN_STEP */
204160         -#define STMT_COLUMN_NSORT   6   /* SQLITE_STMTSTATUS_SORT */
204161         -#define STMT_COLUMN_NAIDX   7   /* SQLITE_STMTSTATUS_AUTOINDEX */
204162         -#define STMT_COLUMN_NSTEP   8   /* SQLITE_STMTSTATUS_VM_STEP */
204163         -#define STMT_COLUMN_REPREP  9   /* SQLITE_STMTSTATUS_REPREPARE */
204164         -#define STMT_COLUMN_RUN    10   /* SQLITE_STMTSTATUS_RUN */
204165         -#define STMT_COLUMN_MEM    11   /* SQLITE_STMTSTATUS_MEMUSED */
       204155  +#define STMT_COLUMN_SQL     0   /* SQL for the statement */
       204156  +#define STMT_COLUMN_NCOL    1   /* Number of result columns */
       204157  +#define STMT_COLUMN_RO      2   /* True if read-only */
       204158  +#define STMT_COLUMN_BUSY    3   /* True if currently busy */
       204159  +#define STMT_COLUMN_NSCAN   4   /* SQLITE_STMTSTATUS_FULLSCAN_STEP */
       204160  +#define STMT_COLUMN_NSORT   5   /* SQLITE_STMTSTATUS_SORT */
       204161  +#define STMT_COLUMN_NAIDX   6   /* SQLITE_STMTSTATUS_AUTOINDEX */
       204162  +#define STMT_COLUMN_NSTEP   7   /* SQLITE_STMTSTATUS_VM_STEP */
       204163  +#define STMT_COLUMN_REPREP  8   /* SQLITE_STMTSTATUS_REPREPARE */
       204164  +#define STMT_COLUMN_RUN     9   /* SQLITE_STMTSTATUS_RUN */
       204165  +#define STMT_COLUMN_MEM    10   /* SQLITE_STMTSTATUS_MEMUSED */
204166 204166   
204167 204167   
204168 204168     rc = sqlite3_declare_vtab(db,
204169         -     "CREATE TABLE x(ptr,sql,ncol,ro,busy,nscan,nsort,naidx,nstep,"
       204169  +     "CREATE TABLE x(sql,ncol,ro,busy,nscan,nsort,naidx,nstep,"
204170 204170                       "reprep,run,mem)");
204171 204171     if( rc==SQLITE_OK ){
204172 204172       pNew = sqlite3_malloc( sizeof(*pNew) );
204173 204173       *ppVtab = (sqlite3_vtab*)pNew;
204174 204174       if( pNew==0 ) return SQLITE_NOMEM;
204175 204175       memset(pNew, 0, sizeof(*pNew));
204176 204176       pNew->db = db;
................................................................................
204225 204225   static int stmtColumn(
204226 204226     sqlite3_vtab_cursor *cur,   /* The cursor */
204227 204227     sqlite3_context *ctx,       /* First argument to sqlite3_result_...() */
204228 204228     int i                       /* Which column to return */
204229 204229   ){
204230 204230     stmt_cursor *pCur = (stmt_cursor*)cur;
204231 204231     switch( i ){
204232         -    case STMT_COLUMN_PTR: {
204233         -      sqlite3_result_int64(ctx, SQLITE_PTR_TO_INT64(pCur->pStmt));
204234         -      break;
204235         -    }
204236 204232       case STMT_COLUMN_SQL: {
204237 204233         sqlite3_result_text(ctx, sqlite3_sql(pCur->pStmt), -1, SQLITE_TRANSIENT);
204238 204234         break;
204239 204235       }
204240 204236       case STMT_COLUMN_NCOL: {
204241 204237         sqlite3_result_int(ctx, sqlite3_column_count(pCur->pStmt));
204242 204238         break;
................................................................................
204350 204346   };
204351 204347   
204352 204348   #endif /* SQLITE_OMIT_VIRTUALTABLE */
204353 204349   
204354 204350   SQLITE_PRIVATE int sqlite3StmtVtabInit(sqlite3 *db){
204355 204351     int rc = SQLITE_OK;
204356 204352   #ifndef SQLITE_OMIT_VIRTUALTABLE
204357         -  rc = sqlite3_create_module(db, "stmt", &stmtModule, 0);
       204353  +  rc = sqlite3_create_module(db, "sqlite_stmt", &stmtModule, 0);
204358 204354   #endif
204359 204355     return rc;
204360 204356   }
204361 204357   
204362 204358   #ifndef SQLITE_CORE
204363 204359   #ifdef _WIN32
204364 204360   __declspec(dllexport)

Changes to src/sqlite3.h.

   119    119   **
   120    120   ** See also: [sqlite3_libversion()],
   121    121   ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
   122    122   ** [sqlite_version()] and [sqlite_source_id()].
   123    123   */
   124    124   #define SQLITE_VERSION        "3.20.0"
   125    125   #define SQLITE_VERSION_NUMBER 3020000
   126         -#define SQLITE_SOURCE_ID      "2017-07-13 22:39:15 889968bdbf1c258238cb68d82f059e16366c4a40c2d541dd4a1811ab72e693cb"
          126  +#define SQLITE_SOURCE_ID      "2017-07-15 13:49:56 47cf83a0682b7b3219cf255457f5fbe05f3c1f46be42f6bbab33b78a57a252f6"
   127    127   
   128    128   /*
   129    129   ** CAPI3REF: Run-Time Library Version Numbers
   130    130   ** KEYWORDS: sqlite3_version sqlite3_sourceid
   131    131   **
   132    132   ** These interfaces provide the same information as the [SQLITE_VERSION],
   133    133   ** [SQLITE_VERSION_NUMBER], and [SQLITE_SOURCE_ID] C preprocessor macros
................................................................................
   231    231   **
   232    232   ** Each open SQLite database is represented by a pointer to an instance of
   233    233   ** the opaque structure named "sqlite3".  It is useful to think of an sqlite3
   234    234   ** pointer as an object.  The [sqlite3_open()], [sqlite3_open16()], and
   235    235   ** [sqlite3_open_v2()] interfaces are its constructors, and [sqlite3_close()]
   236    236   ** and [sqlite3_close_v2()] are its destructors.  There are many other
   237    237   ** interfaces (such as
   238         -** [sqlite3_prepare_v3()], [sqlite3_create_function()], and
          238  +** [sqlite3_prepare_v2()], [sqlite3_create_function()], and
   239    239   ** [sqlite3_busy_timeout()] to name but three) that are methods on an
   240    240   ** sqlite3 object.
   241    241   */
   242    242   typedef struct sqlite3 sqlite3;
   243    243   
   244    244   /*
   245    245   ** CAPI3REF: 64-Bit Integer Types
................................................................................
   335    335   typedef int (*sqlite3_callback)(void*,int,char**, char**);
   336    336   
   337    337   /*
   338    338   ** CAPI3REF: One-Step Query Execution Interface
   339    339   ** METHOD: sqlite3
   340    340   **
   341    341   ** The sqlite3_exec() interface is a convenience wrapper around
   342         -** [sqlite3_prepare_v3()], [sqlite3_step()], and [sqlite3_finalize()],
          342  +** [sqlite3_prepare_v2()], [sqlite3_step()], and [sqlite3_finalize()],
   343    343   ** that allows an application to run multiple statements of SQL
   344    344   ** without having to use a lot of C code. 
   345    345   **
   346    346   ** ^The sqlite3_exec() interface runs zero or more UTF-8 encoded,
   347    347   ** semicolon-separate SQL statements passed into its 2nd argument,
   348    348   ** in the context of the [database connection] passed in as its 1st
   349    349   ** argument.  ^If the callback function of the 3rd argument to
................................................................................
  2004   2004   ** is an integer - non-zero to disable checkpoints-on-close, or zero (the
  2005   2005   ** default) to enable them. The second parameter is a pointer to an integer
  2006   2006   ** into which is written 0 or 1 to indicate whether checkpoints-on-close
  2007   2007   ** have been disabled - 0 if they are not disabled, 1 if they are.
  2008   2008   ** </dd>
  2009   2009   **
  2010   2010   ** <dt>SQLITE_DBCONFIG_ENABLE_QPSG</dt>
  2011         -** <dd>The SQLITE_DBCONFIG_ENABLE_QPSG option activates or deactivates
         2011  +** <dd>^(The SQLITE_DBCONFIG_ENABLE_QPSG option activates or deactivates
  2012   2012   ** the [query planner stability guarantee] (QPSG).  When the QPSG is active,
  2013   2013   ** a single SQL query statement will always use the same algorithm regardless
  2014         -** of values of [bound parameters].  The QPSG disables some query optimizations
         2014  +** of values of [bound parameters].)^ The QPSG disables some query optimizations
  2015   2015   ** that look at the values of bound parameters, which can make some queries
  2016   2016   ** slower.  But the QPSG has the advantage of more predictable behavior.  With
  2017   2017   ** the QPSG active, SQLite will always use the same query plan in the field as
  2018   2018   ** was used during testing in the lab.
  2019   2019   ** </dd>
  2020   2020   **
  2021   2021   ** </dl>
................................................................................
  2697   2697   ** to perform various actions, the authorizer callback is invoked to
  2698   2698   ** see if those actions are allowed.  ^The authorizer callback should
  2699   2699   ** return [SQLITE_OK] to allow the action, [SQLITE_IGNORE] to disallow the
  2700   2700   ** specific action but allow the SQL statement to continue to be
  2701   2701   ** compiled, or [SQLITE_DENY] to cause the entire SQL statement to be
  2702   2702   ** rejected with an error.  ^If the authorizer callback returns
  2703   2703   ** any value other than [SQLITE_IGNORE], [SQLITE_OK], or [SQLITE_DENY]
  2704         -** then the [sqlite3_prepare_v3()] or equivalent call that triggered
         2704  +** then the [sqlite3_prepare_v2()] or equivalent call that triggered
  2705   2705   ** the authorizer will fail with an error message.
  2706   2706   **
  2707   2707   ** When the callback returns [SQLITE_OK], that means the operation
  2708   2708   ** requested is ok.  ^When the callback returns [SQLITE_DENY], the
  2709         -** [sqlite3_prepare_v3()] or equivalent call that triggered the
         2709  +** [sqlite3_prepare_v2()] or equivalent call that triggered the
  2710   2710   ** authorizer will fail with an error message explaining that
  2711   2711   ** access is denied. 
  2712   2712   **
  2713   2713   ** ^The first parameter to the authorizer callback is a copy of the third
  2714   2714   ** parameter to the sqlite3_set_authorizer() interface. ^The second parameter
  2715   2715   ** to the callback is an integer [SQLITE_COPY | action code] that specifies
  2716   2716   ** the particular action to be authorized. ^The third through sixth parameters
................................................................................
  2753   2753   ** ^(Only a single authorizer can be in place on a database connection
  2754   2754   ** at a time.  Each call to sqlite3_set_authorizer overrides the
  2755   2755   ** previous call.)^  ^Disable the authorizer by installing a NULL callback.
  2756   2756   ** The authorizer is disabled by default.
  2757   2757   **
  2758   2758   ** The authorizer callback must not do anything that will modify
  2759   2759   ** the database connection that invoked the authorizer callback.
  2760         -** Note that [sqlite3_prepare_v3()] and [sqlite3_step()] both modify their
         2760  +** Note that [sqlite3_prepare_v2()] and [sqlite3_step()] both modify their
  2761   2761   ** database connections for the meaning of "modify" in this paragraph.
  2762   2762   **
  2763         -** ^When [sqlite3_prepare_v3()] is used to prepare a statement, the
         2763  +** ^When [sqlite3_prepare_v2()] is used to prepare a statement, the
  2764   2764   ** statement might be re-prepared during [sqlite3_step()] due to a 
  2765   2765   ** schema change.  Hence, the application should ensure that the
  2766   2766   ** correct authorizer callback remains in place during the [sqlite3_step()].
  2767   2767   **
  2768   2768   ** ^Note that the authorizer callback is invoked only during
  2769   2769   ** [sqlite3_prepare()] or its variants.  Authorization is not
  2770   2770   ** performed during statement evaluation in [sqlite3_step()], unless
  2771   2771   ** as stated in the previous paragraph, sqlite3_step() invokes
  2772         -** sqlite3_prepare_v3() to reprepare a statement after a schema change.
         2772  +** sqlite3_prepare_v2() to reprepare a statement after a schema change.
  2773   2773   */
  2774   2774   SQLITE_API int sqlite3_set_authorizer(
  2775   2775     sqlite3*,
  2776   2776     int (*xAuth)(void*,int,const char*,const char*,const char*,const char*),
  2777   2777     void *pUserData
  2778   2778   );
  2779   2779   
................................................................................
  3001   3001   **
  3002   3002   ** ^If the progress callback returns non-zero, the operation is
  3003   3003   ** interrupted.  This feature can be used to implement a
  3004   3004   ** "Cancel" button on a GUI progress dialog box.
  3005   3005   **
  3006   3006   ** The progress handler callback must not do anything that will modify
  3007   3007   ** the database connection that invoked the progress handler.
  3008         -** Note that [sqlite3_prepare_v3()] and [sqlite3_step()] both modify their
         3008  +** Note that [sqlite3_prepare_v2()] and [sqlite3_step()] both modify their
  3009   3009   ** database connections for the meaning of "modify" in this paragraph.
  3010   3010   **
  3011   3011   */
  3012   3012   SQLITE_API void sqlite3_progress_handler(sqlite3*, int, int(*)(void*), void*);
  3013   3013   
  3014   3014   /*
  3015   3015   ** CAPI3REF: Opening A New Database Connection
................................................................................
  3355   3355   ** original SQL text is source code.  A prepared statement object 
  3356   3356   ** is the compiled object code.  All SQL must be converted into a
  3357   3357   ** prepared statement before it can be run.
  3358   3358   **
  3359   3359   ** The life-cycle of a prepared statement object usually goes like this:
  3360   3360   **
  3361   3361   ** <ol>
  3362         -** <li> Create the prepared statement object using [sqlite3_prepare_v3()].
         3362  +** <li> Create the prepared statement object using [sqlite3_prepare_v2()].
  3363   3363   ** <li> Bind values to [parameters] using the sqlite3_bind_*()
  3364   3364   **      interfaces.
  3365   3365   ** <li> Run the SQL by calling [sqlite3_step()] one or more times.
  3366   3366   ** <li> Reset the prepared statement using [sqlite3_reset()] then go back
  3367   3367   **      to step 2.  Do this zero or more times.
  3368   3368   ** <li> Destroy the object using [sqlite3_finalize()].
  3369   3369   ** </ol>
................................................................................
  3437   3437   ** <dd>The maximum depth of the parse tree on any expression.</dd>)^
  3438   3438   **
  3439   3439   ** [[SQLITE_LIMIT_COMPOUND_SELECT]] ^(<dt>SQLITE_LIMIT_COMPOUND_SELECT</dt>
  3440   3440   ** <dd>The maximum number of terms in a compound SELECT statement.</dd>)^
  3441   3441   **
  3442   3442   ** [[SQLITE_LIMIT_VDBE_OP]] ^(<dt>SQLITE_LIMIT_VDBE_OP</dt>
  3443   3443   ** <dd>The maximum number of instructions in a virtual machine program
  3444         -** used to implement an SQL statement.  If [sqlite3_prepare_v3()] or
         3444  +** used to implement an SQL statement.  If [sqlite3_prepare_v2()] or
  3445   3445   ** the equivalent tries to allocate space for more than this many opcodes
  3446   3446   ** in a single prepared statement, an SQLITE_NOMEM error is returned.</dd>)^
  3447   3447   **
  3448   3448   ** [[SQLITE_LIMIT_FUNCTION_ARG]] ^(<dt>SQLITE_LIMIT_FUNCTION_ARG</dt>
  3449   3449   ** <dd>The maximum number of arguments on a function.</dd>)^
  3450   3450   **
  3451   3451   ** [[SQLITE_LIMIT_ATTACHED]] ^(<dt>SQLITE_LIMIT_ATTACHED</dt>
................................................................................
  3490   3490   **
  3491   3491   ** New flags may be added in future releases of SQLite.
  3492   3492   **
  3493   3493   ** <dl>
  3494   3494   ** [[SQLITE_PREPARE_PERSISTENT]] ^(<dt>SQLITE_PREPARE_PERSISTENT</dt>
  3495   3495   ** <dd>The SQLITE_PREPARE_PERSISTENT flag is a hint to the query planner
  3496   3496   ** that the prepared statement will be retained for a long time and
  3497         -** probably reused many times. ^Without this flag, [sqlite3_prepare_v3()]
         3497  +** probably reused many times.)^ ^Without this flag, [sqlite3_prepare_v3()]
  3498   3498   ** and [sqlite3_prepare16_v3()] assume that the prepared statement will 
  3499   3499   ** be used just once or at most a few times and then destroyed using
  3500   3500   ** [sqlite3_finalize()] relatively soon. The current implementation acts
  3501   3501   ** on this hint by avoiding the use of [lookaside memory] so as not to
  3502   3502   ** deplete the limited store of lookaside memory. Future versions of
  3503   3503   ** SQLite may act on this hint differently.
  3504   3504   ** </dl>
................................................................................
  3799   3799   
  3800   3800   /*
  3801   3801   ** CAPI3REF: Binding Values To Prepared Statements
  3802   3802   ** KEYWORDS: {host parameter} {host parameters} {host parameter name}
  3803   3803   ** KEYWORDS: {SQL parameter} {SQL parameters} {parameter binding}
  3804   3804   ** METHOD: sqlite3_stmt
  3805   3805   **
  3806         -** ^(In the SQL statement text input to [sqlite3_prepare_v3()] and its variants,
         3806  +** ^(In the SQL statement text input to [sqlite3_prepare_v2()] and its variants,
  3807   3807   ** literals may be replaced by a [parameter] that matches one of following
  3808   3808   ** templates:
  3809   3809   **
  3810   3810   ** <ul>
  3811   3811   ** <li>  ?
  3812   3812   ** <li>  ?NNN
  3813   3813   ** <li>  :VVV
................................................................................
  3818   3818   ** In the templates above, NNN represents an integer literal,
  3819   3819   ** and VVV represents an alphanumeric identifier.)^  ^The values of these
  3820   3820   ** parameters (also called "host parameter names" or "SQL parameters")
  3821   3821   ** can be set using the sqlite3_bind_*() routines defined here.
  3822   3822   **
  3823   3823   ** ^The first argument to the sqlite3_bind_*() routines is always
  3824   3824   ** a pointer to the [sqlite3_stmt] object returned from
  3825         -** [sqlite3_prepare_v3()] or its variants.
         3825  +** [sqlite3_prepare_v2()] or its variants.
  3826   3826   **
  3827   3827   ** ^The second argument is the index of the SQL parameter to be set.
  3828   3828   ** ^The leftmost SQL parameter has an index of 1.  ^When the same named
  3829   3829   ** SQL parameter is used more than once, second and subsequent
  3830   3830   ** occurrences have the same index as the first occurrence.
  3831   3831   ** ^The index for named parameters can be looked up using the
  3832   3832   ** [sqlite3_bind_parameter_index()] API if desired.  ^The index
................................................................................
  4301   4301   ** </table></blockquote>
  4302   4302   **
  4303   4303   ** <b>Details:</b>
  4304   4304   **
  4305   4305   ** ^These routines return information about a single column of the current
  4306   4306   ** result row of a query.  ^In every case the first argument is a pointer
  4307   4307   ** to the [prepared statement] that is being evaluated (the [sqlite3_stmt*]
  4308         -** that was returned from [sqlite3_prepare_v3()] or one of its variants)
         4308  +** that was returned from [sqlite3_prepare_v2()] or one of its variants)
  4309   4309   ** and the second argument is the index of the column for which information
  4310   4310   ** should be returned. ^The leftmost column of the result set has the index 0.
  4311   4311   ** ^The number of columns in the result can be determined using
  4312   4312   ** [sqlite3_column_count()].
  4313   4313   **
  4314   4314   ** If the SQL statement does not currently point to a valid row, or if the
  4315   4315   ** column index is out of range, the result is undefined.
................................................................................
  4735   4735   ** datatype of the value
  4736   4736   ** <tr><td><b>sqlite3_value_numeric_type&nbsp;&nbsp;</b>
  4737   4737   ** <td>&rarr;&nbsp;&nbsp;<td>Best numeric datatype of the value
  4738   4738   ** </table></blockquote>
  4739   4739   **
  4740   4740   ** <b>Details:</b>
  4741   4741   **
  4742         -** This routine extract type, size, and content information from
         4742  +** These routines extract type, size, and content information from
  4743   4743   ** [protected sqlite3_value] objects.  Protected sqlite3_value objects
  4744   4744   ** are used to pass parameter information into implementation of
  4745   4745   ** [application-defined SQL functions] and [virtual tables].
  4746   4746   **
  4747   4747   ** These routines work only with [protected sqlite3_value] objects.
  4748   4748   ** Any attempt to use these routines on an [unprotected sqlite3_value]
  4749   4749   ** is not threadsafe.
................................................................................
  5483   5483   ** CAPI3REF: Find The Database Handle Of A Prepared Statement
  5484   5484   ** METHOD: sqlite3_stmt
  5485   5485   **
  5486   5486   ** ^The sqlite3_db_handle interface returns the [database connection] handle
  5487   5487   ** to which a [prepared statement] belongs.  ^The [database connection]
  5488   5488   ** returned by sqlite3_db_handle is the same [database connection]
  5489   5489   ** that was the first argument
  5490         -** to the [sqlite3_prepare_v3()] call (or its variants) that was used to
         5490  +** to the [sqlite3_prepare_v2()] call (or its variants) that was used to
  5491   5491   ** create the statement in the first place.
  5492   5492   */
  5493   5493   SQLITE_API sqlite3 *sqlite3_db_handle(sqlite3_stmt*);
  5494   5494   
  5495   5495   /*
  5496   5496   ** CAPI3REF: Return The Filename For A Database Connection
  5497   5497   ** METHOD: sqlite3
................................................................................
  5559   5559   ** The commit and rollback hook callbacks are not reentrant.
  5560   5560   ** The callback implementation must not do anything that will modify
  5561   5561   ** the database connection that invoked the callback.  Any actions
  5562   5562   ** to modify the database connection must be deferred until after the
  5563   5563   ** completion of the [sqlite3_step()] call that triggered the commit
  5564   5564   ** or rollback hook in the first place.
  5565   5565   ** Note that running any other SQL statements, including SELECT statements,
  5566         -** or merely calling [sqlite3_prepare_v3()] and [sqlite3_step()] will modify
         5566  +** or merely calling [sqlite3_prepare_v2()] and [sqlite3_step()] will modify
  5567   5567   ** the database connections for the meaning of "modify" in this paragraph.
  5568   5568   **
  5569   5569   ** ^Registering a NULL function disables the callback.
  5570   5570   **
  5571   5571   ** ^When the commit hook callback routine returns zero, the [COMMIT]
  5572   5572   ** operation is allowed to continue normally.  ^If the commit hook
  5573   5573   ** returns non-zero, then the [COMMIT] is converted into a [ROLLBACK].
................................................................................
  5619   5619   ** The exceptions defined in this paragraph might change in a future
  5620   5620   ** release of SQLite.
  5621   5621   **
  5622   5622   ** The update hook implementation must not do anything that will modify
  5623   5623   ** the database connection that invoked the update hook.  Any actions
  5624   5624   ** to modify the database connection must be deferred until after the
  5625   5625   ** completion of the [sqlite3_step()] call that triggered the update hook.
  5626         -** Note that [sqlite3_prepare_v3()] and [sqlite3_step()] both modify their
         5626  +** Note that [sqlite3_prepare_v2()] and [sqlite3_step()] both modify their
  5627   5627   ** database connections for the meaning of "modify" in this paragraph.
  5628   5628   **
  5629   5629   ** ^The sqlite3_update_hook(D,C,P) function
  5630   5630   ** returns the P argument from the previous call
  5631   5631   ** on the same [database connection] D, or NULL for
  5632   5632   ** the first call on D.
  5633   5633   **