1
0
Fork 0
mirror of https://github.com/DBD-SQLite/DBD-SQLite synced 2025-06-07 14:19:10 -04:00

updated SQLite to 3.8.0

This commit is contained in:
Kenichi Ishigaki 2013-08-27 11:58:28 +09:00
parent a7b6c5759b
commit 5abe471ec2
3 changed files with 4840 additions and 3907 deletions

8612
sqlite3.c

File diff suppressed because it is too large Load diff

120
sqlite3.h
View file

@ -107,9 +107,9 @@ extern "C" {
** [sqlite3_libversion_number()], [sqlite3_sourceid()], ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
** [sqlite_version()] and [sqlite_source_id()]. ** [sqlite_version()] and [sqlite_source_id()].
*/ */
#define SQLITE_VERSION "3.7.17" #define SQLITE_VERSION "3.8.0"
#define SQLITE_VERSION_NUMBER 3007017 #define SQLITE_VERSION_NUMBER 3008000
#define SQLITE_SOURCE_ID "2013-05-20 00:56:22 118a3b35693b134d56ebd780123b7fd6f1497668" #define SQLITE_SOURCE_ID "2013-08-26 04:50:08 f64cd21e2e23ed7cff48f7dafa5e76adde9321c2"
/* /*
** CAPI3REF: Run-Time Library Version Numbers ** CAPI3REF: Run-Time Library Version Numbers
@ -478,8 +478,10 @@ SQLITE_API int sqlite3_exec(
#define SQLITE_IOERR_SEEK (SQLITE_IOERR | (22<<8)) #define SQLITE_IOERR_SEEK (SQLITE_IOERR | (22<<8))
#define SQLITE_IOERR_DELETE_NOENT (SQLITE_IOERR | (23<<8)) #define SQLITE_IOERR_DELETE_NOENT (SQLITE_IOERR | (23<<8))
#define SQLITE_IOERR_MMAP (SQLITE_IOERR | (24<<8)) #define SQLITE_IOERR_MMAP (SQLITE_IOERR | (24<<8))
#define SQLITE_IOERR_GETTEMPPATH (SQLITE_IOERR | (25<<8))
#define SQLITE_LOCKED_SHAREDCACHE (SQLITE_LOCKED | (1<<8)) #define SQLITE_LOCKED_SHAREDCACHE (SQLITE_LOCKED | (1<<8))
#define SQLITE_BUSY_RECOVERY (SQLITE_BUSY | (1<<8)) #define SQLITE_BUSY_RECOVERY (SQLITE_BUSY | (1<<8))
#define SQLITE_BUSY_SNAPSHOT (SQLITE_BUSY | (2<<8))
#define SQLITE_CANTOPEN_NOTEMPDIR (SQLITE_CANTOPEN | (1<<8)) #define SQLITE_CANTOPEN_NOTEMPDIR (SQLITE_CANTOPEN | (1<<8))
#define SQLITE_CANTOPEN_ISDIR (SQLITE_CANTOPEN | (2<<8)) #define SQLITE_CANTOPEN_ISDIR (SQLITE_CANTOPEN | (2<<8))
#define SQLITE_CANTOPEN_FULLPATH (SQLITE_CANTOPEN | (3<<8)) #define SQLITE_CANTOPEN_FULLPATH (SQLITE_CANTOPEN | (3<<8))
@ -499,6 +501,7 @@ SQLITE_API int sqlite3_exec(
#define SQLITE_CONSTRAINT_VTAB (SQLITE_CONSTRAINT | (9<<8)) #define SQLITE_CONSTRAINT_VTAB (SQLITE_CONSTRAINT | (9<<8))
#define SQLITE_NOTICE_RECOVER_WAL (SQLITE_NOTICE | (1<<8)) #define SQLITE_NOTICE_RECOVER_WAL (SQLITE_NOTICE | (1<<8))
#define SQLITE_NOTICE_RECOVER_ROLLBACK (SQLITE_NOTICE | (2<<8)) #define SQLITE_NOTICE_RECOVER_ROLLBACK (SQLITE_NOTICE | (2<<8))
#define SQLITE_WARNING_AUTOINDEX (SQLITE_WARNING | (1<<8))
/* /*
** CAPI3REF: Flags For File Open Operations ** CAPI3REF: Flags For File Open Operations
@ -2557,9 +2560,10 @@ SQLITE_API SQLITE_EXPERIMENTAL void *sqlite3_profile(sqlite3*,
** interface is to keep a GUI updated during a large query. ** interface is to keep a GUI updated during a large query.
** **
** ^The parameter P is passed through as the only parameter to the ** ^The parameter P is passed through as the only parameter to the
** callback function X. ^The parameter N is the number of ** callback function X. ^The parameter N is the approximate number of
** [virtual machine instructions] that are evaluated between successive ** [virtual machine instructions] that are evaluated between successive
** invocations of the callback X. ** invocations of the callback X. ^If N is less than one then the progress
** handler is disabled.
** **
** ^Only a single progress handler may be defined at one time per ** ^Only a single progress handler may be defined at one time per
** [database connection]; setting a new progress handler cancels the ** [database connection]; setting a new progress handler cancels the
@ -4179,41 +4183,49 @@ SQLITE_API sqlite3 *sqlite3_context_db_handle(sqlite3_context*);
/* /*
** CAPI3REF: Function Auxiliary Data ** CAPI3REF: Function Auxiliary Data
** **
** The following two functions may be used by scalar SQL functions to ** These functions may be used by (non-aggregate) SQL functions to
** associate metadata with argument values. If the same value is passed to ** associate metadata with argument values. If the same value is passed to
** multiple invocations of the same SQL function during query execution, under ** multiple invocations of the same SQL function during query execution, under
** some circumstances the associated metadata may be preserved. This may ** some circumstances the associated metadata may be preserved. An example
** be used, for example, to add a regular-expression matching scalar ** of where this might be useful is in a regular-expression matching
** function. The compiled version of the regular expression is stored as ** function. The compiled version of the regular expression can be stored as
** metadata associated with the SQL value passed as the regular expression ** metadata associated with the pattern string.
** pattern. The compiled regular expression can be reused on multiple ** Then as long as the pattern string remains the same,
** invocations of the same function so that the original pattern string ** the compiled regular expression can be reused on multiple
** does not need to be recompiled on each invocation. ** invocations of the same function.
** **
** ^The sqlite3_get_auxdata() interface returns a pointer to the metadata ** ^The sqlite3_get_auxdata() interface returns a pointer to the metadata
** associated by the sqlite3_set_auxdata() function with the Nth argument ** associated by the sqlite3_set_auxdata() function with the Nth argument
** value to the application-defined function. ^If no metadata has been ever ** value to the application-defined function. ^If there is no metadata
** been set for the Nth argument of the function, or if the corresponding ** associated with the function argument, this sqlite3_get_auxdata() interface
** function parameter has changed since the meta-data was set, ** returns a NULL pointer.
** then sqlite3_get_auxdata() returns a NULL pointer.
** **
** ^The sqlite3_set_auxdata() interface saves the metadata ** ^The sqlite3_set_auxdata(C,N,P,X) interface saves P as metadata for the N-th
** pointed to by its 3rd parameter as the metadata for the N-th ** argument of the application-defined function. ^Subsequent
** argument of the application-defined function. Subsequent ** calls to sqlite3_get_auxdata(C,N) return P from the most recent
** calls to sqlite3_get_auxdata() might return this data, if it has ** sqlite3_set_auxdata(C,N,P,X) call if the metadata is still valid or
** not been destroyed. ** NULL if the metadata has been discarded.
** ^If it is not NULL, SQLite will invoke the destructor ** ^After each call to sqlite3_set_auxdata(C,N,P,X) where X is not NULL,
** function given by the 4th parameter to sqlite3_set_auxdata() on ** SQLite will invoke the destructor function X with parameter P exactly
** the metadata when the corresponding function parameter changes ** once, when the metadata is discarded.
** or when the SQL statement completes, whichever comes first. ** SQLite is free to discard the metadata at any time, including: <ul>
** <li> when the corresponding function parameter changes, or
** <li> when [sqlite3_reset()] or [sqlite3_finalize()] is called for the
** SQL statement, or
** <li> when sqlite3_set_auxdata() is invoked again on the same parameter, or
** <li> during the original sqlite3_set_auxdata() call when a memory
** allocation error occurs. </ul>)^
** **
** SQLite is free to call the destructor and drop metadata on any ** Note the last bullet in particular. The destructor X in
** parameter of any function at any time. ^The only guarantee is that ** sqlite3_set_auxdata(C,N,P,X) might be called immediately, before the
** the destructor will be called before the metadata is dropped. ** sqlite3_set_auxdata() interface even returns. Hence sqlite3_set_auxdata()
** should be called near the end of the function implementation and the
** function implementation should not make any use of P after
** sqlite3_set_auxdata() has been called.
** **
** ^(In practice, metadata is preserved between function calls for ** ^(In practice, metadata is preserved between function calls for
** expressions that are constant at compile time. This includes literal ** function parameters that are compile-time constants, including literal
** values and [parameters].)^ ** values and [parameters] and expressions composed from the same.)^
** **
** These routines must be called from the same thread in which ** These routines must be called from the same thread in which
** the SQL function is running. ** the SQL function is running.
@ -4518,6 +4530,11 @@ SQLITE_API int sqlite3_key(
sqlite3 *db, /* Database to be rekeyed */ sqlite3 *db, /* Database to be rekeyed */
const void *pKey, int nKey /* The key */ const void *pKey, int nKey /* The key */
); );
SQLITE_API int sqlite3_key_v2(
sqlite3 *db, /* Database to be rekeyed */
const char *zDbName, /* Name of the database */
const void *pKey, int nKey /* The key */
);
/* /*
** Change the key on an open database. If the current database is not ** Change the key on an open database. If the current database is not
@ -4531,6 +4548,11 @@ SQLITE_API int sqlite3_rekey(
sqlite3 *db, /* Database to be rekeyed */ sqlite3 *db, /* Database to be rekeyed */
const void *pKey, int nKey /* The new key */ const void *pKey, int nKey /* The new key */
); );
SQLITE_API int sqlite3_rekey_v2(
sqlite3 *db, /* Database to be rekeyed */
const char *zDbName, /* Name of the database */
const void *pKey, int nKey /* The new key */
);
/* /*
** Specify the activation key for a SEE database. Unless ** Specify the activation key for a SEE database. Unless
@ -5116,10 +5138,23 @@ SQLITE_API int sqlite3_enable_load_extension(sqlite3 *db, int onoff);
** on the list of automatic extensions is a harmless no-op. ^No entry point ** on the list of automatic extensions is a harmless no-op. ^No entry point
** will be called more than once for each database connection that is opened. ** will be called more than once for each database connection that is opened.
** **
** See also: [sqlite3_reset_auto_extension()]. ** See also: [sqlite3_reset_auto_extension()]
** and [sqlite3_cancel_auto_extension()]
*/ */
SQLITE_API int sqlite3_auto_extension(void (*xEntryPoint)(void)); SQLITE_API int sqlite3_auto_extension(void (*xEntryPoint)(void));
/*
** CAPI3REF: Cancel Automatic Extension Loading
**
** ^The [sqlite3_cancel_auto_extension(X)] interface unregisters the
** initialization routine X that was registered using a prior call to
** [sqlite3_auto_extension(X)]. ^The [sqlite3_cancel_auto_extension(X)]
** routine returns 1 if initialization routine X was successfully
** unregistered and it returns 0 if X was not on the list of initialization
** routines.
*/
SQLITE_API int sqlite3_cancel_auto_extension(void (*xEntryPoint)(void));
/* /*
** CAPI3REF: Reset Automatic Extension Loading ** CAPI3REF: Reset Automatic Extension Loading
** **
@ -6232,6 +6267,12 @@ SQLITE_API int sqlite3_db_status(sqlite3*, int op, int *pCur, int *pHiwtr, int r
** on subsequent SQLITE_DBSTATUS_CACHE_WRITE requests is undefined.)^ ^The ** on subsequent SQLITE_DBSTATUS_CACHE_WRITE requests is undefined.)^ ^The
** highwater mark associated with SQLITE_DBSTATUS_CACHE_WRITE is always 0. ** highwater mark associated with SQLITE_DBSTATUS_CACHE_WRITE is always 0.
** </dd> ** </dd>
**
** [[SQLITE_DBSTATUS_DEFERRED_FKS]] ^(<dt>SQLITE_DBSTATUS_DEFERRED_FKS</dt>
** <dd>This parameter returns zero for the current value if and only if
** all foreign key constraints (deferred or immediate) have been
** resolved.)^ ^The highwater mark is always 0.
** </dd>
** </dl> ** </dl>
*/ */
#define SQLITE_DBSTATUS_LOOKASIDE_USED 0 #define SQLITE_DBSTATUS_LOOKASIDE_USED 0
@ -6244,7 +6285,8 @@ SQLITE_API int sqlite3_db_status(sqlite3*, int op, int *pCur, int *pHiwtr, int r
#define SQLITE_DBSTATUS_CACHE_HIT 7 #define SQLITE_DBSTATUS_CACHE_HIT 7
#define SQLITE_DBSTATUS_CACHE_MISS 8 #define SQLITE_DBSTATUS_CACHE_MISS 8
#define SQLITE_DBSTATUS_CACHE_WRITE 9 #define SQLITE_DBSTATUS_CACHE_WRITE 9
#define SQLITE_DBSTATUS_MAX 9 /* Largest defined DBSTATUS */ #define SQLITE_DBSTATUS_DEFERRED_FKS 10
#define SQLITE_DBSTATUS_MAX 10 /* Largest defined DBSTATUS */
/* /*
@ -6298,11 +6340,21 @@ SQLITE_API int sqlite3_stmt_status(sqlite3_stmt*, int op,int resetFlg);
** A non-zero value in this counter may indicate an opportunity to ** A non-zero value in this counter may indicate an opportunity to
** improvement performance by adding permanent indices that do not ** improvement performance by adding permanent indices that do not
** need to be reinitialized each time the statement is run.</dd> ** need to be reinitialized each time the statement is run.</dd>
**
** [[SQLITE_STMTSTATUS_VM_STEP]] <dt>SQLITE_STMTSTATUS_VM_STEP</dt>
** <dd>^This is the number of virtual machine operations executed
** by the prepared statement if that number is less than or equal
** to 2147483647. The number of virtual machine operations can be
** used as a proxy for the total work done by the prepared statement.
** If the number of virtual machine operations exceeds 2147483647
** then the value returned by this statement status code is undefined.
** </dd>
** </dl> ** </dl>
*/ */
#define SQLITE_STMTSTATUS_FULLSCAN_STEP 1 #define SQLITE_STMTSTATUS_FULLSCAN_STEP 1
#define SQLITE_STMTSTATUS_SORT 2 #define SQLITE_STMTSTATUS_SORT 2
#define SQLITE_STMTSTATUS_AUTOINDEX 3 #define SQLITE_STMTSTATUS_AUTOINDEX 3
#define SQLITE_STMTSTATUS_VM_STEP 4
/* /*
** CAPI3REF: Custom Page Cache Object ** CAPI3REF: Custom Page Cache Object
@ -7181,7 +7233,7 @@ SQLITE_API int sqlite3_vtab_on_conflict(sqlite3 *);
#ifdef __cplusplus #ifdef __cplusplus
} /* End of the 'extern "C"' block */ } /* End of the 'extern "C"' block */
#endif #endif
#endif #endif /* _SQLITE3_H_ */
/* /*
** 2010 August 30 ** 2010 August 30

View file

@ -474,11 +474,14 @@ struct sqlite3_api_routines {
** extension */ ** extension */
# define SQLITE_EXTENSION_INIT1 const sqlite3_api_routines *sqlite3_api=0; # define SQLITE_EXTENSION_INIT1 const sqlite3_api_routines *sqlite3_api=0;
# define SQLITE_EXTENSION_INIT2(v) sqlite3_api=v; # define SQLITE_EXTENSION_INIT2(v) sqlite3_api=v;
# define SQLITE_EXTENSION_INIT3 \
extern const sqlite3_api_routines *sqlite3_api;
#else #else
/* This case when the file is being statically linked into the /* This case when the file is being statically linked into the
** application */ ** application */
# define SQLITE_EXTENSION_INIT1 /*no-op*/ # define SQLITE_EXTENSION_INIT1 /*no-op*/
# define SQLITE_EXTENSION_INIT2(v) (void)v; /* unused parameter */ # define SQLITE_EXTENSION_INIT2(v) (void)v; /* unused parameter */
# define SQLITE_EXTENSION_INIT3 /*no-op*/
#endif #endif
#endif /* _SQLITE3EXT_H_ */ #endif /* _SQLITE3EXT_H_ */