Skip to content

Commit

Permalink
Embed sqlite amalgamation v3.44.1 source code (#60)
Browse files Browse the repository at this point in the history
* Docs cleanup
* Embed sqlite amalgamation v3.44.1 source code
  • Loading branch information
gwynne authored Nov 24, 2023
1 parent 35c59e9 commit c30afee
Show file tree
Hide file tree
Showing 6 changed files with 269 additions and 192 deletions.
67 changes: 55 additions & 12 deletions Sources/CSQLite/include/sqlite_nio_sqlite3.h
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,9 @@ extern "C" {
** [sqlite_nio_sqlite3_libversion_number()], [sqlite_nio_sqlite3_sourceid()],
** [sqlite_version()] and [sqlite_source_id()].
*/
#define SQLITE_VERSION "3.44.0"
#define SQLITE_VERSION_NUMBER 3044000
#define SQLITE_SOURCE_ID "2023-11-01 11:23:50 17129ba1ff7f0daf37100ee82d507aef7827cf38de1866e2633096ae6ad81301"
#define SQLITE_VERSION "3.44.1"
#define SQLITE_VERSION_NUMBER 3044001
#define SQLITE_SOURCE_ID "2023-11-22 14:18:12 d295f48e8f367b066b881780c98bdf980a1d550397d5ba0b0e49842c95b3e8b4"

/*
** CAPI3REF: Run-Time Library Version Numbers
Expand Down Expand Up @@ -5573,20 +5573,35 @@ SQLITE_API int sqlite_nio_sqlite3_create_window_function(
** </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
** [sqlite_nio_sqlite3_value_subtype()] to inspect the sub-types of its arguments.
** Specifying this flag makes no difference for scalar or aggregate user
** functions. However, if it is not specified for a user-defined window
** function, then any sub-types belonging to arguments passed to the window
** function may be discarded before the window function is called (i.e.
** sqlite_nio_sqlite3_value_subtype() will always return 0).
** This flag instructs SQLite to omit some corner-case optimizations that
** might disrupt the operation of the [sqlite_nio_sqlite3_value_subtype()] function,
** causing it to return zero rather than the correct subtype().
** SQL functions that invokes [sqlite_nio_sqlite3_value_subtype()] should have this
** property. If the SQLITE_SUBTYPE property is omitted, then the return
** value from [sqlite_nio_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
** [sqlite_nio_sqlite3_result_subtype()] to cause a sub-type to be associated with its
** result.
** Every function that invokes [sqlite_nio_sqlite3_result_subtype()] should have this
** property. If it does not, then the call to [sqlite_nio_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
** [sqlite_nio_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>
** </dl>
*/
#define SQLITE_DETERMINISTIC 0x000000800
#define SQLITE_DIRECTONLY 0x000080000
#define SQLITE_SUBTYPE 0x000100000
#define SQLITE_INNOCUOUS 0x000200000
#define SQLITE_RESULT_SUBTYPE 0x001000000

/*
** CAPI3REF: Deprecated Functions
Expand Down Expand Up @@ -5783,6 +5798,12 @@ SQLITE_API int sqlite_nio_sqlite3_value_encoding(sqlite3_value*);
** information can be used to pass a limited amount of context from
** one SQL function to another. Use the [sqlite_nio_sqlite3_result_subtype()]
** 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 [sqlite_nio_sqlite3_create_function|registered].
** If the [SQLITE_SUBTYPE] property is omitted, then sqlite_nio_sqlite3_value_subtype()
** might return zero instead of the upstream subtype in some corner cases.
*/
SQLITE_API unsigned int sqlite_nio_sqlite3_value_subtype(sqlite3_value*);

Expand Down Expand Up @@ -5913,14 +5934,22 @@ SQLITE_API sqlite3 *sqlite_nio_sqlite3_context_db_handle(sqlite3_context*);
** <li> ^(when sqlite_nio_sqlite3_set_auxdata() is invoked again on the same
** parameter)^, or
** <li> ^(during the original sqlite_nio_sqlite3_set_auxdata() call when a memory
** allocation error occurs.)^ </ul>
** allocation error occurs.)^
** <li> ^(during the original sqlite_nio_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
** sqlite_nio_sqlite3_set_auxdata(C,N,P,X) might be called immediately, before the
** sqlite_nio_sqlite3_set_auxdata() interface even returns. Hence sqlite_nio_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
** sqlite_nio_sqlite3_set_auxdata() has been called.
** sqlite_nio_sqlite3_set_auxdata() has been called. Furthermore, a call to
** sqlite_nio_sqlite3_get_auxdata() that occurs immediately after a corresponding call
** to sqlite_nio_sqlite3_set_auxdata() might still return NULL if an out-of-memory
** condition occurred during the sqlite_nio_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
** function parameters that are compile-time constants, including literal
Expand Down Expand Up @@ -6194,6 +6223,20 @@ SQLITE_API int sqlite_nio_sqlite3_result_zeroblob64(sqlite3_context*, sqlite3_ui
** higher order bits are discarded.
** The number of subtype bytes preserved by SQLite might increase
** 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
** [sqlite_nio_sqlite3_create_function|registered]. If the [SQLITE_RESULT_SUBTYPE]
** property is omitted from the function that invokes sqlite_nio_sqlite3_result_subtype(),
** then in some cases the sqlite_nio_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 sqlite_nio_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 sqlite_nio_sqlite3_result_subtype(sqlite3_context*,unsigned int);

Expand Down
Loading

0 comments on commit c30afee

Please sign in to comment.