1
0
Fork 0
mirror of https://github.com/DBD-SQLite/DBD-SQLite synced 2025-06-07 22:28:47 -04:00

DBD::SQLite - update bundled SQLite to 3.7.1

This commit is contained in:
Darren Duncan 2010-08-23 19:54:19 +00:00
parent 382849f39b
commit 5f2903b2e2
3 changed files with 2949 additions and 1965 deletions

View file

@ -1,7 +1,7 @@
Changes for Perl extension DBD-SQLite Changes for Perl extension DBD-SQLite
1.30_04 to be released 1.30_04 to be released
- Updated to SQLite 3.7.0.1 (DUNCAND) - Updated to SQLite 3.7.1 (DUNCAND)
- Added support for FTS3 tokenizers written in Perl. Added tests - Added support for FTS3 tokenizers written in Perl. Added tests
and documentation on how to use FTS3. Changed compilation flag and documentation on how to use FTS3. Changed compilation flag
to use the recommanded -DSQLITE_ENABLE_FTS3_PARENTHESIS to use the recommanded -DSQLITE_ENABLE_FTS3_PARENTHESIS

4550
sqlite3.c

File diff suppressed because it is too large Load diff

View file

@ -97,7 +97,7 @@ extern "C" {
** **
** Since version 3.6.18, SQLite source code has been stored in the ** Since version 3.6.18, SQLite source code has been stored in the
** <a href="http://www.fossil-scm.org/">Fossil configuration management ** <a href="http://www.fossil-scm.org/">Fossil configuration management
** system</a>. ^The SQLITE_SOURCE_ID macro evalutes to ** system</a>. ^The SQLITE_SOURCE_ID macro evaluates to
** a string which identifies a particular check-in of SQLite ** a string which identifies a particular check-in of SQLite
** within its configuration management system. ^The SQLITE_SOURCE_ID ** within its configuration management system. ^The SQLITE_SOURCE_ID
** string contains the date and time of the check-in (UTC) and an SHA1 ** string contains the date and time of the check-in (UTC) and an SHA1
@ -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.0.1" #define SQLITE_VERSION "3.7.1"
#define SQLITE_VERSION_NUMBER 3007000 #define SQLITE_VERSION_NUMBER 3007001
#define SQLITE_SOURCE_ID "2010-08-04 12:31:11 042a1abb030a0711386add7eb6e10832cc8b0f57" #define SQLITE_SOURCE_ID "2010-08-21 16:01:46 3613b0695a5e990905ab146fadcab34dd04d5874"
/* /*
** CAPI3REF: Run-Time Library Version Numbers ** CAPI3REF: Run-Time Library Version Numbers
@ -154,7 +154,7 @@ SQLITE_API int sqlite3_libversion_number(void);
** compile time. ^The SQLITE_ prefix may be omitted from the ** compile time. ^The SQLITE_ prefix may be omitted from the
** option name passed to sqlite3_compileoption_used(). ** option name passed to sqlite3_compileoption_used().
** **
** ^The sqlite3_compileoption_get() function allows interating ** ^The sqlite3_compileoption_get() function allows iterating
** over the list of options that were defined at compile time by ** over the list of options that were defined at compile time by
** returning the N-th compile time option string. ^If N is out of range, ** returning the N-th compile time option string. ^If N is out of range,
** sqlite3_compileoption_get() returns a NULL pointer. ^The SQLITE_ ** sqlite3_compileoption_get() returns a NULL pointer. ^The SQLITE_
@ -162,7 +162,7 @@ SQLITE_API int sqlite3_libversion_number(void);
** sqlite3_compileoption_get(). ** sqlite3_compileoption_get().
** **
** ^Support for the diagnostic functions sqlite3_compileoption_used() ** ^Support for the diagnostic functions sqlite3_compileoption_used()
** and sqlite3_compileoption_get() may be omitted by specifing the ** and sqlite3_compileoption_get() may be omitted by specifying the
** [SQLITE_OMIT_COMPILEOPTION_DIAGS] option at compile time. ** [SQLITE_OMIT_COMPILEOPTION_DIAGS] option at compile time.
** **
** See also: SQL functions [sqlite_compileoption_used()] and ** See also: SQL functions [sqlite_compileoption_used()] and
@ -268,7 +268,7 @@ typedef sqlite_uint64 sqlite3_uint64;
** **
** ^The sqlite3_close() routine is the destructor for the [sqlite3] object. ** ^The sqlite3_close() routine is the destructor for the [sqlite3] object.
** ^Calls to sqlite3_close() return SQLITE_OK if the [sqlite3] object is ** ^Calls to sqlite3_close() return SQLITE_OK if the [sqlite3] object is
** successfullly destroyed and all associated resources are deallocated. ** successfully destroyed and all associated resources are deallocated.
** **
** Applications must [sqlite3_finalize | finalize] all [prepared statements] ** Applications must [sqlite3_finalize | finalize] all [prepared statements]
** and [sqlite3_blob_close | close] all [BLOB handles] associated with ** and [sqlite3_blob_close | close] all [BLOB handles] associated with
@ -695,12 +695,21 @@ struct sqlite3_io_methods {
** is often close. The underlying VFS might choose to preallocate database ** is often close. The underlying VFS might choose to preallocate database
** file space based on this hint in order to help writes to the database ** file space based on this hint in order to help writes to the database
** file run faster. ** file run faster.
**
** The [SQLITE_FCNTL_CHUNK_SIZE] opcode is used to request that the VFS
** extends and truncates the database file in chunks of a size specified
** by the user. The fourth argument to [sqlite3_file_control()] should
** point to an integer (type int) containing the new chunk-size to use
** for the nominated database. Allocating database file space in large
** chunks (say 1MB at a time), may reduce file-system fragmentation and
** improve performance on some systems.
*/ */
#define SQLITE_FCNTL_LOCKSTATE 1 #define SQLITE_FCNTL_LOCKSTATE 1
#define SQLITE_GET_LOCKPROXYFILE 2 #define SQLITE_GET_LOCKPROXYFILE 2
#define SQLITE_SET_LOCKPROXYFILE 3 #define SQLITE_SET_LOCKPROXYFILE 3
#define SQLITE_LAST_ERRNO 4 #define SQLITE_LAST_ERRNO 4
#define SQLITE_FCNTL_SIZE_HINT 5 #define SQLITE_FCNTL_SIZE_HINT 5
#define SQLITE_FCNTL_CHUNK_SIZE 6
/* /*
** CAPI3REF: Mutex Handle ** CAPI3REF: Mutex Handle
@ -2176,7 +2185,13 @@ SQLITE_API int sqlite3_set_authorizer(
** ^The callback function registered by sqlite3_profile() is invoked ** ^The callback function registered by sqlite3_profile() is invoked
** as each SQL statement finishes. ^The profile callback contains ** as each SQL statement finishes. ^The profile callback contains
** the original statement text and an estimate of wall-clock time ** the original statement text and an estimate of wall-clock time
** of how long that statement took to run. ** of how long that statement took to run. ^The profile callback
** time is in units of nanoseconds, however the current implementation
** is only capable of millisecond resolution so the six least significant
** digits in the time are meaningless. Future versions of SQLite
** might provide greater resolution on the profiler callback. The
** sqlite3_profile() function is considered experimental and is
** subject to change in future versions of SQLite.
*/ */
SQLITE_API void *sqlite3_trace(sqlite3*, void(*xTrace)(void*,const char*), void*); SQLITE_API void *sqlite3_trace(sqlite3*, void(*xTrace)(void*,const char*), void*);
SQLITE_API SQLITE_EXPERIMENTAL void *sqlite3_profile(sqlite3*, SQLITE_API SQLITE_EXPERIMENTAL void *sqlite3_profile(sqlite3*,
@ -2657,7 +2672,7 @@ typedef struct sqlite3_context sqlite3_context;
** </ul> ** </ul>
** **
** In the templates above, NNN represents an integer literal, ** In the templates above, NNN represents an integer literal,
** and VVV represents an alphanumeric identifer.)^ ^The values of these ** and VVV represents an alphanumeric identifier.)^ ^The values of these
** parameters (also called "host parameter names" or "SQL parameters") ** parameters (also called "host parameter names" or "SQL parameters")
** can be set using the sqlite3_bind_*() routines defined here. ** can be set using the sqlite3_bind_*() routines defined here.
** **
@ -3436,7 +3451,7 @@ SQLITE_API int sqlite3_value_numeric_type(sqlite3_value*);
/* /*
** CAPI3REF: Obtain Aggregate Function Context ** CAPI3REF: Obtain Aggregate Function Context
** **
** Implementions of aggregate SQL functions use this ** Implementations of aggregate SQL functions use this
** routine to allocate memory for storing their state. ** routine to allocate memory for storing their state.
** **
** ^The first time the sqlite3_aggregate_context(C,N) routine is called ** ^The first time the sqlite3_aggregate_context(C,N) routine is called
@ -4325,7 +4340,8 @@ struct sqlite3_module {
** CAPI3REF: Virtual Table Indexing Information ** CAPI3REF: Virtual Table Indexing Information
** KEYWORDS: sqlite3_index_info ** KEYWORDS: sqlite3_index_info
** **
** The sqlite3_index_info structure and its substructures is used to ** The sqlite3_index_info structure and its substructures is used as part
** of the [virtual table] interface to
** pass information into and receive the reply from the [xBestIndex] ** pass information into and receive the reply from the [xBestIndex]
** method of a [virtual table module]. The fields under **Inputs** are the ** method of a [virtual table module]. The fields under **Inputs** are the
** inputs to xBestIndex and are read-only. xBestIndex inserts its ** inputs to xBestIndex and are read-only. xBestIndex inserts its
@ -4333,10 +4349,12 @@ struct sqlite3_module {
** **
** ^(The aConstraint[] array records WHERE clause constraints of the form: ** ^(The aConstraint[] array records WHERE clause constraints of the form:
** **
** <pre>column OP expr</pre> ** <blockquote>column OP expr</blockquote>
** **
** where OP is =, &lt;, &lt;=, &gt;, or &gt;=.)^ ^(The particular operator is ** where OP is =, &lt;, &lt;=, &gt;, or &gt;=.)^ ^(The particular operator is
** stored in aConstraint[].op.)^ ^(The index of the column is stored in ** stored in aConstraint[].op using one of the
** [SQLITE_INDEX_CONSTRAINT_EQ | SQLITE_INDEX_CONSTRAINT_ values].)^
** ^(The index of the column is stored in
** aConstraint[].iColumn.)^ ^(aConstraint[].usable is TRUE if the ** aConstraint[].iColumn.)^ ^(aConstraint[].usable is TRUE if the
** expr on the right-hand side can be evaluated (and thus the constraint ** expr on the right-hand side can be evaluated (and thus the constraint
** is usable) and false if it cannot.)^ ** is usable) and false if it cannot.)^
@ -4396,6 +4414,15 @@ struct sqlite3_index_info {
int orderByConsumed; /* True if output is already ordered */ int orderByConsumed; /* True if output is already ordered */
double estimatedCost; /* Estimated cost of using this index */ double estimatedCost; /* Estimated cost of using this index */
}; };
/*
** CAPI3REF: Virtual Table Constraint Operator Codes
**
** These macros defined the allowed values for the
** [sqlite3_index_info].aConstraint[].op field. Each value represents
** an operator that is part of a constraint term in the wHERE clause of
** a query that uses a [virtual table].
*/
#define SQLITE_INDEX_CONSTRAINT_EQ 2 #define SQLITE_INDEX_CONSTRAINT_EQ 2
#define SQLITE_INDEX_CONSTRAINT_GT 4 #define SQLITE_INDEX_CONSTRAINT_GT 4
#define SQLITE_INDEX_CONSTRAINT_LE 8 #define SQLITE_INDEX_CONSTRAINT_LE 8
@ -4914,7 +4941,7 @@ SQLITE_API void sqlite3_mutex_leave(sqlite3_mutex*);
** it is passed a NULL pointer). ** it is passed a NULL pointer).
** **
** The xMutexInit() method must be threadsafe. ^It must be harmless to ** The xMutexInit() method must be threadsafe. ^It must be harmless to
** invoke xMutexInit() mutiple times within the same process and without ** invoke xMutexInit() multiple times within the same process and without
** intervening calls to xMutexEnd(). Second and subsequent calls to ** intervening calls to xMutexEnd(). Second and subsequent calls to
** xMutexInit() must be no-ops. ** xMutexInit() must be no-ops.
** **
@ -5084,7 +5111,7 @@ SQLITE_API int sqlite3_test_control(int op, ...);
** CAPI3REF: SQLite Runtime Status ** CAPI3REF: SQLite Runtime Status
** **
** ^This interface is used to retrieve runtime status information ** ^This interface is used to retrieve runtime status information
** about the preformance of SQLite, and optionally to reset various ** about the performance of SQLite, and optionally to reset various
** highwater marks. ^The first argument is an integer code for ** highwater marks. ^The first argument is an integer code for
** the specific parameter to measure. ^(Recognized integer codes ** the specific parameter to measure. ^(Recognized integer codes
** are of the form [SQLITE_STATUS_MEMORY_USED | SQLITE_STATUS_...].)^ ** are of the form [SQLITE_STATUS_MEMORY_USED | SQLITE_STATUS_...].)^
@ -5136,6 +5163,9 @@ SQLITE_API int sqlite3_status(int op, int *pCurrent, int *pHighwater, int resetF
** *pHighwater parameter to [sqlite3_status()] is of interest. ** *pHighwater parameter to [sqlite3_status()] is of interest.
** The value written into the *pCurrent parameter is undefined.</dd>)^ ** The value written into the *pCurrent parameter is undefined.</dd>)^
** **
** ^(<dt>SQLITE_STATUS_MALLOC_COUNT</dt>
** <dd>This parameter records the number of separate memory allocations.</dd>)^
**
** ^(<dt>SQLITE_STATUS_PAGECACHE_USED</dt> ** ^(<dt>SQLITE_STATUS_PAGECACHE_USED</dt>
** <dd>This parameter returns the number of pages used out of the ** <dd>This parameter returns the number of pages used out of the
** [pagecache memory allocator] that was configured using ** [pagecache memory allocator] that was configured using
@ -5197,6 +5227,7 @@ SQLITE_API int sqlite3_status(int op, int *pCurrent, int *pHighwater, int resetF
#define SQLITE_STATUS_PARSER_STACK 6 #define SQLITE_STATUS_PARSER_STACK 6
#define SQLITE_STATUS_PAGECACHE_SIZE 7 #define SQLITE_STATUS_PAGECACHE_SIZE 7
#define SQLITE_STATUS_SCRATCH_SIZE 8 #define SQLITE_STATUS_SCRATCH_SIZE 8
#define SQLITE_STATUS_MALLOC_COUNT 9
/* /*
** CAPI3REF: Database Connection Status ** CAPI3REF: Database Connection Status
@ -5206,7 +5237,7 @@ SQLITE_API int sqlite3_status(int op, int *pCurrent, int *pHighwater, int resetF
** database connection object to be interrogated. ^The second argument ** database connection object to be interrogated. ^The second argument
** is an integer constant, taken from the set of ** is an integer constant, taken from the set of
** [SQLITE_DBSTATUS_LOOKASIDE_USED | SQLITE_DBSTATUS_*] macros, that ** [SQLITE_DBSTATUS_LOOKASIDE_USED | SQLITE_DBSTATUS_*] macros, that
** determiness the parameter to interrogate. The set of ** determines the parameter to interrogate. The set of
** [SQLITE_DBSTATUS_LOOKASIDE_USED | SQLITE_DBSTATUS_*] macros is likely ** [SQLITE_DBSTATUS_LOOKASIDE_USED | SQLITE_DBSTATUS_*] macros is likely
** to grow in future releases of SQLite. ** to grow in future releases of SQLite.
** **
@ -5236,16 +5267,33 @@ SQLITE_API int sqlite3_db_status(sqlite3*, int op, int *pCur, int *pHiwtr, int r
** <dd>This parameter returns the number of lookaside memory slots currently ** <dd>This parameter returns the number of lookaside memory slots currently
** checked out.</dd>)^ ** checked out.</dd>)^
** **
** <dt>SQLITE_DBSTATUS_CACHE_USED</dt> ** ^(<dt>SQLITE_DBSTATUS_CACHE_USED</dt>
** <dd>^This parameter returns the approximate number of of bytes of heap ** <dd>This parameter returns the approximate number of of bytes of heap
** memory used by all pager caches associated with the database connection. ** memory used by all pager caches associated with the database connection.)^
** ^The highwater mark associated with SQLITE_DBSTATUS_CACHE_USED is always 0. ** ^The highwater mark associated with SQLITE_DBSTATUS_CACHE_USED is always 0.
**
** ^(<dt>SQLITE_DBSTATUS_SCHEMA_USED</dt>
** <dd>This parameter returns the approximate number of of bytes of heap
** memory used to store the schema for all databases associated
** with the connection - main, temp, and any [ATTACH]-ed databases.)^
** ^The full amount of memory used by the schemas is reported, even if the
** schema memory is shared with other database connections due to
** [shared cache mode] being enabled.
** ^The highwater mark associated with SQLITE_DBSTATUS_SCHEMA_USED is always 0.
**
** ^(<dt>SQLITE_DBSTATUS_STMT_USED</dt>
** <dd>This parameter returns the approximate number of of bytes of heap
** and lookaside memory used by all prepared statements associated with
** the database connection.)^
** ^The highwater mark associated with SQLITE_DBSTATUS_STMT_USED is always 0.
** </dd> ** </dd>
** </dl> ** </dl>
*/ */
#define SQLITE_DBSTATUS_LOOKASIDE_USED 0 #define SQLITE_DBSTATUS_LOOKASIDE_USED 0
#define SQLITE_DBSTATUS_CACHE_USED 1 #define SQLITE_DBSTATUS_CACHE_USED 1
#define SQLITE_DBSTATUS_MAX 1 /* Largest defined DBSTATUS */ #define SQLITE_DBSTATUS_SCHEMA_USED 2
#define SQLITE_DBSTATUS_STMT_USED 3
#define SQLITE_DBSTATUS_MAX 3 /* Largest defined DBSTATUS */
/* /*
@ -5611,7 +5659,7 @@ typedef struct sqlite3_backup sqlite3_backup;
** **
** ^Each call to sqlite3_backup_step() sets two values inside ** ^Each call to sqlite3_backup_step() sets two values inside
** the [sqlite3_backup] object: the number of pages still to be backed ** the [sqlite3_backup] object: the number of pages still to be backed
** up and the total number of pages in the source databae file. ** up and the total number of pages in the source database file.
** The sqlite3_backup_remaining() and sqlite3_backup_pagecount() interfaces ** The sqlite3_backup_remaining() and sqlite3_backup_pagecount() interfaces
** retrieve these two values, respectively. ** retrieve these two values, respectively.
** **
@ -5707,7 +5755,7 @@ SQLITE_API int sqlite3_backup_pagecount(sqlite3_backup *p);
** blocked connection already has a registered unlock-notify callback, ** blocked connection already has a registered unlock-notify callback,
** then the new callback replaces the old.)^ ^If sqlite3_unlock_notify() is ** then the new callback replaces the old.)^ ^If sqlite3_unlock_notify() is
** called with a NULL pointer as its second argument, then any existing ** called with a NULL pointer as its second argument, then any existing
** unlock-notify callback is cancelled. ^The blocked connections ** unlock-notify callback is canceled. ^The blocked connections
** unlock-notify callback may also be canceled by closing the blocked ** unlock-notify callback may also be canceled by closing the blocked
** connection using [sqlite3_close()]. ** connection using [sqlite3_close()].
** **
@ -5789,7 +5837,7 @@ SQLITE_API int sqlite3_unlock_notify(
** **
** ^The [sqlite3_strnicmp()] API allows applications and extensions to ** ^The [sqlite3_strnicmp()] API allows applications and extensions to
** compare the contents of two buffers containing UTF-8 strings in a ** compare the contents of two buffers containing UTF-8 strings in a
** case-indendent fashion, using the same definition of case independence ** case-independent fashion, using the same definition of case independence
** that SQLite uses internally when comparing identifiers. ** that SQLite uses internally when comparing identifiers.
*/ */
SQLITE_API int sqlite3_strnicmp(const char *, const char *, int); SQLITE_API int sqlite3_strnicmp(const char *, const char *, int);