amalgalite 1.8.0-x86-mingw32 → 1.9.1-x86-mingw32

Sign up to get free protection for your applications and to get access to all the features.
@@ -146,9 +146,9 @@ extern "C" {
146
146
  ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
147
147
  ** [sqlite_version()] and [sqlite_source_id()].
148
148
  */
149
- #define SQLITE_VERSION "3.40.1"
150
- #define SQLITE_VERSION_NUMBER 3040001
151
- #define SQLITE_SOURCE_ID "2022-12-28 14:03:47 df5c253c0b3dd24916e4ec7cf77d3db5294cc9fd45ae7b9c5e82ad8197f38a24"
149
+ #define SQLITE_VERSION "3.41.2"
150
+ #define SQLITE_VERSION_NUMBER 3041002
151
+ #define SQLITE_SOURCE_ID "2023-03-22 11:56:21 0d1fc92f94cb6b76bffe3ec34d69cffde2924203304e8ffc4155597af0c191da"
152
152
 
153
153
  /*
154
154
  ** CAPI3REF: Run-Time Library Version Numbers
@@ -563,6 +563,7 @@ SQLITE_API int sqlite3_exec(
563
563
  #define SQLITE_CONSTRAINT_DATATYPE (SQLITE_CONSTRAINT |(12<<8))
564
564
  #define SQLITE_NOTICE_RECOVER_WAL (SQLITE_NOTICE | (1<<8))
565
565
  #define SQLITE_NOTICE_RECOVER_ROLLBACK (SQLITE_NOTICE | (2<<8))
566
+ #define SQLITE_NOTICE_RBU (SQLITE_NOTICE | (3<<8))
566
567
  #define SQLITE_WARNING_AUTOINDEX (SQLITE_WARNING | (1<<8))
567
568
  #define SQLITE_AUTH_USER (SQLITE_AUTH | (1<<8))
568
569
  #define SQLITE_OK_LOAD_PERMANENTLY (SQLITE_OK | (1<<8))
@@ -1175,7 +1176,6 @@ struct sqlite3_io_methods {
1175
1176
  ** in wal mode after the client has finished copying pages from the wal
1176
1177
  ** file to the database file, but before the *-shm file is updated to
1177
1178
  ** record the fact that the pages have been checkpointed.
1178
- ** </ul>
1179
1179
  **
1180
1180
  ** <li>[[SQLITE_FCNTL_EXTERNAL_READER]]
1181
1181
  ** The EXPERIMENTAL [SQLITE_FCNTL_EXTERNAL_READER] opcode is used to detect
@@ -1188,16 +1188,16 @@ struct sqlite3_io_methods {
1188
1188
  ** the database is not a wal-mode db, or if there is no such connection in any
1189
1189
  ** other process. This opcode cannot be used to detect transactions opened
1190
1190
  ** by clients within the current process, only within other processes.
1191
- ** </ul>
1192
1191
  **
1193
1192
  ** <li>[[SQLITE_FCNTL_CKSM_FILE]]
1194
- ** Used by the cksmvfs VFS module only.
1193
+ ** The [SQLITE_FCNTL_CKSM_FILE] opcode is for use interally by the
1194
+ ** [checksum VFS shim] only.
1195
1195
  **
1196
1196
  ** <li>[[SQLITE_FCNTL_RESET_CACHE]]
1197
1197
  ** If there is currently no transaction open on the database, and the
1198
- ** database is not a temp db, then this file-control purges the contents
1199
- ** of the in-memory page cache. If there is an open transaction, or if
1200
- ** the db is a temp-db, it is a no-op, not an error.
1198
+ ** database is not a temp db, then the [SQLITE_FCNTL_RESET_CACHE] file-control
1199
+ ** purges the contents of the in-memory page cache. If there is an open
1200
+ ** transaction, or if the db is a temp-db, this opcode is a no-op, not an error.
1201
1201
  ** </ul>
1202
1202
  */
1203
1203
  #define SQLITE_FCNTL_LOCKSTATE 1
@@ -2184,7 +2184,7 @@ struct sqlite3_mem_methods {
2184
2184
  ** configuration for a database connection can only be changed when that
2185
2185
  ** connection is not currently using lookaside memory, or in other words
2186
2186
  ** when the "current value" returned by
2187
- ** [sqlite3_db_status](D,[SQLITE_CONFIG_LOOKASIDE],...) is zero.
2187
+ ** [sqlite3_db_status](D,[SQLITE_DBSTATUS_LOOKASIDE_USED],...) is zero.
2188
2188
  ** Any attempt to change the lookaside memory configuration when lookaside
2189
2189
  ** memory is in use leaves the configuration unchanged and returns
2190
2190
  ** [SQLITE_BUSY].)^</dd>
@@ -2334,8 +2334,12 @@ struct sqlite3_mem_methods {
2334
2334
  ** <li> sqlite3_db_config(db, SQLITE_DBCONFIG_RESET_DATABASE, 0, 0);
2335
2335
  ** </ol>
2336
2336
  ** Because resetting a database is destructive and irreversible, the
2337
- ** process requires the use of this obscure API and multiple steps to help
2338
- ** ensure that it does not happen by accident.
2337
+ ** process requires the use of this obscure API and multiple steps to
2338
+ ** help ensure that it does not happen by accident. Because this
2339
+ ** feature must be capable of resetting corrupt databases, and
2340
+ ** shutting down virtual tables may require access to that corrupt
2341
+ ** storage, the library must abandon any installed virtual tables
2342
+ ** without calling their xDestroy() methods.
2339
2343
  **
2340
2344
  ** [[SQLITE_DBCONFIG_DEFENSIVE]] <dt>SQLITE_DBCONFIG_DEFENSIVE</dt>
2341
2345
  ** <dd>The SQLITE_DBCONFIG_DEFENSIVE option activates or deactivates the
@@ -2674,8 +2678,12 @@ SQLITE_API sqlite3_int64 sqlite3_total_changes64(sqlite3*);
2674
2678
  ** ^A call to sqlite3_interrupt(D) that occurs when there are no running
2675
2679
  ** SQL statements is a no-op and has no effect on SQL statements
2676
2680
  ** that are started after the sqlite3_interrupt() call returns.
2681
+ **
2682
+ ** ^The [sqlite3_is_interrupted(D)] interface can be used to determine whether
2683
+ ** or not an interrupt is currently in effect for [database connection] D.
2677
2684
  */
2678
2685
  SQLITE_API void sqlite3_interrupt(sqlite3*);
2686
+ SQLITE_API int sqlite3_is_interrupted(sqlite3*);
2679
2687
 
2680
2688
  /*
2681
2689
  ** CAPI3REF: Determine If An SQL Statement Is Complete
@@ -3293,8 +3301,8 @@ SQLITE_API SQLITE_DEPRECATED void *sqlite3_profile(sqlite3*,
3293
3301
  ** <dd>^An SQLITE_TRACE_PROFILE callback provides approximately the same
3294
3302
  ** information as is provided by the [sqlite3_profile()] callback.
3295
3303
  ** ^The P argument is a pointer to the [prepared statement] and the
3296
- ** X argument points to a 64-bit integer which is the estimated of
3297
- ** the number of nanosecond that the prepared statement took to run.
3304
+ ** X argument points to a 64-bit integer which is approximately
3305
+ ** the number of nanoseconds that the prepared statement took to run.
3298
3306
  ** ^The SQLITE_TRACE_PROFILE callback is invoked when the statement finishes.
3299
3307
  **
3300
3308
  ** [[SQLITE_TRACE_ROW]] <dt>SQLITE_TRACE_ROW</dt>
@@ -3357,7 +3365,7 @@ SQLITE_API int sqlite3_trace_v2(
3357
3365
  **
3358
3366
  ** ^The sqlite3_progress_handler(D,N,X,P) interface causes the callback
3359
3367
  ** function X to be invoked periodically during long running calls to
3360
- ** [sqlite3_exec()], [sqlite3_step()] and [sqlite3_get_table()] for
3368
+ ** [sqlite3_step()] and [sqlite3_prepare()] and similar for
3361
3369
  ** database connection D. An example use for this
3362
3370
  ** interface is to keep a GUI updated during a large query.
3363
3371
  **
@@ -3382,6 +3390,13 @@ SQLITE_API int sqlite3_trace_v2(
3382
3390
  ** Note that [sqlite3_prepare_v2()] and [sqlite3_step()] both modify their
3383
3391
  ** database connections for the meaning of "modify" in this paragraph.
3384
3392
  **
3393
+ ** The progress handler callback would originally only be invoked from the
3394
+ ** bytecode engine. It still might be invoked during [sqlite3_prepare()]
3395
+ ** and similar because those routines might force a reparse of the schema
3396
+ ** which involves running the bytecode engine. However, beginning with
3397
+ ** SQLite version 3.41.0, the progress handler callback might also be
3398
+ ** invoked directly from [sqlite3_prepare()] while analyzing and generating
3399
+ ** code for complex queries.
3385
3400
  */
3386
3401
  SQLITE_API void sqlite3_progress_handler(sqlite3*, int, int(*)(void*), void*);
3387
3402
 
@@ -3418,13 +3433,18 @@ SQLITE_API void sqlite3_progress_handler(sqlite3*, int, int(*)(void*), void*);
3418
3433
  **
3419
3434
  ** <dl>
3420
3435
  ** ^(<dt>[SQLITE_OPEN_READONLY]</dt>
3421
- ** <dd>The database is opened in read-only mode. If the database does not
3422
- ** already exist, an error is returned.</dd>)^
3436
+ ** <dd>The database is opened in read-only mode. If the database does
3437
+ ** not already exist, an error is returned.</dd>)^
3423
3438
  **
3424
3439
  ** ^(<dt>[SQLITE_OPEN_READWRITE]</dt>
3425
- ** <dd>The database is opened for reading and writing if possible, or reading
3426
- ** only if the file is write protected by the operating system. In either
3427
- ** case the database must already exist, otherwise an error is returned.</dd>)^
3440
+ ** <dd>The database is opened for reading and writing if possible, or
3441
+ ** reading only if the file is write protected by the operating
3442
+ ** system. In either case the database must already exist, otherwise
3443
+ ** an error is returned. For historical reasons, if opening in
3444
+ ** read-write mode fails due to OS-level permissions, an attempt is
3445
+ ** made to open it in read-only mode. [sqlite3_db_readonly()] can be
3446
+ ** used to determine whether the database is actually
3447
+ ** read-write.</dd>)^
3428
3448
  **
