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

Bump bundled SQLite to 3.45.2

This commit is contained in:
Kenichi Ishigaki 2024-03-17 22:32:19 +09:00
parent b433d17436
commit 3e8df90227
3 changed files with 6016 additions and 2716 deletions

View file

@ -1074,7 +1074,7 @@ are limited by the typeless nature of the SQLite database.
=head1 SQLITE VERSION =head1 SQLITE VERSION
DBD::SQLite is usually compiled with a bundled SQLite library DBD::SQLite is usually compiled with a bundled SQLite library
(SQLite version S<3.44.0> as of this release) for consistency. (SQLite version S<3.45.2> as of this release) for consistency.
However, a different version of SQLite may sometimes be used for However, a different version of SQLite may sometimes be used for
some reasons like security, or some new experimental features. some reasons like security, or some new experimental features.

8200
sqlite3.c

File diff suppressed because it is too large Load diff

154
sqlite3.h
View file

@ -146,9 +146,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.44.0" #define SQLITE_VERSION "3.45.2"
#define SQLITE_VERSION_NUMBER 3044000 #define SQLITE_VERSION_NUMBER 3045002
#define SQLITE_SOURCE_ID "2023-11-01 11:23:50 17129ba1ff7f0daf37100ee82d507aef7827cf38de1866e2633096ae6ad81301" #define SQLITE_SOURCE_ID "2024-03-12 11:06:23 d8cd6d49b46a395b13955387d05e9e1a2a47e54fb99f3c9b59835bbefad6af77"
/* /*
** CAPI3REF: Run-Time Library Version Numbers ** CAPI3REF: Run-Time Library Version Numbers
@ -420,6 +420,8 @@ typedef int (*sqlite3_callback)(void*,int,char**, char**);
** the 1st parameter to sqlite3_exec() while sqlite3_exec() is running. ** the 1st parameter to sqlite3_exec() while sqlite3_exec() is running.
** <li> The application must not modify the SQL statement text passed into ** <li> The application must not modify the SQL statement text passed into
** the 2nd parameter of sqlite3_exec() while sqlite3_exec() is running. ** the 2nd parameter of sqlite3_exec() while sqlite3_exec() is running.
** <li> The application must not dereference the arrays or string pointers
** passed as the 3rd and 4th callback parameters after it returns.
** </ul> ** </ul>
*/ */
SQLITE_API int sqlite3_exec( SQLITE_API int sqlite3_exec(
@ -3954,15 +3956,17 @@ SQLITE_API void sqlite3_free_filename(sqlite3_filename);
** </ul> ** </ul>
** **
** ^The sqlite3_errmsg() and sqlite3_errmsg16() return English-language ** ^The sqlite3_errmsg() and sqlite3_errmsg16() return English-language
** text that describes the error, as either UTF-8 or UTF-16 respectively. ** text that describes the error, as either UTF-8 or UTF-16 respectively,
** or NULL if no error message is available.
** (See how SQLite handles [invalid UTF] for exceptions to this rule.) ** (See how SQLite handles [invalid UTF] for exceptions to this rule.)
** ^(Memory to hold the error message string is managed internally. ** ^(Memory to hold the error message string is managed internally.
** The application does not need to worry about freeing the result. ** The application does not need to worry about freeing the result.
** However, the error string might be overwritten or deallocated by ** However, the error string might be overwritten or deallocated by
** subsequent calls to other SQLite interface functions.)^ ** subsequent calls to other SQLite interface functions.)^
** **
** ^The sqlite3_errstr() interface returns the English-language text ** ^The sqlite3_errstr(E) interface returns the English-language text
** that describes the [result code], as UTF-8. ** that describes the [result code] E, as UTF-8, or NULL if E is not an
** result code for which a text error message is available.
** ^(Memory to hold the error message string is managed internally ** ^(Memory to hold the error message string is managed internally
** and must not be freed by the application)^. ** and must not be freed by the application)^.
** **
@ -5573,13 +5577,27 @@ SQLITE_API int sqlite3_create_window_function(
** </dd> ** </dd>
** **
** [[SQLITE_SUBTYPE]] <dt>SQLITE_SUBTYPE</dt><dd> ** [[SQLITE_SUBTYPE]] <dt>SQLITE_SUBTYPE</dt><dd>
** The SQLITE_SUBTYPE flag indicates to SQLite that a function may call ** The SQLITE_SUBTYPE flag indicates to SQLite that a function might call
** [sqlite3_value_subtype()] to inspect the sub-types of its arguments. ** [sqlite3_value_subtype()] to inspect the sub-types of its arguments.
** Specifying this flag makes no difference for scalar or aggregate user ** This flag instructs SQLite to omit some corner-case optimizations that
** functions. However, if it is not specified for a user-defined window ** might disrupt the operation of the [sqlite3_value_subtype()] function,
** function, then any sub-types belonging to arguments passed to the window ** causing it to return zero rather than the correct subtype().
** function may be discarded before the window function is called (i.e. ** SQL functions that invokes [sqlite3_value_subtype()] should have this
** sqlite3_value_subtype() will always return 0). ** property. If the SQLITE_SUBTYPE property is omitted, then the return
** value from [sqlite3_value_subtype()] might sometimes be zero even though
** a non-zero subtype was specified by the function argument expression.
**
** [[SQLITE_RESULT_SUBTYPE]] <dt>SQLITE_RESULT_SUBTYPE</dt><dd>
** The SQLITE_RESULT_SUBTYPE flag indicates to SQLite that a function might call
** [sqlite3_result_subtype()] to cause a sub-type to be associated with its
** result.
** Every function that invokes [sqlite3_result_subtype()] should have this
** property. If it does not, then the call to [sqlite3_result_subtype()]
** might become a no-op if the function is used as term in an
** [expression index]. On the other hand, SQL functions that never invoke
** [sqlite3_result_subtype()] should avoid setting this property, as the
** purpose of this property is to disable certain optimizations that are
** incompatible with subtypes.
** </dd> ** </dd>
** </dl> ** </dl>
*/ */
@ -5587,6 +5605,7 @@ SQLITE_API int sqlite3_create_window_function(
#define SQLITE_DIRECTONLY 0x000080000 #define SQLITE_DIRECTONLY 0x000080000
#define SQLITE_SUBTYPE 0x000100000 #define SQLITE_SUBTYPE 0x000100000
#define SQLITE_INNOCUOUS 0x000200000 #define SQLITE_INNOCUOUS 0x000200000
#define SQLITE_RESULT_SUBTYPE 0x001000000
/* /*
** CAPI3REF: Deprecated Functions ** CAPI3REF: Deprecated Functions
@ -5783,6 +5802,12 @@ SQLITE_API int sqlite3_value_encoding(sqlite3_value*);
** information can be used to pass a limited amount of context from ** information can be used to pass a limited amount of context from
** one SQL function to another. Use the [sqlite3_result_subtype()] ** one SQL function to another. Use the [sqlite3_result_subtype()]
** routine to set the subtype for the return value of an SQL function. ** routine to set the subtype for the return value of an SQL function.
**
** Every [application-defined SQL function] that invoke this interface
** should include the [SQLITE_SUBTYPE] property in the text
** encoding argument when the function is [sqlite3_create_function|registered].
** If the [SQLITE_SUBTYPE] property is omitted, then sqlite3_value_subtype()
** might return zero instead of the upstream subtype in some corner cases.
*/ */
SQLITE_API unsigned int sqlite3_value_subtype(sqlite3_value*); SQLITE_API unsigned int sqlite3_value_subtype(sqlite3_value*);
@ -5913,14 +5938,22 @@ SQLITE_API sqlite3 *sqlite3_context_db_handle(sqlite3_context*);
** <li> ^(when sqlite3_set_auxdata() is invoked again on the same ** <li> ^(when sqlite3_set_auxdata() is invoked again on the same
** parameter)^, or ** parameter)^, or
** <li> ^(during the original sqlite3_set_auxdata() call when a memory ** <li> ^(during the original sqlite3_set_auxdata() call when a memory
** allocation error occurs.)^ </ul> ** allocation error occurs.)^
** <li> ^(during the original sqlite3_set_auxdata() call if the function
** is evaluated during query planning instead of during query execution,
** as sometimes happens with [SQLITE_ENABLE_STAT4].)^ </ul>
** **
** Note the last bullet in particular. The destructor X in ** Note the last two bullets in particular. The destructor X in
** sqlite3_set_auxdata(C,N,P,X) might be called immediately, before the ** sqlite3_set_auxdata(C,N,P,X) might be called immediately, before the
** sqlite3_set_auxdata() interface even returns. Hence sqlite3_set_auxdata() ** sqlite3_set_auxdata() interface even returns. Hence sqlite3_set_auxdata()
** should be called near the end of the function implementation and the ** should be called near the end of the function implementation and the
** function implementation should not make any use of P after ** function implementation should not make any use of P after
** sqlite3_set_auxdata() has been called. ** sqlite3_set_auxdata() has been called. Furthermore, a call to
** sqlite3_get_auxdata() that occurs immediately after a corresponding call
** to sqlite3_set_auxdata() might still return NULL if an out-of-memory
** condition occurred during the sqlite3_set_auxdata() call or if the
** function is being evaluated during query planning rather than during
** query execution.
** **
** ^(In practice, auxiliary data is preserved between function calls for ** ^(In practice, auxiliary data is preserved between function calls for
** function parameters that are compile-time constants, including literal ** function parameters that are compile-time constants, including literal
@ -6194,6 +6227,20 @@ SQLITE_API int sqlite3_result_zeroblob64(sqlite3_context*, sqlite3_uint64 n);
** higher order bits are discarded. ** higher order bits are discarded.
** The number of subtype bytes preserved by SQLite might increase ** The number of subtype bytes preserved by SQLite might increase
** in future releases of SQLite. ** in future releases of SQLite.
**
** Every [application-defined SQL function] that invokes this interface
** should include the [SQLITE_RESULT_SUBTYPE] property in its
** text encoding argument when the SQL function is
** [sqlite3_create_function|registered]. If the [SQLITE_RESULT_SUBTYPE]
** property is omitted from the function that invokes sqlite3_result_subtype(),
** then in some cases the sqlite3_result_subtype() might fail to set
** the result subtype.
**
** If SQLite is compiled with -DSQLITE_STRICT_SUBTYPE=1, then any
** SQL function that invokes the sqlite3_result_subtype() interface
** and that does not have the SQLITE_RESULT_SUBTYPE property will raise
** an error. Future versions of SQLite might enable -DSQLITE_STRICT_SUBTYPE=1
** by default.
*/ */
SQLITE_API void sqlite3_result_subtype(sqlite3_context*,unsigned int); SQLITE_API void sqlite3_result_subtype(sqlite3_context*,unsigned int);
@ -7994,9 +8041,11 @@ SQLITE_API int sqlite3_vfs_unregister(sqlite3_vfs*);
** **
** ^(Some systems (for example, Windows 95) do not support the operation ** ^(Some systems (for example, Windows 95) do not support the operation
** implemented by sqlite3_mutex_try(). On those systems, sqlite3_mutex_try() ** implemented by sqlite3_mutex_try(). On those systems, sqlite3_mutex_try()
** will always return SQLITE_BUSY. The SQLite core only ever uses ** will always return SQLITE_BUSY. In most cases the SQLite core only uses
** sqlite3_mutex_try() as an optimization so this is acceptable ** sqlite3_mutex_try() as an optimization, so this is acceptable
** behavior.)^ ** behavior. The exceptions are unix builds that set the
** SQLITE_ENABLE_SETLK_TIMEOUT build option. In that case a working
** sqlite3_mutex_try() is required.)^
** **
** ^The sqlite3_mutex_leave() routine exits a mutex that was ** ^The sqlite3_mutex_leave() routine exits a mutex that was
** previously entered by the same thread. The behavior ** previously entered by the same thread. The behavior
@ -8255,6 +8304,7 @@ SQLITE_API int sqlite3_test_control(int op, ...);
#define SQLITE_TESTCTRL_ASSERT 12 #define SQLITE_TESTCTRL_ASSERT 12
#define SQLITE_TESTCTRL_ALWAYS 13 #define SQLITE_TESTCTRL_ALWAYS 13
#define SQLITE_TESTCTRL_RESERVE 14 /* NOT USED */ #define SQLITE_TESTCTRL_RESERVE 14 /* NOT USED */
#define SQLITE_TESTCTRL_JSON_SELFCHECK 14
#define SQLITE_TESTCTRL_OPTIMIZATIONS 15 #define SQLITE_TESTCTRL_OPTIMIZATIONS 15
#define SQLITE_TESTCTRL_ISKEYWORD 16 /* NOT USED */ #define SQLITE_TESTCTRL_ISKEYWORD 16 /* NOT USED */
#define SQLITE_TESTCTRL_SCRATCHMALLOC 17 /* NOT USED */ #define SQLITE_TESTCTRL_SCRATCHMALLOC 17 /* NOT USED */
@ -12768,8 +12818,11 @@ struct Fts5PhraseIter {
** created with the "columnsize=0" option. ** created with the "columnsize=0" option.
** **
** xColumnText: ** xColumnText:
** This function attempts to retrieve the text of column iCol of the ** If parameter iCol is less than zero, or greater than or equal to the
** current document. If successful, (*pz) is set to point to a buffer ** number of columns in the table, SQLITE_RANGE is returned.
**
** Otherwise, this function attempts to retrieve the text of column iCol of
** the current document. If successful, (*pz) is set to point to a buffer
** containing the text in utf-8 encoding, (*pn) is set to the size in bytes ** containing the text in utf-8 encoding, (*pn) is set to the size in bytes
** (not characters) of the buffer and SQLITE_OK is returned. Otherwise, ** (not characters) of the buffer and SQLITE_OK is returned. Otherwise,
** if an error occurs, an SQLite error code is returned and the final values ** if an error occurs, an SQLite error code is returned and the final values
@ -12779,8 +12832,10 @@ struct Fts5PhraseIter {
** Returns the number of phrases in the current query expression. ** Returns the number of phrases in the current query expression.
** **
** xPhraseSize: ** xPhraseSize:
** Returns the number of tokens in phrase iPhrase of the query. Phrases ** If parameter iCol is less than zero, or greater than or equal to the
** are numbered starting from zero. ** number of phrases in the current query, as returned by xPhraseCount,
** 0 is returned. Otherwise, this function returns the number of tokens in
** phrase iPhrase of the query. Phrases are numbered starting from zero.
** **
** xInstCount: ** xInstCount:
** Set *pnInst to the total number of occurrences of all phrases within ** Set *pnInst to the total number of occurrences of all phrases within
@ -12796,12 +12851,13 @@ struct Fts5PhraseIter {
** Query for the details of phrase match iIdx within the current row. ** Query for the details of phrase match iIdx within the current row.
** Phrase matches are numbered starting from zero, so the iIdx argument ** Phrase matches are numbered starting from zero, so the iIdx argument
** should be greater than or equal to zero and smaller than the value ** should be greater than or equal to zero and smaller than the value
** output by xInstCount(). ** output by xInstCount(). If iIdx is less than zero or greater than
** or equal to the value returned by xInstCount(), SQLITE_RANGE is returned.
** **
** Usually, output parameter *piPhrase is set to the phrase number, *piCol ** Otherwise, output parameter *piPhrase is set to the phrase number, *piCol
** to the column in which it occurs and *piOff the token offset of the ** to the column in which it occurs and *piOff the token offset of the
** first token of the phrase. Returns SQLITE_OK if successful, or an error ** first token of the phrase. SQLITE_OK is returned if successful, or an
** code (i.e. SQLITE_NOMEM) if an error occurs. ** error code (i.e. SQLITE_NOMEM) if an error occurs.
** **
** This API can be quite slow if used with an FTS5 table created with the ** This API can be quite slow if used with an FTS5 table created with the
** "detail=none" or "detail=column" option. ** "detail=none" or "detail=column" option.
@ -12827,6 +12883,10 @@ struct Fts5PhraseIter {
** Invoking Api.xUserData() returns a copy of the pointer passed as ** Invoking Api.xUserData() returns a copy of the pointer passed as
** the third argument to pUserData. ** the third argument to pUserData.
** **
** If parameter iPhrase is less than zero, or greater than or equal to
** the number of phrases in the query, as returned by xPhraseCount(),
** this function returns SQLITE_RANGE.
**
** If the callback function returns any value other than SQLITE_OK, the ** If the callback function returns any value other than SQLITE_OK, the
** query is abandoned and the xQueryPhrase function returns immediately. ** query is abandoned and the xQueryPhrase function returns immediately.
** If the returned value is SQLITE_DONE, xQueryPhrase returns SQLITE_OK. ** If the returned value is SQLITE_DONE, xQueryPhrase returns SQLITE_OK.
@ -12941,9 +13001,42 @@ struct Fts5PhraseIter {
** **
** xPhraseNextColumn() ** xPhraseNextColumn()
** See xPhraseFirstColumn above. ** See xPhraseFirstColumn above.
**
** xQueryToken(pFts5, iPhrase, iToken, ppToken, pnToken)
** This is used to access token iToken of phrase iPhrase of the current
** query. Before returning, output parameter *ppToken is set to point
** to a buffer containing the requested token, and *pnToken to the
** size of this buffer in bytes.
**
** If iPhrase or iToken are less than zero, or if iPhrase is greater than
** or equal to the number of phrases in the query as reported by
** xPhraseCount(), or if iToken is equal to or greater than the number of
** tokens in the phrase, SQLITE_RANGE is returned and *ppToken and *pnToken
are both zeroed.
**
** The output text is not a copy of the query text that specified the
** token. It is the output of the tokenizer module. For tokendata=1
** tables, this includes any embedded 0x00 and trailing data.
**
** xInstToken(pFts5, iIdx, iToken, ppToken, pnToken)
** This is used to access token iToken of phrase hit iIdx within the
** current row. If iIdx is less than zero or greater than or equal to the
** value returned by xInstCount(), SQLITE_RANGE is returned. Otherwise,
** output variable (*ppToken) is set to point to a buffer containing the
** matching document token, and (*pnToken) to the size of that buffer in
** bytes. This API is not available if the specified token matches a
** prefix query term. In that case both output variables are always set
** to 0.
**
** The output text is not a copy of the document text that was tokenized.
** It is the output of the tokenizer module. For tokendata=1 tables, this
** includes any embedded 0x00 and trailing data.
**
** This API can be quite slow if used with an FTS5 table created with the
** "detail=none" or "detail=column" option.
*/ */
struct Fts5ExtensionApi { struct Fts5ExtensionApi {
int iVersion; /* Currently always set to 2 */ int iVersion; /* Currently always set to 3 */
void *(*xUserData)(Fts5Context*); void *(*xUserData)(Fts5Context*);
@ -12978,6 +13071,13 @@ struct Fts5ExtensionApi {
int (*xPhraseFirstColumn)(Fts5Context*, int iPhrase, Fts5PhraseIter*, int*); int (*xPhraseFirstColumn)(Fts5Context*, int iPhrase, Fts5PhraseIter*, int*);
void (*xPhraseNextColumn)(Fts5Context*, Fts5PhraseIter*, int *piCol); void (*xPhraseNextColumn)(Fts5Context*, Fts5PhraseIter*, int *piCol);
/* Below this point are iVersion>=3 only */
int (*xQueryToken)(Fts5Context*,
int iPhrase, int iToken,
const char **ppToken, int *pnToken
);
int (*xInstToken)(Fts5Context*, int iIdx, int iToken, const char**, int*);
}; };
/* /*