3429
3449
  ** ^(<dt>[SQLITE_OPEN_READWRITE] | [SQLITE_OPEN_CREATE]</dt>
3430
3450
  ** <dd>The database is opened for reading and writing, and is created if
@@ -5405,10 +5425,21 @@ SQLITE_API int sqlite3_create_window_function(
5405
5425
  ** from top-level SQL, and cannot be used in VIEWs or TRIGGERs nor in
5406
5426
  ** schema structures such as [CHECK constraints], [DEFAULT clauses],
5407
5427
  ** [expression indexes], [partial indexes], or [generated columns].
5408
- ** The SQLITE_DIRECTONLY flags is a security feature which is recommended
5409
- ** for all [application-defined SQL functions], and especially for functions
5410
- ** that have side-effects or that could potentially leak sensitive
5411
- ** information.
5428
+ ** <p>
5429
+ ** The SQLITE_DIRECTONLY flag is recommended for any
5430
+ ** [application-defined SQL function]
5431
+ ** that has side-effects or that could potentially leak sensitive information.
5432
+ ** This will prevent attacks in which an application is tricked
5433
+ ** into using a database file that has had its schema surreptiously
5434
+ ** modified to invoke the application-defined function in ways that are
5435
+ ** harmful.
5436
+ ** <p>
5437
+ ** Some people say it is good practice to set SQLITE_DIRECTONLY on all
5438
+ ** [application-defined SQL functions], regardless of whether or not they
5439
+ ** are security sensitive, as doing so prevents those functions from being used
5440
+ ** inside of the database schema, and thus ensures that the database
5441
+ ** can be inspected and modified using generic tools (such as the [CLI])
5442
+ ** that do not have access to the application-defined functions.
5412
5443
  ** </dd>
5413
5444
  **
5414
5445
  ** [[SQLITE_INNOCUOUS]] <dt>SQLITE_INNOCUOUS</dt><dd>
@@ -5549,16 +5580,6 @@ SQLITE_API SQLITE_DEPRECATED int sqlite3_memory_alarm(void(*)(void*,sqlite3_int6
5549
5580
  ** then the conversion is performed. Otherwise no conversion occurs.
5550
5581
  ** The [SQLITE_INTEGER | datatype] after conversion is returned.)^
5551
5582
  **
5552
- ** ^(The sqlite3_value_encoding(X) interface returns one of [SQLITE_UTF8],
5553
- ** [SQLITE_UTF16BE], or [SQLITE_UTF16LE] according to the current encoding
5554
- ** of the value X, assuming that X has type TEXT.)^ If sqlite3_value_type(X)
5555
- ** returns something other than SQLITE_TEXT, then the return value from
5556
- ** sqlite3_value_encoding(X) is meaningless. ^Calls to
5557
- ** sqlite3_value_text(X), sqlite3_value_text16(X), sqlite3_value_text16be(X),
5558
- ** sqlite3_value_text16le(X), sqlite3_value_bytes(X), or
5559
- ** sqlite3_value_bytes16(X) might change the encoding of the value X and
5560
- ** thus change the return from subsequent calls to sqlite3_value_encoding(X).
5561
- **
5562
5583
  ** ^Within the [xUpdate] method of a [virtual table], the
5563
5584
  ** sqlite3_value_nochange(X) interface returns true if and only if
5564
5585
  ** the column corresponding to X is unchanged by the UPDATE operation
@@ -5623,6 +5644,27 @@ SQLITE_API int sqlite3_value_type(sqlite3_value*);
5623
5644
  SQLITE_API int sqlite3_value_numeric_type(sqlite3_value*);
5624
5645
  SQLITE_API int sqlite3_value_nochange(sqlite3_value*);
5625
5646
  SQLITE_API int sqlite3_value_frombind(sqlite3_value*);
5647
+
5648
+ /*
5649
+ ** CAPI3REF: Report the internal text encoding state of an sqlite3_value object
5650
+ ** METHOD: sqlite3_value
5651
+ **
5652
+ ** ^(The sqlite3_value_encoding(X) interface returns one of [SQLITE_UTF8],
5653
+ ** [SQLITE_UTF16BE], or [SQLITE_UTF16LE] according to the current text encoding
5654
+ ** of the value X, assuming that X has type TEXT.)^ If sqlite3_value_type(X)
5655
+ ** returns something other than SQLITE_TEXT, then the return value from
5656
+ ** sqlite3_value_encoding(X) is meaningless. ^Calls to
5657
+ ** [sqlite3_value_text(X)], [sqlite3_value_text16(X)], [sqlite3_value_text16be(X)],
5658
+ ** [sqlite3_value_text16le(X)], [sqlite3_value_bytes(X)], or
5659
+ ** [sqlite3_value_bytes16(X)] might change the encoding of the value X and
5660
+ ** thus change the return from subsequent calls to sqlite3_value_encoding(X).
5661
+ **
5662
+ ** This routine is intended for used by applications that test and validate
5663
+ ** the SQLite implementation. This routine is inquiring about the opaque
5664
+ ** internal state of an [sqlite3_value] object. Ordinary applications should
5665
+ ** not need to know what the internal state of an sqlite3_value object is and
5666
+ ** hence should not need to use this interface.
5667
+ */
5626
5668
  SQLITE_API int sqlite3_value_encoding(sqlite3_value*);
5627
5669
 
5628
5670
  /*
@@ -7003,15 +7045,6 @@ SQLITE_API int sqlite3_cancel_auto_extension(void(*xEntryPoint)(void));
7003
7045
  */
7004
7046
  SQLITE_API void sqlite3_reset_auto_extension(void);
7005
7047
 
7006
- /*
7007
- ** The interface to the virtual-table mechanism is currently considered
7008
- ** to be experimental. The interface might change in incompatible ways.
7009
- ** If this is a problem for you, do not use the interface at this time.
7010
- **
7011
- ** When the virtual-table mechanism stabilizes, we will declare the
7012
- ** interface fixed, support it indefinitely, and remove this comment.
7013
- */
7014
-
7015
7048
  /*
7016
7049
  ** Structures used by the virtual table interface
7017
7050
  */
@@ -7130,10 +7163,10 @@ struct sqlite3_module {
7130
7163
  ** when the omit flag is true there is no guarantee that the constraint will
7131
7164
  ** not be checked again using byte code.)^
7132
7165
  **
7133
- ** ^The idxNum and idxPtr values are recorded and passed into the
7166
+ ** ^The idxNum and idxStr values are recorded and passed into the
7134
7167
  ** [xFilter] method.
7135
- ** ^[sqlite3_free()] is used to free idxPtr if and only if
7136
- ** needToFreeIdxPtr is true.
7168
+ ** ^[sqlite3_free()] is used to free idxStr if and only if
7169
+ ** needToFreeIdxStr is true.
7137
7170
  **
7138
7171
  ** ^The orderByConsumed means that output from [xFilter]/[xNext] will occur in
7139
7172
  ** the correct order to satisfy the ORDER BY clause so that no separate
@@ -7253,7 +7286,7 @@ struct sqlite3_index_info {
7253
7286
  ** the [sqlite3_vtab_collation()] interface. For most real-world virtual
7254
7287
  ** tables, the collating sequence of constraints does not matter (for example
7255
7288
  ** because the constraints are numeric) and so the sqlite3_vtab_collation()
7256
- ** interface is no commonly needed.
7289
+ ** interface is not commonly needed.
7257
7290
  */
7258
7291
  #define SQLITE_INDEX_CONSTRAINT_EQ 2
7259
7292
  #define SQLITE_INDEX_CONSTRAINT_GT 4
@@ -7412,16 +7445,6 @@ SQLITE_API int sqlite3_declare_vtab(sqlite3*, const char *zSQL);
7412
7445
  */
7413
7446
  SQLITE_API int sqlite3_overload_function(sqlite3*, const char *zFuncName, int nArg);
7414
7447
 
7415
- /*
7416
- ** The interface to the virtual-table mechanism defined above (back up
7417
- ** to a comment remarkably similar to this one) is currently considered
7418
- ** to be experimental. The interface might change in incompatible ways.
7419
- ** If this is a problem for you, do not use the interface at this time.
7420
- **
7421
- ** When the virtual-table mechanism stabilizes, we will declare the
7422
- ** interface fixed, support it indefinitely, and remove this comment.
7423
- */
7424
-
7425
7448
  /*
7426
7449
  ** CAPI3REF: A Handle To An Open BLOB
7427
7450
  ** KEYWORDS: {BLOB handle} {BLOB handles}
@@ -9625,7 +9648,7 @@ SQLITE_API int sqlite3_vtab_nochange(sqlite3_context*);
9625
9648
  ** <li><p> Otherwise, "BINARY" is returned.
9626
9649
  ** </ol>
9627
9650
  */
9628
- SQLITE_API SQLITE_EXPERIMENTAL const char *sqlite3_vtab_collation(sqlite3_index_info*,int);
9651
+ SQLITE_API const char *sqlite3_vtab_collation(sqlite3_index_info*,int);
9629
9652
 
9630
9653
  /*
9631
9654
  ** CAPI3REF: Determine if a virtual table query is DISTINCT
@@ -9782,21 +9805,20 @@ SQLITE_API int sqlite3_vtab_in(sqlite3_index_info*, int iCons, int bHandle);
9782
9805
  ** is undefined and probably harmful.
9783
9806
  **
9784
9807
  ** The X parameter in a call to sqlite3_vtab_in_first(X,P) or
9785
- ** sqlite3_vtab_in_next(X,P) must be one of the parameters to the
9808
+ ** sqlite3_vtab_in_next(X,P) should be one of the parameters to the
9786
9809
  ** xFilter method which invokes these routines, and specifically
9787
9810
  ** a parameter that was previously selected for all-at-once IN constraint
9788
9811
  ** processing use the [sqlite3_vtab_in()] interface in the
9789
9812
  ** [xBestIndex|xBestIndex method]. ^(If the X parameter is not
9790
9813
  ** an xFilter argument that was selected for all-at-once IN constraint
9791
- ** processing, then these routines return [SQLITE_MISUSE])^ or perhaps
9792
- ** exhibit some other undefined or harmful behavior.
9814
+ ** processing, then these routines return [SQLITE_ERROR].)^
9793
9815
  **
9794
9816
  ** ^(Use these routines to access all values on the right-hand side
9795
9817
  ** of the IN constraint using code like the following:
9796
9818
  **
9797
9819
  ** <blockquote><pre>
9798
9820
  ** &nbsp; for(rc=sqlite3_vtab_in_first(pList, &pVal);
9799
- ** &nbsp; rc==SQLITE_OK && pVal
9821
+ ** &nbsp; rc==SQLITE_OK && pVal;
9800
9822
  ** &nbsp; rc=sqlite3_vtab_in_next(pList, &pVal)
9801
9823
  ** &nbsp; ){
9802
9824
  ** &nbsp; // do something with pVal
@@ -9894,6 +9916,10 @@ SQLITE_API int sqlite3_vtab_rhs_value(sqlite3_index_info*, int, sqlite3_value **
9894
9916
  ** managed by the prepared statement S and will be automatically freed when
9895
9917
  ** S is finalized.
9896
9918
  **
9919
+ ** Not all values are available for all query elements. When a value is
9920
+ ** not available, the output variable is set to -1 if the value is numeric,
9921
+ ** or to NULL if it is a string (SQLITE_SCANSTAT_NAME).
9922
+ **
9897
9923
  ** <dl>
9898
9924
  ** [[SQLITE_SCANSTAT_NLOOP]] <dt>SQLITE_SCANSTAT_NLOOP</dt>
9899
9925
  ** <dd>^The [sqlite3_int64] variable pointed to by the V parameter will be
@@ -9921,12 +9947,24 @@ SQLITE_API int sqlite3_vtab_rhs_value(sqlite3_index_info*, int, sqlite3_value **
9921
9947
  ** to a zero-terminated UTF-8 string containing the [EXPLAIN QUERY PLAN]
9922
9948
  ** description for the X-th loop.
9923
9949
  **
9924
- ** [[SQLITE_SCANSTAT_SELECTID]] <dt>SQLITE_SCANSTAT_SELECT</dt>
9950
+ ** [[SQLITE_SCANSTAT_SELECTID]] <dt>SQLITE_SCANSTAT_SELECTID</dt>
9925
9951
  ** <dd>^The "int" variable pointed to by the V parameter will be set to the
9926
- ** "select-id" for the X-th loop. The select-id identifies which query or
9927
- ** subquery the loop is part of. The main query has a select-id of zero.
9928
- ** The select-id is the same value as is output in the first column
9929
- ** of an [EXPLAIN QUERY PLAN] query.
9952
+ ** id for the X-th query plan element. The id value is unique within the
9953
+ ** statement. The select-id is the same value as is output in the first
9954
+ ** column of an [EXPLAIN QUERY PLAN] query.
9955
+ **
9956
+ ** [[SQLITE_SCANSTAT_PARENTID]] <dt>SQLITE_SCANSTAT_PARENTID</dt>
9957
+ ** <dd>The "int" variable pointed to by the V parameter will be set to the
9958
+ ** the id of the parent of the current query element, if applicable, or
9959
+ ** to zero if the query element has no parent. This is the same value as
9960
+ ** returned in the second column of an [EXPLAIN QUERY PLAN] query.
9961
+ **
9962
+ ** [[SQLITE_SCANSTAT_NCYCLE]] <dt>SQLITE_SCANSTAT_NCYCLE</dt>
9963
+ ** <dd>The sqlite3_int64 output value is set to the number of cycles,
9964
+ ** according to the processor time-stamp counter, that elapsed while the
9965
+ ** query element was being processed. This value is not available for
9966
+ ** all query elements - if it is unavailable the output variable is
9967
+ ** set to -1.
9930
9968
  ** </dl>
9931
9969
  */
9932
9970
  #define SQLITE_SCANSTAT_NLOOP 0
@@ -9935,12 +9973,14 @@ SQLITE_API int sqlite3_vtab_rhs_value(sqlite3_index_info*, int, sqlite3_value **
9935
9973
  #define SQLITE_SCANSTAT_NAME 3
9936
9974
  #define SQLITE_SCANSTAT_EXPLAIN 4
9937
9975
  #define SQLITE_SCANSTAT_SELECTID 5
9976
+ #define SQLITE_SCANSTAT_PARENTID 6
9977
+ #define SQLITE_SCANSTAT_NCYCLE 7
9938
9978
 
9939
9979
  /*
9940
9980
  ** CAPI3REF: Prepared Statement Scan Status
9941
9981
  ** METHOD: sqlite3_stmt
9942
9982
  **
9943
- ** This interface returns information about the predicted and measured
9983
+ ** These interfaces return information about the predicted and measured
9944
9984
  ** performance for pStmt. Advanced applications can use this
9945
9985
  ** interface to compare the predicted and the measured performance and
9946
9986
  ** issue warnings and/or rerun [ANALYZE] if discrepancies are found.
@@ -9951,19 +9991,25 @@ SQLITE_API int sqlite3_vtab_rhs_value(sqlite3_index_info*, int, sqlite3_value **
9951
9991
  **
9952
9992
  ** The "iScanStatusOp" parameter determines which status information to return.
9953
9993
  ** The "iScanStatusOp" must be one of the [scanstatus options] or the behavior
9954
- ** of this interface is undefined.
9955
- ** ^The requested measurement is written into a variable pointed to by
9956
- ** the "pOut" parameter.
9957
- ** Parameter "idx" identifies the specific loop to retrieve statistics for.
9958
- ** Loops are numbered starting from zero. ^If idx is out of range - less than
9959
- ** zero or greater than or equal to the total number of loops used to implement
9960
- ** the statement - a non-zero value is returned and the variable that pOut
9961
- ** points to is unchanged.
9962
- **
9963
- ** ^Statistics might not be available for all loops in all statements. ^In cases
9964
- ** where there exist loops with no available statistics, this function behaves
9965
- ** as if the loop did not exist - it returns non-zero and leave the variable
9966
- ** that pOut points to unchanged.
9994
+ ** of this interface is undefined. ^The requested measurement is written into
9995
+ ** a variable pointed to by the "pOut" parameter.
9996
+ **
9997
+ ** The "flags" parameter must be passed a mask of flags. At present only
9998
+ ** one flag is defined - SQLITE_SCANSTAT_COMPLEX. If SQLITE_SCANSTAT_COMPLEX
9999
+ ** is specified, then status information is available for all elements
10000
+ ** of a query plan that are reported by "EXPLAIN QUERY PLAN" output. If
10001
+ ** SQLITE_SCANSTAT_COMPLEX is not specified, then only query plan elements
10002
+ ** that correspond to query loops (the "SCAN..." and "SEARCH..." elements of
10003
+ ** the EXPLAIN QUERY PLAN output) are available. Invoking API
10004
+ ** sqlite3_stmt_scanstatus() is equivalent to calling
10005
+ ** sqlite3_stmt_scanstatus_v2() with a zeroed flags parameter.
10006
+ **
10007
+ ** Parameter "idx" identifies the specific query element to retrieve statistics
10008
+ ** for. Query elements are numbered starting from zero. A value of -1 may be
10009
+ ** to query for statistics regarding the entire query. ^If idx is out of range
10010
+ ** - less than -1 or greater than or equal to the total number of query
10011
+ ** elements used to implement the statement - a non-zero value is returned and
10012
+ ** the variable that pOut points to is unchanged.
9967
10013
  **
9968
10014
  ** See also: [sqlite3_stmt_scanstatus_reset()]
9969
10015
  */
@@ -9973,6 +10019,19 @@ SQLITE_API int sqlite3_stmt_scanstatus(
9973
10019
  int iScanStatusOp, /* Information desired. SQLITE_SCANSTAT_* */
9974
10020
  void *pOut /* Result written here */
9975
10021
  );
10022
+ SQLITE_API int sqlite3_stmt_scanstatus_v2(
10023
+ sqlite3_stmt *pStmt, /* Prepared statement for which info desired */
10024
+ int idx, /* Index of loop to report on */
10025
+ int iScanStatusOp, /* Information desired. SQLITE_SCANSTAT_* */
10026
+ int flags, /* Mask of flags defined below */
10027
+ void *pOut /* Result written here */
10028
+ );
10029
+
10030
+ /*
10031
+ ** CAPI3REF: Prepared Statement Scan Status
10032
+ ** KEYWORDS: {scan status flags}
10033
+ */
10034
+ #define SQLITE_SCANSTAT_COMPLEX 0x0001
9976
10035
 
9977
10036
  /*
9978
10037
  ** CAPI3REF: Zero Scan-Status Counters
@@ -10063,6 +10122,10 @@ SQLITE_API int sqlite3_db_cacheflush(sqlite3*);
10063
10122
  ** function is not defined for operations on WITHOUT ROWID tables, or for
10064
10123
  ** DELETE operations on rowid tables.
10065
10124
  **
10125
+ ** ^The sqlite3_preupdate_hook(D,C,P) function returns the P argument from
10126
+ ** the previous call on the same [database connection] D, or NULL for
10127
+ ** the first call on D.
10128
+ **
10066
10129
  ** The [sqlite3_preupdate_old()], [sqlite3_preupdate_new()],
10067
10130
  ** [sqlite3_preupdate_count()], and [sqlite3_preupdate_depth()] interfaces
10068
10131
  ** provide additional information about a preupdate event. These routines
@@ -10468,6 +10531,19 @@ SQLITE_API int sqlite3_deserialize(
10468
10531
  # undef double
10469
10532
  #endif
10470
10533
 
10534
+ #if defined(__wasi__)
10535
+ # undef SQLITE_WASI
10536
+ # define SQLITE_WASI 1
10537
+ # undef SQLITE_OMIT_WAL
10538
+ # define SQLITE_OMIT_WAL 1/* because it requires shared memory APIs */
10539
+ # ifndef SQLITE_OMIT_LOAD_EXTENSION
10540
+ # define SQLITE_OMIT_LOAD_EXTENSION
10541
+ # endif
10542
+ # ifndef SQLITE_THREADSAFE
10543
+ # define SQLITE_THREADSAFE 0
10544
+ # endif
10545
+ #endif
10546
+
10471
10547
  #ifdef __cplusplus
10472
10548
  } /* End of the 'extern "C"' block */
10473
10549
  #endif
@@ -359,6 +359,8 @@ struct sqlite3_api_routines {
359
359
  const char *(*db_name)(sqlite3*,int);
360
360
  /* Version 3.40.0 and later */
361
361
  int (*value_encoding)(sqlite3_value*);
362
+ /* Version 3.41.0 and later */
363
+ int (*is_interrupted)(sqlite3*);
362
364
  };
363
365
 
364
366
  /*
@@ -685,6 +687,8 @@ typedef int (*sqlite3_loadext_entry)(
685
687
  #define sqlite3_db_name sqlite3_api->db_name
686
688
  /* Version 3.40.0 and later */
687
689
  #define sqlite3_value_encoding sqlite3_api->value_encoding
690
+ /* Version 3.41.0 and later */
691
+ #define sqlite3_is_interrupted sqlite3_api->is_interrupted
688
692
  #endif /* !defined(SQLITE_CORE) && !defined(SQLITE_OMIT_LOAD_EXTENSION) */
689
693
 
690
694
  #if !defined(SQLITE_CORE) && !defined(SQLITE_OMIT_LOAD_EXTENSION)
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -10,13 +10,13 @@ module Amalgalite
10
10
 
11
11
  # major version number of the SQLite C library
12
12
  MAJOR = (to_i / 1_000_000).freeze
13
-
13
+
14
14
  # minor version number of the SQLite C library
15
15
  MINOR = ((to_i % 1_000_000) / 1_000).freeze
16
-
16
+
17
17
  # release version number of the SQLite C library
18
18
  RELEASE = (to_i % 1_000).freeze
19
-
19
+
20
20
  #
21
21
  # call-seq:
22
22
  # Amalgalite::SQLite3::Version.to_a -> [ MAJOR, MINOR, RELEASE ]
@@ -4,5 +4,5 @@
4
4
  #++
5
5
 
6
6
  module Amalgalite
7
- VERSION = "1.8.0"
7
+ VERSION = "1.9.1"
8
8
  end
data/lib/amalgalite.rb CHANGED
@@ -21,7 +21,7 @@ end
21
21
  # this is the method recommended by rake-compiler
22
22
  begin
23
23
  # this will be for windows
24
- require "amalgalite/#{RUBY_VERSION.sub(/\.\d$/,'')}/amalgalite"
24
+ require "amalgalite/#{RUBY_VERSION.sub(/\.\d+$/,'')}/amalgalite"
25
25
  rescue LoadError
26
26
  # everyone else.
27
27
  require 'amalgalite/amalgalite'
@@ -7,21 +7,21 @@ describe "Amalgalite::SQLite3::Version" do
7
7
  expect(Amalgalite::SQLite3::Version.to_s).to match( /\d+\.\d+\.\d+/ )
8
8
  expect(Amalgalite::SQLite3::Version.runtime_version).to match( /\d+\.\d+\.\d+/ )
9
9
 
10
- Amalgalite::SQLite3::Version.to_i.should eql(3040001)
11
- Amalgalite::SQLite3::Version.runtime_version_number.should eql(3040001)
10
+ Amalgalite::SQLite3::Version.to_i.should eql(3041002)
11
+ Amalgalite::SQLite3::Version.runtime_version_number.should eql(3041002)
12
12
 
13
13
  Amalgalite::SQLite3::Version::MAJOR.should eql(3)
14
- Amalgalite::SQLite3::Version::MINOR.should eql(40)
15
- Amalgalite::SQLite3::Version::RELEASE.should eql(1)
14
+ Amalgalite::SQLite3::Version::MINOR.should eql(41)
15
+ Amalgalite::SQLite3::Version::RELEASE.should eql(2)
16
16
  expect(Amalgalite::SQLite3::Version.to_a.size).to eql(3)
17
17
 
18
- Amalgalite::SQLite3::Version.compiled_version.should be == "3.40.1"
19
- Amalgalite::SQLite3::Version.compiled_version_number.should be == 3040001
18
+ Amalgalite::SQLite3::Version.compiled_version.should be == "3.41.2"
19
+ Amalgalite::SQLite3::Version.compiled_version_number.should be == 3041002
20
20
  Amalgalite::SQLite3::Version.compiled_matches_runtime?.should be == true
21
21
  end
22
22
 
23
23
  it "should have the sqlite3 source id" do
24
- source_id = "2022-12-28 14:03:47 df5c253c0b3dd24916e4ec7cf77d3db5294cc9fd45ae7b9c5e82ad8197f38a24"
24
+ source_id = "2023-03-22 11:56:21 0d1fc92f94cb6b76bffe3ec34d69cffde2924203304e8ffc4155597af0c191da"
25
25
  Amalgalite::SQLite3::Version.compiled_source_id.should be == source_id
26
26
  Amalgalite::SQLite3::Version.runtime_source_id.should be == source_id
27
27
  end
data/tasks/default.rake CHANGED
@@ -37,13 +37,20 @@ task :develop => "develop:default"
37
37
  #------------------------------------------------------------------------------
38
38
  begin
39
39
  require 'rspec/core/rake_task'
40
+ junit_output = ENV.fetch('TEST_RESULTS_FILE', 'tmp/report.xml')
40
41
  RSpec::Core::RakeTask.new( :test ) do |t|
41
42
  t.ruby_opts = %w[ -w ]
42
43
  t.rspec_opts = %w[
43
44
  --color
44
45
  --format documentation
45
- --format RspecJunitFormatter --out tmp/report.xml
46
46
  ]
47
+
48
+ if junit_output = ENV['TEST_RESULTS_FILE'] then
49
+ t.rspec_opts << '--format'
50
+ t.rspec_opts << 'RspecJunitFormatter'
51
+ t.rspec_opts << '--out'
52
+ t.rspec_opts << junit_output
53
+ end
47
54
  end
48
55
  task :test_requirements
49
56
  task :test => :test_requirements
@@ -145,14 +152,20 @@ namespace :fixme do
145
152
  end
146
153
 
147
154
  def local_fixme_files
148
- This.manifest.select { |p| p =~ %r|^tasks/| }
155
+ local_files = This.manifest.select { |p| p =~ %r|^tasks/| }
156
+ local_files << ".semaphore/semaphore.yml"
149
157
  end
150
158
 
151
159
  def outdated_fixme_files
152
160
  local_fixme_files.select do |local|
153
161
  upstream = fixme_project_path( local )
154
- upstream.exist? &&
155
- ( Digest::SHA256.file( local ) != Digest::SHA256.file( upstream ) )
162
+ if upstream.exist? then
163
+ if File.exist?( local ) then
164
+ ( Digest::SHA256.file( local ) != Digest::SHA256.file( upstream ) )
165
+ else
166
+ true
167
+ end
168
+ end
156
169
  end
157
170
  end
158
171
 
data/tasks/this.rb CHANGED
@@ -146,7 +146,7 @@ class ThisProject
146
146
  spec.rdoc_options = [ "--main" , 'README.md',
147
147
  "--markup", "tomdoc" ]
148
148
 
149
- spec.required_ruby_version = '>= 2.2.2'
149
+ spec.required_ruby_version = '>= 2.3.0'
150
150
  end
151
151
  end
152
152
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: amalgalite
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.8.0
4
+ version: 1.9.1
5
5
  platform: x86-mingw32
6
6
  authors:
7
7
  - Jeremy Hinegardner
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-02-06 00:00:00.000000000 Z
11
+ date: 2023-04-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: arrayfields