Compare commits

...

43 Commits

Author SHA1 Message Date
drh c850c2be75 Add two new sqlite3_db_config() options that enable the ATTACH command
to create new database files and to open databases read/write.  Both
default to on for backwards compatibility.

FossilOrigin-Name: fe0c58d00b491d1af7c0894f5c32542954aeea2e6510853b3bcbf13ac0bf5ce0
2025-01-22 19:37:47 +00:00
drh 9489aefb83 Add the -q/--quiet option to test/speedtest.tcl. Automatically enable
-DSQLITE_OMIT_LOAD_EXTENSION and -DSQLITE_THREADSAFE=0 so that no extra
libraries are required.

FossilOrigin-Name: c20d21b473d8a45267262c5df1d7b102eccce8e4cfbe1e467ea66c474aea0af5
2025-01-22 17:18:53 +00:00
drh 255548562b Fix date/time computations to deal with the sub-millisecond rounding
problem identified in [forum:/forumpost/766a2c9231|forum post 766a2c9231].

FossilOrigin-Name: afb0a5923a6db4045fab5226198aab970d746d4866294ebba943c6986e97ecde
2025-01-21 17:37:58 +00:00
drh 8e7a16895c Performance improvements to the (debug-use only) Mem.pScopyFrom logic, resulting
in about 8x faster performance under -DSQLITE_DEBUG for the query in from
[forum:/forumpost/0025389d0860af82|forum post 0025389d0860af82].  This change
only affects builds that use -DSQLITE_DEBUG.

FossilOrigin-Name: 7fb1ae25d1572dd7709a0f850c148a5f745a524f01ea231e29a1ebc37c173fb9
2025-01-21 16:30:55 +00:00
drh 2e899ccaff The FuncDev.nArg field values -3 and -4 now have special meansing of 1 or more
or 2 or more arguments, respectively.  This saves space in the built-in
function table, resulting in slightly faster performance and a reduced binary
size.

FossilOrigin-Name: 753fd747f24c5e9a019eb00b8a4f66e65c6733ba10a7adbd1b55786867c32ca6
2025-01-21 15:12:00 +00:00
dan b80d01a182 Have fts5 better handle OOM errors from sqlite3_blob_close().
FossilOrigin-Name: f418350f3f83147bc5817a885be6e39ff9ff5722742a88d17600729c53c65010
2025-01-21 14:34:59 +00:00
drh d0db5edf61 Use Tcl_GetString() instead of Tcl_GetCharLength() to test for a zero-length
string in the TCL interface, since that is much more efficient.

FossilOrigin-Name: a8d9dcfd23fbfcd887e451382836c1e88215984cc01e00be11387dbf4ab26fd8
2025-01-21 11:10:16 +00:00
drh c69d537b93 Remove an assert() in the unix file locking logic that is not true
if alternative VFS "unix-excl" is used for a read-only connection.

FossilOrigin-Name: bd5dc92368e41231a07bb59dd3db8942e238129ec7a3c8d785459d9b62bfcba3
2025-01-20 19:19:31 +00:00
dan 467e20ad1d Fix an assert() that could fail if a virtual table called sqlite3_step() from within the xSync() method while committing a "PRAGMA defer_foreign_keys=1" transaction.
FossilOrigin-Name: 39bdbb3f6dd1d30d180526d35c11f789f5e9d45b99ead72fd4a3b136afab66b1
2025-01-20 18:26:58 +00:00
stephan e9763e4ed7 configure script: remove an overzealous is-a-file check in the tclsh search which fails to account for implicit .exe extensions on Windows builds. Reported in [forum:c27403ef974df9f1|forum post c27403ef974df9f1]. (Same change as [89306d1a4905] but to a different file, as that content was moved since the 3.48 release.)
FossilOrigin-Name: 239a3d1573f4cb720308018280b2add54034e69e38fe7060a7238875eee4f1c9
2025-01-20 16:14:09 +00:00
drh 3640785453 Add an SQLITE_TESTCTRL_OPTIMIZATION mask that can disable the query planner
heuristics that are designed to help with star queries.

FossilOrigin-Name: fec4ff185a2f3f1bee8f27432206276636cf27365d2d41cd7282f8c0425f2e96
2025-01-19 19:14:21 +00:00
stephan c6a39debf9 Further refactoring of auto.def to simplify creation of variant builds like the autoconf bundle.
FossilOrigin-Name: f806c563a29240c709508316846fbe0cb3ed61b68a6c1d9544eb699e30141d8d
2025-01-19 18:32:45 +00:00
stephan 815709dd00 Minor internal refactoring of auto.def to support the pending autoconf subdir port to autosetup. No functional changes.
FossilOrigin-Name: 01ff37584708f3f79c62c1b5ed8cceab721cf8348a69a65f0559b1ef8845e85b
2025-01-19 16:26:25 +00:00
stephan 6cd83aecb9 Move some of the auto.def functions into autosetup/sqlite-config.tcl for re-use in the pending migration of the autoconf bundle to autosetup. This is just reorg, no functional changes.
FossilOrigin-Name: 2f1e94994f3595baad4045ab05ffee0668059c23ab37a39c25b83c62bfbaea28
2025-01-19 14:53:45 +00:00
drh 8291cd78f2 Enable automatic query-time indexes for WITHOUT ROWID tables.
FossilOrigin-Name: 8534af5b94be9f5b1f02453e1c3b6b3f78a698af91595bdbbfdea00676510116
2025-01-18 23:44:06 +00:00
drh 0f4de9bf9d Add a simple test case (many more are coming soon to TH3). Fix an obsolete
assert().

FossilOrigin-Name: aa829a131a3431791083cf60d9cf00e7b3c0fafdd39a23e761b629a2287ab875
2025-01-18 21:19:02 +00:00
drh 50c4420030 Add support for automatic query-time indexes on WITHOUT ROWID tables.
FossilOrigin-Name: 89c4cbd9529081941d7283a401c4a8d71b241f4577ebf6d3eb2ebe5a1cf92f2e
2025-01-18 21:00:19 +00:00
stephan 1a1fe1d1da When cross-compiling, change the CFLAGS default to exclude -g, per /chat discussion prompted by [forum:9a67df63eda9925c|forum post 9a67df63eda9925c].
FossilOrigin-Name: 4309da2ca5cb99ea81f3034ae3c5809187c0131d21f9f9469ea0d69c941f393e
2025-01-18 16:05:38 +00:00
stephan e52cdadea7 When running make install, avoid the -s (strip) flag when cross-compiling, as it only works for the build platform. Reported in [forum:9a67df63eda9925c|forum post 9a67df63eda9925c].
FossilOrigin-Name: 230e49c10e3aa6fe9c487a1e026016a8bf97f7e736e7477d5976d987da5e83cf
2025-01-18 13:51:01 +00:00
drh e432f2a316 For the purpose of the query planner heuristic added by [38db9b5c83], a query
should only count as a star query if the fact tables are connected to the
dimension table by an INNER JOIN.  If a LEFT JOIN is used, then the fact
tables are constrained to be in inner loops anyhow and so the heuristic does
not make any sense.  But it does interfere with AUTOMATIC index creation, which
causes the performance regression reported by
[forum:/forumpost/d87570a145599033|forum post d87570a1455].

FossilOrigin-Name: 0852c57ee2768224af79910e6f26e70a4962651dae0f8b45cbfc847e6707d7bb
2025-01-17 23:49:40 +00:00
drh f462046cd1 Enhance a comment on a test case to add recent context.
FossilOrigin-Name: c2647d1bd16fd46dd03953afee6cad44ce14fa2c36713c487b678d63660bc072
2025-01-17 17:09:42 +00:00
stephan 0887b70286 Typo fix in speedtest.md.
FossilOrigin-Name: 36027cf340fe2e351c63129d069f9bced090c4a028ffd78d5b8c0f418ad9f230
2025-01-17 15:56:16 +00:00
drh ada3470075 Improvements to the speedtest.tcl script. Add documentation on how to use the
script.

FossilOrigin-Name: eb3853d08141bf941193e8ecaf991191bb7fb46287818708a84018520eb1835e
2025-01-17 15:39:48 +00:00
drh e024421624 Add the test/speedtest.tcl script to simplify performance and size testing.
FossilOrigin-Name: ad7b38672656d0336a73bb789ec83f6939fbdae81e21be68e0313006826dc294
2025-01-17 12:32:01 +00:00
drh d0c6c6586e Fix a potential one-byte buffer overrun when reading from the Windows
console in the CLI. [forum:/forumpost/95e17b8f5c|Forum post 95e17b8f5c].

FossilOrigin-Name: 4d96759694c91301410f53a3f737a049c33e8b259b0954ff659714aff8b21ae8
2025-01-17 10:39:04 +00:00
drh 1425bae1ab speedtest1: further improvements to the "json" testset.
FossilOrigin-Name: c4750f7cf7e2188623de8b12e01acf3e3d7dc7b5ea87ac449571eb36f97d842a
2025-01-16 20:46:08 +00:00
drh 7edb0c3920 speedtest1: Improvements to the "json" testset. Better balance in "mix1".
FossilOrigin-Name: 2cc73c5e08f1a16fe8accf0af6af061e42d27635883d09234516fd470e99bc0a
2025-01-16 20:08:59 +00:00
drh c957673bf7 Revamp the "json" testset in speedtest1.
FossilOrigin-Name: d33508836bc88314a205bfa9d80f3ebe695163cf0c46d500ad674535975408fb
2025-01-16 17:19:06 +00:00
drh bfa7218982 Add the "json" test case to speedtest1 and include it in "mix1".
FossilOrigin-Name: 2db3a3ee37a9d2fe9b94d16d35c24846c37abe73b89cde4dd763e01a2bfaa8b7
2025-01-16 14:37:48 +00:00
drh 4a25b740f2 Speedtest1 enhancements: (1) Add the ability to scale performance of
tests sets using "/NNN" after the testset name, even for testsets in a
comma-separated list.  (2) Add the "mix1" macro testset.

FossilOrigin-Name: 85667b3a572bc9afd8c862a0b2c5f47f76ca80d6e61302ca7d7c1b326d3dd578
2025-01-16 14:06:29 +00:00
stephan ec50c5a2a4 wasm: after generating the .js/.mjs file, strip out all of the generated pieces which create Emscripten call() bindings for the sqlite3 APIs, as we don't use those binding, so both the setup time and the memory they use installing WASM proxy bindings is wasted. This eliminates some 200 superfluous/unused bindings from the init process.
FossilOrigin-Name: 020d2c7528be6f11a5b2b849d7b2f04e47abe2b0842520ff60eb7defb3768e1c
2025-01-16 13:10:06 +00:00
stephan b6953280e7 When generating the autoconf snapshot, replaces the Libs.private line from sqlite3.pc.in with one compatible with the legacy build, as reported in [forum:e40b9b424a|forum post e40b9b424a].
FossilOrigin-Name: fe47154799bfefb12eb1209d9ada64ecac38bee1b7c3558d175215a2beba991d
2025-01-16 12:15:51 +00:00
stephan 3202b11f66 Replace use of Emscripten's Module.postRun() with a custom callback so that we get consistent library init timing with both Emscripten 3.1.x and 4.0.x. Details and discussion are in [https://github.com/emscripten-core/emscripten/issues/23420|Emscripten ticket #23420].
FossilOrigin-Name: 4863a70ac61ff6f868429f16f0141484ea98f973fde1a9aff879252d0f1dbb6b
2025-01-16 09:27:40 +00:00
drh c5dd908c89 When two indexes have the same cost, use the narrower one (the one with the
smaller average on-disk row width).

FossilOrigin-Name: 398559678f2b9a65b245ed73b4d512c4fccc69d42b5a6a1c1b7755a80b69d073
2025-01-16 01:47:03 +00:00
drh 65d0312c96 Check-in [da9124fee28c155c] broken the new SQLITE_IOCAP_SUBPAGE_READ mechanism
for inhibiting direct-overflow-read.  This check-in fixes the problem.

FossilOrigin-Name: 113078d555eaf740666680562ebbb04f7d823b72e8b2d553627e54ab3d7bf653
2025-01-15 21:13:38 +00:00
stephan 3ba9adc5c1 Teach tool/stripccomments.c that a backslash immediately preceeding a forward slash means that that forward slash cannot be the start of a comment. This is intended to allow JavaScript regular expressions containing \/* (like [https://github.com/emscripten-core/emscripten/issues/23412|the one introduced in emsdk 4.0.0]) to pass through properly. Re-enable comment-stripping in the JS dist builds.
FossilOrigin-Name: db21d6cc9d1c425deffc0e4e92173caf586e6ac66110c71a4930b21e3e7f84b9
2025-01-15 21:09:19 +00:00
stephan c738052394 Work around [https://github.com/emscripten-core/emscripten/issues/23420|a behavior change in emsdk 4.0.0] which breaks the load/init timing of the wasm module.
FossilOrigin-Name: 00a750184bcf1a94bf4e7f1d5029a42671e87e2997ae97be07bd900d3702883d
2025-01-15 20:53:14 +00:00
drh d1047faad6 When choosing between two indexes with the same cost, pick the one with the
smaller predicted number of bytes per row.

FossilOrigin-Name: d4bd0d4214551f88f248698fefc821575b722ce5c194d0b3796f572e4704f641
2025-01-15 20:23:22 +00:00
drh 874b5e9fbb Variable names and conditional logic simplified in where.c. These
changes are cosmetic only and do not affect the resuling machine code.

FossilOrigin-Name: dbc2d6a244fdafd208239894dbdd8f139db6ca20dd8f1ed00d87028e0cb60570
2025-01-15 19:30:10 +00:00
stephan 73d9eb1bb3 Fix a typo in a wasm makefile var name, noting that this doesn't actually fix anything because the var in question is not used when building 'clean' or 'distclean'.
FossilOrigin-Name: 7cfc75a625095e41c3e952d4a209fdbb344df0d3dd9b0103e9e6a986dfe53c89
2025-01-15 15:27:02 +00:00
stephan 4ea86ac0e3 Disable the C-style comment stripper in the JS dist build, as explained in [forum:529c20d344|forum post 529c20d344].
FossilOrigin-Name: a9475e7614f8e44252abf273d0e0522c247df12624e40108ce98ad4aaf320f2d
2025-01-15 14:28:56 +00:00
drh 0609cf85fd Change the version number to 3.49.0 to begin the next development
cycle.  Any patches to 3.48.0 will go on a branch.

FossilOrigin-Name: 8165a3d3a40c5b43275fb4b1cdf57c44a57cd56c514bd2a550deac26a14795eb
2025-01-14 20:47:23 +00:00
drh 290caec8e3 Trying to remove a warning from some compiler that I do not have access to.
FossilOrigin-Name: bc6de90c7049dd429a82d32b186a838f4a21aa7b8a83418eaf0416d19771b41e
2025-01-14 16:10:13 +00:00
49 changed files with 2284 additions and 1391 deletions
+1
View File
@@ -335,4 +335,5 @@ distclean: distclean-autosetup
version-info$(T.exe): $(TOP)/tool/version-info.c Makefile sqlite3.h
$(T.link) $(ST_OPT) -o $@ $(TOP)/tool/version-info.c
IS_CROSS_COMPILING = @IS_CROSS_COMPILING@
include $(TOP)/main.mk
+1 -1
View File
@@ -1 +1 @@
3.48.0
3.49.0
+48 -1199
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -19,7 +19,7 @@ dnl to configure the system for the local environment.
# so that we create the export library with the dll.
#-----------------------------------------------------------------------
AC_INIT([sqlite],[3.48.0])
AC_INIT([sqlite],[3.49.0])
#--------------------------------------------------------------------
# Call TEA_INIT as the first TEA_ macro to set up initial vars.
+2 -2
View File
@@ -184,7 +184,7 @@ proc proj-lshift_ {listVar {count 1}} {
# out any lines which begin with an number of whitespace followed by a
# '#', and returns a value containing the [append]ed results of each
# remaining line with a \n between each.
proc proj-strip-hash-comments_ {val} {
proc proj-strip-hash-comments {val} {
set x {}
foreach line [split $val \n] {
if {![string match "#*" [string trimleft $line]]} {
@@ -1119,7 +1119,7 @@ proc proj-dump-defs-json {file args} {
# that [opt-value canonical] will return X if --alias=X is passed to
# configure.
proc proj-xfer-options-aliases {mapping} {
foreach {hidden - canonical} [proj-strip-hash-comments_ $mapping] {
foreach {hidden - canonical} [proj-strip-hash-comments $mapping] {
if {[proj-opt-was-provided $hidden]} {
if {[proj-opt-was-provided $canonical]} {
proj-fatal "both --$canonical and its alias --$hidden were used. Use only one or the other."
File diff suppressed because it is too large Load Diff
+35 -18
View File
@@ -778,11 +778,13 @@ static int fts5LeafFirstTermOff(Fts5Data *pLeaf){
/*
** Close the read-only blob handle, if it is open.
*/
void sqlite3Fts5IndexCloseReader(Fts5Index *p){
void fts5IndexCloseReader(Fts5Index *p){
if( p->pReader ){
int rc;
sqlite3_blob *pReader = p->pReader;
p->pReader = 0;
sqlite3_blob_close(pReader);
rc = sqlite3_blob_close(pReader);
if( p->rc==SQLITE_OK ) p->rc = rc;
}
}
@@ -807,7 +809,7 @@ static Fts5Data *fts5DataRead(Fts5Index *p, i64 iRowid){
assert( p->pReader==0 );
p->pReader = pBlob;
if( rc!=SQLITE_OK ){
sqlite3Fts5IndexCloseReader(p);
fts5IndexCloseReader(p);
}
if( rc==SQLITE_ABORT ) rc = SQLITE_OK;
}
@@ -5009,6 +5011,14 @@ static int fts5IndexReturn(Fts5Index *p){
return rc;
}
/*
** Close the read-only blob handle, if it is open.
*/
void sqlite3Fts5IndexCloseReader(Fts5Index *p){
fts5IndexCloseReader(p);
fts5IndexReturn(p);
}
typedef struct Fts5FlushCtx Fts5FlushCtx;
struct Fts5FlushCtx {
Fts5Index *pIdx;
@@ -6730,7 +6740,7 @@ int sqlite3Fts5IndexBeginWrite(Fts5Index *p, int bDelete, i64 iRowid){
int sqlite3Fts5IndexSync(Fts5Index *p){
assert( p->rc==SQLITE_OK );
fts5IndexFlush(p);
sqlite3Fts5IndexCloseReader(p);
fts5IndexCloseReader(p);
return fts5IndexReturn(p);
}
@@ -6741,11 +6751,10 @@ int sqlite3Fts5IndexSync(Fts5Index *p){
** records must be invalidated.
*/
int sqlite3Fts5IndexRollback(Fts5Index *p){
sqlite3Fts5IndexCloseReader(p);
fts5IndexCloseReader(p);
fts5IndexDiscardData(p);
fts5StructureInvalidate(p);
/* assert( p->rc==SQLITE_OK ); */
return SQLITE_OK;
return fts5IndexReturn(p);
}
/*
@@ -6946,6 +6955,16 @@ static void fts5SegIterSetEOF(Fts5SegIter *pSeg){
pSeg->pLeaf = 0;
}
void fts5IterClose(Fts5IndexIter *pIndexIter){
if( pIndexIter ){
Fts5Iter *pIter = (Fts5Iter*)pIndexIter;
Fts5Index *pIndex = pIter->pIndex;
fts5TokendataIterDelete(pIter->pTokenDataIter);
fts5MultiIterFree(pIter);
fts5IndexCloseReader(pIndex);
}
}
/*
** This function appends iterator pAppend to Fts5TokenDataIter pIn and
** returns the result.
@@ -6973,7 +6992,7 @@ static Fts5TokenDataIter *fts5AppendTokendataIter(
}
}
if( p->rc ){
sqlite3Fts5IterClose((Fts5IndexIter*)pAppend);
fts5IterClose((Fts5IndexIter*)pAppend);
}else{
pRet->apIter[pRet->nIter++] = pAppend;
}
@@ -7186,7 +7205,7 @@ static Fts5Iter *fts5SetupTokendataIter(
fts5BufferSet(&p->rc, &bSeek, nToken, pToken);
}
if( p->rc ){
sqlite3Fts5IterClose((Fts5IndexIter*)pNew);
fts5IterClose((Fts5IndexIter*)pNew);
break;
}
@@ -7251,7 +7270,7 @@ static Fts5Iter *fts5SetupTokendataIter(
** not point to any terms that match the query. So delete it and break
** out of the loop - all required iterators have been collected. */
if( pSmall==0 ){
sqlite3Fts5IterClose((Fts5IndexIter*)pNew);
fts5IterClose((Fts5IndexIter*)pNew);
break;
}
@@ -7380,9 +7399,9 @@ int sqlite3Fts5IndexQuery(
}
if( p->rc ){
sqlite3Fts5IterClose((Fts5IndexIter*)pRet);
fts5IterClose((Fts5IndexIter*)pRet);
pRet = 0;
sqlite3Fts5IndexCloseReader(p);
fts5IndexCloseReader(p);
}
*ppIter = (Fts5IndexIter*)pRet;
@@ -7632,11 +7651,9 @@ int sqlite3Fts5IndexIterWriteTokendata(
*/
void sqlite3Fts5IterClose(Fts5IndexIter *pIndexIter){
if( pIndexIter ){
Fts5Iter *pIter = (Fts5Iter*)pIndexIter;
Fts5Index *pIndex = pIter->pIndex;
fts5TokendataIterDelete(pIter->pTokenDataIter);
fts5MultiIterFree(pIter);
sqlite3Fts5IndexCloseReader(pIndex);
Fts5Index *pIndex = ((Fts5Iter*)pIndexIter)->pIndex;
fts5IterClose(pIndexIter);
fts5IndexReturn(pIndex);
}
}
@@ -8166,7 +8183,7 @@ static int fts5QueryCksum(
rc = sqlite3Fts5IterNext(pIter);
}
}
sqlite3Fts5IterClose(pIter);
fts5IterClose(pIter);
*pCksum = cksum;
return rc;
+35
View File
@@ -290,5 +290,40 @@ do_faultsim_test 11 -faults oom* -prep {
faultsim_test_result {0 {}}
}
#-------------------------------------------------------------------------
reset_db
ifcapable foreignkey {
do_execsql_test 12.0 {
CREATE VIRTUAL TABLE f1 USING fts5(content);
CREATE TABLE p1(a INTEGER PRIMARY KEY);
CREATE TABLE c1(b REFERENCES p1 DEFERRABLE INITIALLY DEFERRED);
}
faultsim_save_and_close
do_faultsim_test 11 -faults oom* -prep {
faultsim_restore_and_reopen
execsql {
PRAGMA foreign_keys = 1;
BEGIN;
INSERT INTO c1 VALUES(123);
SAVEPOINT xyz;
}
} -body {
execsql {
INSERT INTO f1 VALUES('a b c');
ROLLBACK TO xyz;
COMMIT;
}
} -test {
execsql { SELECT 123 }
faultsim_test_result \
{1 {FOREIGN KEY constraint failed}} \
{1 {out of memory}} \
{1 {constraint failed}}
}
}
finish_test
+21 -1
View File
@@ -591,7 +591,6 @@ do_execsql_test 21.2 {
PRAGMA integrity_check
} {ok}
breakpoint
sqlite3_db_config db DEFENSIVE 1
do_execsql_test 21.3 {
CREATE TABLE xyz_notashadow(x, y);
@@ -665,5 +664,26 @@ do_execsql_test 25.0 {
SELECT fts5_test_poslist(t1) FROM t1('b') ORDER BY rank;
} {{}}
#-------------------------------------------------------------------------
reset_db
do_execsql_test 26.0 {
PRAGMA foreign_keys = ON;
CREATE TABLE t1(x INTEGER PRIMARY KEY);
CREATE TABLE t2(y INTEGER PRIMARY KEY,
z INTEGER REFERENCES t1(x) DEFERRABLE INITIALLY DEFERRED
);
CREATE VIRTUAL TABLE t3 USING fts5(a, b, content='', tokendata=1);
}
do_execsql_test 26.1 {
BEGIN;
INSERT INTO t2 VALUES(1,111);
INSERT INTO t3 VALUES(3,3);
PRAGMA defer_foreign_keys=ON;
DELETE FROM t2 WHERE y+1;
COMMIT;
}
finish_test
+1 -1
View File
@@ -198,7 +198,7 @@ static u8* fromBase64( char *pIn, int ncIn, u8 *pOut ){
deliberate_fall_through; /* FALLTHRU */
case 1:
pOut[0] = (qv>>16) & 0xff;
deliberate_fall_through; /* FALLTHRU */
break;
}
pOut += nbo;
}
+1 -1
View File
@@ -151,7 +151,7 @@ char *sqlite3_fgets(char *buf, int sz, FILE *in){
#ifndef SQLITE_USE_STDIO_FOR_CONSOLE
DWORD nRead = 0;
if( IsConsole(in)
&& ReadConsoleW(GetStdHandle(STD_INPUT_HANDLE), b1, sz, &nRead, 0)
&& ReadConsoleW(GetStdHandle(STD_INPUT_HANDLE), b1, sz-1, &nRead, 0)
){
b1[nRead] = 0;
}else
+2 -1
View File
@@ -185,7 +185,7 @@ endif
# Find wasm-strip, which we need for release builds (see below for
# why) but not strictly for non-release builds.
ifeq (1,$(MAKING_CLEAN))
wasm-strip-bin := irrelevant
wasm-strip.bin := irrelevant
else
wasm-strip.bin ?= $(shell which wasm-strip 2>/dev/null)
ifeq (,$(wasm-strip.bin))
@@ -1052,6 +1052,7 @@ $(speedtest1.js): $(MAKEFILE) $(speedtest1.cfiles) \
$(speedtest1.exit-runtime0) \
-o $@ $(speedtest1.cfiles) -lm
$(maybe-wasm-strip) $(speedtest1.wasm)
sed -i -e '/^var _sqlite3.*createExportWrapper/d' $@
chmod -x $(speedtest1.wasm)
ls -la $@ $(speedtest1.wasm)
+12 -8
View File
@@ -12,6 +12,7 @@
const toExportForESM =
//#endif
(function(){
//console.warn("this is extern-post-js");
/**
In order to hide the sqlite3InitModule()'s resulting
Emscripten module from downstream clients (and simplify our
@@ -62,6 +63,16 @@ const toExportForESM =
globalThis.sqlite3InitModule = function ff(...args){
//console.warn("Using replaced sqlite3InitModule()",globalThis.location);
return originalInit(...args).then((EmscriptenModule)=>{
//console.warn("originalInit() then() arg =",EmscriptenModule);
//console.warn("initModuleState =",initModuleState);
EmscriptenModule.runSQLite3PostLoadInit(EmscriptenModule);
const s = EmscriptenModule.sqlite3;
s.scriptInfo = initModuleState;
//console.warn("sqlite3.scriptInfo =",s.scriptInfo);
if(ff.__isUnderTest) s.__isUnderTest = true;
const f = s.asyncPostInit;
delete s.asyncPostInit;
const rv = f();
//#if wasmfs
if('undefined'!==typeof WorkerGlobalScope &&
EmscriptenModule['ENVIRONMENT_IS_PTHREAD']){
@@ -74,14 +85,7 @@ const toExportForESM =
return EmscriptenModule;
}
//#endif
//console.warn("sqlite3InitModule() returning sqlite3 object.");
const s = EmscriptenModule.sqlite3;
s.scriptInfo = initModuleState;
//console.warn("sqlite3.scriptInfo =",s.scriptInfo);
if(ff.__isUnderTest) s.__isUnderTest = true;
const f = s.asyncPostInit;
delete s.asyncPostInit;
return f();
return rv;
}).catch((e)=>{
console.error("Exception loading sqlite3 module:",e);
throw e;
+3 -1
View File
@@ -1,4 +1,6 @@
/* The current function scope was opened via post-js-header.js, which
gets prepended to this at build-time. This file closes that
scope. */
})/*postRun.push(...)*/;
//console.warn("This is the end of the Module.runSQLite3PostLoadInit handler.");
}/*Module.runSQLite3PostLoadInit()*/;
//console.warn("This is the end of the setup of the (pending) Module.runSQLite3PostLoadInit");
+9 -4
View File
@@ -7,17 +7,22 @@
installs will be run after the WASM module is loaded, at which
point the sqlite3 JS API bits will get set up.
*/
if(!Module.postRun) Module.postRun = [];
Module.postRun.push(function(Module/*the Emscripten-style module object*/){
Module.runSQLite3PostLoadInit = function(EmscriptenModule/*the Emscripten-style module object*/){
/** ^^^ As don't use Module.postRun, as that runs a different time
depending on whether this file is built with emcc 3.1.x or
4.0.x. This function name is intentionally obnoxiously verbose to
ensure that we don't collide with current and future Emscripten
symbol names. */
'use strict';
//console.warn("This is the start of the Module.postRun handler.");
/* This function will contain at least the following:
- post-js-header.js (this file)
- sqlite3-api-prologue.js => Bootstrapping bits to attach the rest to
- common/whwasmutil.js => Replacements for much of Emscripten's glue
- jaccwaby/jaccwabyt.js => Jaccwabyt (C/JS struct binding)
- jaccwabyt/jaccwabyt.js => Jaccwabyt (C/JS struct binding)
- sqlite3-api-glue.js => glues previous parts together
- sqlite3-api-oo.js => SQLite3 OO API #1
- sqlite3-api-oo1.js => SQLite3 OO API #1
- sqlite3-api-worker1.js => Worker-based API
- sqlite3-vfs-helper.c-pp.js => Utilities for VFS impls
- sqlite3-vtab-helper.c-pp.js => Utilities for virtual table impls
+3
View File
@@ -14,6 +14,9 @@
intended to be appended after all other sqlite3-api-*.js files so
that it can finalize any setup and clean up any global symbols
temporarily used for setting up the API's various subsystems.
In Emscripten builds it's run in the context of a Module.postRun
handler.
*/
'use strict';
if('undefined' !== typeof Module){ // presumably an Emscripten build
+6 -6
View File
@@ -12,12 +12,12 @@
This file is intended to be combined at build-time with other
related code, most notably a header and footer which wraps this
whole file into an Emscripten Module.postRun() handler. The sqlite3
JS API has no hard requirements on Emscripten and does not expose
any Emscripten APIs to clients. It is structured such that its build
can be tweaked to include it in arbitrary WASM environments which
can supply the necessary underlying features (e.g. a POSIX file I/O
layer).
whole file into an Emscripten Module.postRun()-style handler. The
sqlite3 JS API has no hard requirements on Emscripten and does not
expose any Emscripten APIs to clients. It is structured such that
its build can be tweaked to include it in arbitrary WASM
environments which can supply the necessary underlying features
(e.g. a POSIX file I/O layer).
Main project home page: https://sqlite.org
+12 -2
View File
@@ -97,6 +97,16 @@ STRIP_K2.js := $(sqlite3.js) $(sqlite3.mjs) \
# Note that we require $(bin.version-info) in order to figure out the
# dist file's name, so cannot (without a recursive make) have the
# target name equal to the archive name.
#
# 2025-01-15: Emsdk 4.0.0 introduces, in its generated code, a regex
# which contains the pattern /*. That, of course, confuses any C-style
# comment-stripper which is not specifically JS-aware and smart enough
# to know that it's in a regex or string literal. Because of that,
# comment-stripping is currently disabled, which means the builds will
# be significantly larger than before.
#apply_comment_stripper := false
apply_comment_stripper := true
# ^^^ shell command true or false
dist: \
$(bin.stripccomments) $(bin.version-info) \
$(dist.build) $(STRIP_K1.js) $(STRIP_K2.js) \
@@ -109,8 +119,8 @@ dist: \
@cp -p README-dist.txt $(dist-dir.top)/README.txt
@cp -p index-dist.html $(dist-dir.top)/index.html
@cp -p $(dist.jswasm.extras) $(dist-dir.jswasm)
@$(foreach JS,$(STRIP_K1.js),$(call DIST_STRIP_COMMENTS,$(JS),-k))
@$(foreach JS,$(STRIP_K2.js),$(call DIST_STRIP_COMMENTS,$(JS),-k -k))
@if $(apply_comment_stripper); then $(foreach JS,$(STRIP_K1.js),$(call DIST_STRIP_COMMENTS,$(JS),-k)) fi
@if $(apply_comment_stripper); then $(foreach JS,$(STRIP_K2.js),$(call DIST_STRIP_COMMENTS,$(JS),-k -k)) fi
@cp -p $(dist.common.extras) $(dist-dir.common)
@set -e; \
vnum=$$($(bin.version-info) --download-version); \
+9 -2
View File
@@ -75,7 +75,7 @@ static void mk_pre_post(const char *zName /* build name */,
const char *zMode /* build mode */,
const char *zCmppD /* optional -D flags for c-pp for the
** --pre/--post-js files. */){
pf("%s# Begin --pre/--post flags for %s-%s\n", zBanner, zName, zMode);
pf("%s# Begin --pre/--post flags for %s-%s\n", zBanner, zNM);
pf("c-pp.D.%s-%s := %s\n", zNM, zCmppD ? zCmppD : "");
pf("pre-post-%s-%s.flags ?=\n", zNM);
@@ -130,7 +130,7 @@ static void mk_pre_post(const char *zName /* build name */,
zNM, zNM, zNM);
pf("pre-post-%s-%s.deps := $(pre-post-jses.%s-%s.deps) $(dir.tmp)/pre-js.%s-%s.js\n",
zNM, zNM, zNM);
pf("# End --pre/--post flags for %s-%s%s", zName, zMode, zBanner);
pf("# End --pre/--post flags for %s-%s%s", zNM, zBanner);
}
/*
@@ -233,6 +233,13 @@ static void mk_lib_mode(const char *zName /* build name */,
pf("\t@dotwasm=$(basename $@).wasm; \\\n"
"\tchmod -x $$dotwasm; \\\n"
"\t$(maybe-wasm-strip) $$dotwasm; \\\n");
pf("\tsed -i -e '/^var _sqlite3.*createExportWrapper/d' %s; \\\n"
"\techo 'Stripped out createExportWrapper() parts.'; \\\n",
zJsOut) /* Our JS code installs bindings of each WASM export. The
generated Emscripten JS file does the same using its
own framework, but we don't use those results and can
speed up lib init, and reduce memory cost
considerably, by stripping them out. */;
/*
** The above $(emcc.bin) call will write zJsOut and will create a
** like-named .wasm file. That .wasm file name gets hard-coded into
+9 -2
View File
@@ -351,6 +351,13 @@ T.cc += $(OPTS)
INSTALL.noexec = $(INSTALL) -m 0644
# ^^^ do not use GNU-specific flags to $(INSTALL), e.g. --mode=...
# When cross-compiling, we need to avoid the -s flag because it only
# works on the build host's platform.
INSTALL.strip.1 = $(INSTALL)
INSTALL.strip.0 = $(INSTALL) -s
INSTALL.strip. = $(INSTALL.strip.0)
INSTALL.strip = $(INSTALL.strip.$(IS_CROSS_COMPILING))
#
# $(T.compile) = generic target platform compiler invocation,
# differing only from $(T.cc) in that it appends $(T.compile.extras),
@@ -2017,7 +2024,7 @@ sqlite3d$(T.exe): shell.c $(LIBOBJS0)
$(LDFLAGS.libsqlite3) $(LDFLAGS.readline)
install-shell-0: sqlite3$(T.exe) $(install-dir.bin)
$(INSTALL) -s sqlite3$(T.exe) "$(install-dir.bin)"
$(INSTALL.strip) sqlite3$(T.exe) "$(install-dir.bin)"
install-shell-1:
install: install-shell-$(HAVE_WASI_SDK)
@@ -2031,7 +2038,7 @@ sqldiff$(T.exe): $(sqldiff.$(LINK_TOOLS_DYNAMICALLY).deps)
$(sqldiff.$(LINK_TOOLS_DYNAMICALLY).rules)
install-diff: sqldiff$(T.exe) $(install-dir.bin)
$(INSTALL) -s sqldiff$(T.exe) "$(install-dir.bin)"
$(INSTALL.strip) sqldiff$(T.exe) "$(install-dir.bin)"
#install: install-diff
dbhash$(T.exe): $(TOP)/tool/dbhash.c sqlite3.o sqlite3.h
+55 -52
View File
@@ -1,20 +1,20 @@
C Version\s3.48.0
D 2025-01-14T11:05:00.186
C Add\stwo\snew\ssqlite3_db_config()\soptions\sthat\senable\sthe\sATTACH\scommand\nto\screate\snew\sdatabase\sfiles\sand\sto\sopen\sdatabases\sread/write.\s\sBoth\ndefault\sto\son\sfor\sbackwards\scompatibility.
D 2025-01-22T19:37:47.938
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
F LICENSE.md e108e1e69ae8e8a59e93c455654b8ac9356a11720d3345df2a4743e9590fb20d
F Makefile.in ad349acf91b3569033439fe498fa197aa530cafaa01362eb7daad2f84e43d265
F Makefile.in 572271a39d7ac1ae228ed911c63fdf374300a6a880ceb851b1f3d357e9a9534e
F Makefile.linux-generic bd3e3cacd369821a6241d4ea1967395c962dfe3057e38cb0a435cee0e8b789d0
F Makefile.msc 39785ec45f9ae0311e49094eff2ee079562246fed6be3b9f632a99d4df20056a
F README.md c3c0f19532ce28f6297a71870f3c7b424729f0e6d9ab889616d3587dd2332159
F VERSION 8dc0c3df15fd5ff0622f88fc483533fce990b1cbb2f5fb9fdfb4dbd71eef2889
F VERSION 01f7606130e48fd58a74d1e45e565f2674819d6eadbc219d328d94bb3362b818
F art/icon-243x273.gif 9750b734f82fdb3dc43127753d5e6fbf3b62c9f4e136c2fbf573b2f57ea87af5
F art/icon-80x90.gif 65509ce3e5f86a9cd64fe7fca2d23954199f31fe44c1e09e208c80fb83d87031
F art/sqlite370.eps aa97a671332b432a54e1d74ff5e8775be34200c2
F art/sqlite370.ico af56c1d00fee7cd4753e8631ed60703ed0fc6e90
F art/sqlite370.jpg d512473dae7e378a67e28ff96a34da7cb331def2
F art/sqlite370.svg 40b7e2fe8aac3add5d56dd86ab8d427a4eca5bcb3fe4f8946cb3794e1821d531
F auto.def 63dfbbc58b041d1c5c516f31a02679cce8d79123c89ad87fd2783f4ef26dedbb
F auto.def 056352c70a74a82929bdb5aaef65b38d44e4b912a8c7ebcb0a7d87fa1fd7c185
F autoconf/INSTALL 83e4a25da9fd053c7b3665eaaaf7919707915903
F autoconf/Makefile.am adedc1324b6a87fdd1265ddd336d2fb7d4f36a0e77b86ea553ae7cc4ea239347
F autoconf/Makefile.fallback 22fe523eb36dfce31e0f6349f782eb084e86a5620b2b0b4f84a2d6133f53f5ac
@@ -25,7 +25,7 @@ F autoconf/configure.ac ec7fa914c5e74ff212fe879f9bb6918e1234497e05facfb641f30c4d
F autoconf/tea/Makefile.in ba0556fee8da09c066bad85a4457904e46ee2c2eabaa309c0e83a78f2f151a8e
F autoconf/tea/README.txt 61e62e519579e4a112791354d6d440f8b51ea6db3b0bab58d59f29df42d2dfe3
F autoconf/tea/aclocal.m4 52c47aac44ce0ddb1f918b6993e8beb8eee88f43
F autoconf/tea/configure.ac ff2d745f88e493080810b67958d88b4f7a7d79f19e2ee8e7f72ffd6fc04eabc7
F autoconf/tea/configure.ac d22326594f005a493a7857cb4ad2496b91480101be731d7f0541bb8d7eba22a2
F autoconf/tea/doc/sqlite3.n e1fe45d4f5286ee3d0ccc877aca2a0def488e9bb
F autoconf/tea/license.terms 13bd403c9610fd2b76ece0ab50c4c5eda933d523
F autoconf/tea/pkgIndex.tcl.in 55aec3c6d7e9a1de9b8d2fdc9c27fd055da3ac3a51b572195e2ae7300bcfd3a2
@@ -50,7 +50,8 @@ F autosetup/cc-shared.tcl 4f024e94a47f427ba61de1739f6381ef0080210f9fae89112d5c1d
F autosetup/cc.tcl c0fcc50ca91deff8741e449ddad05bcd08268bc31177e613a6343bbd1fd3e45f
F autosetup/jimsh0.c d40e381ea4526a067590e7b91bd4b2efa6d4980d286f908054c647b3df4aee14
F autosetup/pkg-config.tcl 4e635bf39022ff65e0d5434339dd41503ea48fc53822c9c5bde88b02d3d952ba
F autosetup/proj.tcl 2e817159b997077cb79bd871f6255276b787558f386dfc0830b0f825f6a53767
F autosetup/proj.tcl 50b060ea6760b02ef5cb16650fbe9c1840e16351a0be0ccfc3727c565f74a257
F autosetup/sqlite-config.tcl 96d07366aaaf717a2a1ff9b0ef89c4d669d6a38f18e7e7ae48a2498d076b39ac
F autosetup/system.tcl 51d4be76cd9a9074704b584e5c9cbba616202c8468cf9ba8a4f8294a7ab1dba9
F configure 9a00b21dfd13757bbfb8d89b30660a89ec1f8f3a79402b8f9f9b6fc475c3303a x
F contrib/sqlitecon.tcl 210a913ad63f9f991070821e599d600bd913e0ad
@@ -112,7 +113,7 @@ F ext/fts5/fts5_buffer.c 0eec58bff585f1a44ea9147eae5da2447292080ea435957f7488c70
F ext/fts5/fts5_config.c e7d8dd062b44a66cd77e5a0f74f23a2354cd1f3f8575afb967b2773c3384f7f8
F ext/fts5/fts5_expr.c 69b8d976058512c07dfe86e229521b7a871768157bd1607cedf1a5038dfd72c9
F ext/fts5/fts5_hash.c adda4272be401566a6e0ba1acbe70ee5cb97fce944bc2e04dc707152a0ec91b1
F ext/fts5/fts5_index.c f1f6da5938af616e0a5e54f0423a3134df95b9f17ac1c6ebf2e2e8132bbc75b9
F ext/fts5/fts5_index.c 1ce1e2b43fdd86a2047619c2ea3aafa5c7b909d0cef75185d0fda31e82f0e9c6
F ext/fts5/fts5_main.c 9a1daef7247f9b8a50b4159323e340efa6b0e4bea4fcd83580480f94d4f2c888
F ext/fts5/fts5_storage.c 1ad05dab4830a4e2eaf2900bb143477f93bc17437093582f36f4b818809e88d8
F ext/fts5/fts5_tcl.c 7fb5a3d3404099075aaa2457307cb459bbc257c0de3dbd52b1e80a5b503e0329
@@ -191,7 +192,7 @@ F ext/fts5/test/fts5faultE.test 844586ce71dab4be85bb86880e87b624d089f851654cd22e
F ext/fts5/test/fts5faultF.test 4abef99f86e99d9f0c6460dd68c586a766b6b9f1f660ada55bf2e8266bd1bbc1
F ext/fts5/test/fts5faultG.test 0544411ffcb3e19b42866f757a8a5e0fb8fef3a62c06f61d14deebc571bb7ea9
F ext/fts5/test/fts5faultH.test 2b2b5b8cb1b3fd7679f488c06e22af44107fbc6137eaf45b3e771dc7b149312d
F ext/fts5/test/fts5faultI.test 0706b307b208638554c9e65b4091e1c0dd8c92941535089a301df454ff2c56f4
F ext/fts5/test/fts5faultI.test 9b33d664bccee4bbde0f275a48b2df3ea2f05d41f6d1d171aa2e844382cba621
F ext/fts5/test/fts5first.test bfd685b96905bf541d99d8644e0a7219d1d833455a08ab64e344071a613b6ba9
F ext/fts5/test/fts5full.test 97d263c1072f4a560929cca31e70f65d2ae232610e17e6affcf7e979df59547b
F ext/fts5/test/fts5fuzz1.test 238d8c45f3b81342aa384de3e581ff2fa330bf922a7b69e484bbc06051a1080e
@@ -206,7 +207,7 @@ F ext/fts5/test/fts5locale.test 83ba7ee12628b540d3098f39c39c1de0c0440eddff8f7512
F ext/fts5/test/fts5matchinfo.test 877520582feb86bbfd95ab780099bcba4526f18ac75ee34979144cf86ba3a5a3
F ext/fts5/test/fts5merge.test 2654df0bcdb2d117c2d38b6aeb0168061be01c643f9e9194b36c43a2970e8082
F ext/fts5/test/fts5merge2.test 3ebad1a59d6ad3fb66eff6523a09e95dc6367cbefb3cd73196801dea0425c8e2
F ext/fts5/test/fts5misc.test 8c3cc771f773dc4bb4973620c51e7729e324ca2cc80eb8894f1c2c605e361f0b
F ext/fts5/test/fts5misc.test f4dee7da898d605a6488c5b7afaace3158ed6bb9addff78faa1b37b402b77fb9
F ext/fts5/test/fts5multi.test a15bc91cdb717492e6e1b66fec1c356cb57386b980c7ba5af1915f97fe878581
F ext/fts5/test/fts5multiclient.test 5ff811c028d6108045ffef737f1e9f05028af2458e456c0937c1d1b8dea56d45
F ext/fts5/test/fts5near.test 33d60867581066e5db7016deb5d651628125d7ff4e0233a88175aa5b65874c74
@@ -400,7 +401,7 @@ F ext/misc/README.md d6dd0fe1d8af77040216798a6a2b0c46c73054d2f0ea544fbbcdccf6f23
F ext/misc/amatch.c 5001711cbecdd57b288cb613386789f3034e5beb58fbe0c79f2b3d643ffd4e03
F ext/misc/anycollseq.c 5ffdfde9829eeac52219136ad6aa7cd9a4edb3b15f4f2532de52f4a22525eddb
F ext/misc/appendvfs.c 9642c7a194a2a25dca7ad3e36af24a0a46d7702168c4ad7e59c9f9b0e16a3824
F ext/misc/base64.c 95abb0547cb1799d9851f3357c8d7fc3c09a95c63c8772aa3acd5f65f12050f6
F ext/misc/base64.c 73c31eb325c71bae2e27276565e3f674fc095d8b0d7a651becb3b241a4d2fa57
F ext/misc/base85.c a70c885c5c9350261ea6e7b166038eab21a09cf4fceae856ce41fae9c2213b60
F ext/misc/basexx.c 89ad6b76558efbceb627afd5e2ef1d84b2e96d9aaf9b7ecb20e3d00b51be6fcf
F ext/misc/blobio.c a867c4c4617f6ec223a307ebfe0eabb45e0992f74dd47722b96f3e631c0edb2a
@@ -442,7 +443,7 @@ F ext/misc/shathree.c f3a778f27bf3e71b666a77f28e463a3b931c4dbe4219447e61bb678b4b
F ext/misc/showauth.c 732578f0fe4ce42d577e1c86dc89dd14a006ab52
F ext/misc/spellfix.c bcc42ef3fd29429bc01a83e751332b8d4690e65d45008449bdffe7656371487f
F ext/misc/sqlar.c a6175790482328171da47095f87608b48a476d4fac78d8a9ff18b03a2454f634
F ext/misc/sqlite3_stdio.c 5657afb6ec81bef31790973528980af778e0e1388a93db780d33007336efe6e6
F ext/misc/sqlite3_stdio.c 18160504b9348d0ebb9f5620fd61e64cd2d55fffde05ab3f7db03396add4840a
F ext/misc/sqlite3_stdio.h f05eaf5e0258f0573910324a789a9586fc360a57678c57a6d63cfaa2245b6176
F ext/misc/stmt.c b090086cd6bd6281c21271d38d576eeffe662f0e6b67536352ce32bbaa438321
F ext/misc/stmtrand.c 59cffa5d8e158943ff1ce078956d8e208e8c04e67307e8f249dece2436dcb7fc
@@ -618,7 +619,7 @@ F ext/session/sqlite3session.c d6f5e3e83b9b0bbc4a8db4837284f0ecc6af5321d4c8e7136
F ext/session/sqlite3session.h 683ccbf16e2c2521661fc4c1cf918ce57002039efbcabcd8097fa4bca569104b
F ext/session/test_session.c 12e0a2c15fd60f92da4bb29c697c9177ff0c0dbcdc5129a54c47e999f147937a
F ext/wasm/EXPORTED_FUNCTIONS.fiddle.in 27450c8b8c70875a260aca55435ec927068b34cef801a96205adb81bdcefc65c
F ext/wasm/GNUmakefile 311aa0d5edc7006409962cc77cc26560d92f9be69c2c4302e8bbc68189fd02db
F ext/wasm/GNUmakefile 78f49e47146d58fa44f9ac624627a718fba4b2b2baeaea641bcf6fed300c0f0d
F ext/wasm/README-dist.txt 6382cb9548076fca472fb3330bbdba3a55c1ea0b180ff9253f084f07ff383576
F ext/wasm/README.md a8a2962c3aebdf8d2104a9102e336c5554e78fc6072746e5daf9c61514e7d193
F ext/wasm/SQLTester/GNUmakefile e0794f676d55819951bbfae45cc5e8d7818dc460492dc317ce7f0d2eca15caff
@@ -631,15 +632,15 @@ F ext/wasm/api/EXPORTED_FUNCTIONS.sqlite3-extras fe40d6d758646e38f8b15f709044951
F ext/wasm/api/EXPORTED_FUNCTIONS.sqlite3-see fb29e62082a658f0d81102488414d422c393c4b20cc2f685b216bc566237957b
F ext/wasm/api/EXPORTED_RUNTIME_METHODS.sqlite3-api 1ec3c73e7d66e95529c3c64ac3de2470b0e9e7fbf7a5b41261c367cf4f1b7287
F ext/wasm/api/README.md 34fe11466f9c1d81b10a0469e1114e5f1c5a6365c73d80a1a6ca639a1a358b73
F ext/wasm/api/extern-post-js.c-pp.js c4154a7f90c2d7e51fd6738273908152036c3457fdc0b6523f1be3ef51105aac
F ext/wasm/api/extern-post-js.c-pp.js 3fcd904f1204685dea84e5ae90d8b7e65a1dcebab1e838386d8328b74cce46c9
F ext/wasm/api/extern-pre-js.js cc61c09c7a24a07dbecb4c352453c3985170cec12b4e7e7e7a4d11d43c5c8f41
F ext/wasm/api/post-js-footer.js cd0a8ec768501d9bd45d325ab0442037fb0e33d1f3b4f08902f15c34720ee4a1
F ext/wasm/api/post-js-header.js 04dc12c3edd666b64a1b4ef3b6690c88dcc653f26451fd4734472d8e29c1c122
F ext/wasm/api/post-js-footer.js 365405929f41ca0e6d389ed8a8da3f3c93e11d3ef43a90ae151e37fa9f75bf41
F ext/wasm/api/post-js-header.js 54b2b4294501b3866245cc94315a16f5424c0e87729d0fb610fba151593c6d26
F ext/wasm/api/pre-js.c-pp.js a614a2c82b12c4d96d8e3ba77330329efc53c4d56a8a7e60ade900f341866cfb
F ext/wasm/api/sqlite3-api-cleanup.js d235ad237df6954145404305040991c72ef8b1881715d2a650dda7b3c2576d0e
F ext/wasm/api/sqlite3-api-cleanup.js 3ac1786e461ada63033143be8c3b00b26b939540661f3e839515bb92f2e35359
F ext/wasm/api/sqlite3-api-glue.c-pp.js fb6dbfe692cc23000a65a4cd95a1a47ed5eb592dc9d8b55363b3c2952a787244
F ext/wasm/api/sqlite3-api-oo1.c-pp.js f3a8e2004c6625d17946c11f2fb32008be78bc5207bf746fc77d59848813225f
F ext/wasm/api/sqlite3-api-prologue.js 6f1257e04885632ed9f44d43aba200b86e0bc16709ffdba29abbbeb1bc8e8b76
F ext/wasm/api/sqlite3-api-prologue.js 3caa0d1f46fe1bfbd1cce31b57b4446ca073ddb15f67476a9ff6c93456467712
F ext/wasm/api/sqlite3-api-worker1.c-pp.js 5cc22a3c0d52828cb32aad8691488719f47d27567e63e8bc8b832d74371c352d
F ext/wasm/api/sqlite3-license-version-header.js 0c807a421f0187e778dc1078f10d2994b915123c1223fe752b60afdcd1263f89
F ext/wasm/api/sqlite3-opfs-async-proxy.js 3774befd97cd1a5e2895c8225a894aad946848c6d9b4028acc988b5d123475af
@@ -668,7 +669,7 @@ F ext/wasm/demo-worker1-promiser.c-pp.html 635cf90685805e21772a5f7a35d1ace80f98a
F ext/wasm/demo-worker1-promiser.c-pp.js fcc628cb42fcfaf07d250477801de1e6deb1e319d003976612a0db8d76b9fccc
F ext/wasm/demo-worker1.html 2c178c1890a2beb5a5fecb1453e796d067a4b8d3d2a04d65ca2eb1ab2c68ef5d
F ext/wasm/demo-worker1.js 836bece8615b17b1b572584f7b15912236a5947fe8c68b98d2737d7e287447ef
F ext/wasm/dist.make 653e212c1e84aa3be168d62a10616ccea45ee9585b0192745d2706707a5248ce
F ext/wasm/dist.make 92ef4ffe33022a50f92d602acabad10bd8dd91759f3eb7df27fc6d7d37072b96
F ext/wasm/example_extra_init.c 2347cd69d19d839ef4e5e77b7855103a7fe3ef2af86f2e8c95839afd8b05862f
F ext/wasm/fiddle.make d4969f0322a582c57a22ce3541f10a5b09a609d14eab32891f613f43b3c14d8b
F ext/wasm/fiddle/fiddle-worker.js 850e66fce39b89d59e161d1abac43a181a4caa89ddeea162765d660277cd84ce
@@ -678,7 +679,7 @@ F ext/wasm/index-dist.html 564b5ec5669676482c5a25dea9e721d8eafed426ecb155f93d29a
F ext/wasm/index.html e4bbffdb3d40eff12b3f9c7abedef91787e2935620b7f8d40f2c774b80ad8fa9
F ext/wasm/jaccwabyt/jaccwabyt.js 1264710db3cfbcb6887d95665b7aeba60c1126eaef789ca4cf1a4a17d5bc7f54
F ext/wasm/jaccwabyt/jaccwabyt.md 59a20df389abcc3606eb4eaea7fb7ba14504beb3e345dbea9b99a0618ba3bec8
F ext/wasm/mkwasmbuilds.c e3580b26bc393e4e4beb25f6349b999878782f3319b740469f64c2e772632e03
F ext/wasm/mkwasmbuilds.c af06fd14fcb7803c0adacab276047bb696c07f5b683a6f70adc5b3f146cf61f3
F ext/wasm/module-symbols.html dc476b403369b26a1a23773e13b80f41b9a49f0825e81435fe3600a7cfbbe337
F ext/wasm/scratchpad-wasmfs.html a3d7388f3c4b263676b58b526846e9d02dfcb4014ff29d3a5040935286af5b96
F ext/wasm/scratchpad-wasmfs.mjs 66034b9256b218de59248aad796760a1584c1dd842231505895eff00dbd57c63
@@ -700,7 +701,7 @@ F ext/wasm/tests/opfs/concurrency/test.js d08889a5bb6e61937d0b8cbb78c9efbefbf65a
F ext/wasm/tests/opfs/concurrency/worker.js 0a8c1a3e6ebb38aabbee24f122693f1fb29d599948915c76906681bb7da1d3d2
F ext/wasm/wasmfs.make bc8bb227f35d5bd3863a7bd2233437c37472a0d81585979f058f9b9b503bef35
F magic.txt 5ade0bc977aa135e79e3faaea894d5671b26107cc91e70783aa7dc83f22f3ba0
F main.mk 0b62344246f8a3e920edb8a52b0c3296dde829d7eb450f67b89c63d79536de85
F main.mk a187ada134ccb55b5d59ea3eb8f71cc6b19bfc244689e24a729f7a64aa500dc3
F mptest/config01.test 3c6adcbc50b991866855f1977ff172eb6d901271
F mptest/config02.test 4415dfe36c48785f751e16e32c20b077c28ae504
F mptest/crash01.test 61e61469e257df0850df4293d7d4d6c2af301421
@@ -712,7 +713,7 @@ F sqlite3.1 acdff36db796e2d00225b911d3047d580cd136547298435426ce9d40347973cc
F sqlite3.pc.in 0977c03a4da7c4204bd60e784a0efb8d51a190448aba78a4e973fe7192bdaf03
F src/alter.c aa93e37e4a36a0525bbb2a2aeda20d2018f0aa995542c7dc658e031375e3f532
F src/analyze.c 9a8b67239d899ac12289db5db3f5bfe7f7a0ad1277f80f87ead1d048085876eb
F src/attach.c f35bb8cc1fcdde8f6815a7ef09ae413bcac71821d530796800ba24b3c7da1e80
F src/attach.c 3a5cb9ee4aad6c5b22268287340a4f2f7b07959b7a522201be30fee23cd802e9
F src/auth.c 54ab9c6c5803b47c0d45b76ce27eff22a03b4b1f767c5945a3a4eb13aa4c78dc
F src/backup.c 5c97e8023aab1ce14a42387eb3ae00ba5a0644569e3476f38661fa6f824c3523
F src/bitvec.c 9eac5f42c11914d5ef00a75605bb205e934f435c579687f985f1f8b0995c8645
@@ -721,17 +722,17 @@ F src/btree.c 63ca6b647342e8cef643863cd0962a542f133e1069460725ba4461dcda92b03c
F src/btree.h 18e5e7b2124c23426a283523e5f31a4bff029131b795bb82391f9d2f3136fc50
F src/btreeInt.h 98aadb6dcb77b012cab2574d6a728fad56b337fc946839b9898c4b4c969e30b6
F src/build.c c6b09342d870a509529244ed8e19b4175a261f2e3163c199241d69e1d8a57607
F src/callback.c db3a45e376deff6a16c0058163fe0ae2b73a2945f3f408ca32cf74960b28d490
F src/callback.c acae8c8dddda41ee85cfdf19b926eefe830f371069f8aadca3aa39adf5b1c859
F src/complete.c a3634ab1e687055cd002e11b8f43eb75c17da23e
F src/ctime.c d35723024b963edce9c0fad5b3303e8bb9266083784844baed10a6dedfe26f3b
F src/date.c 89ce1ff20512a7fa5070ba6e7dd5c171148ca7d580955795bf97c79c2456144a
F src/date.c 842c08ac143a56a627b05ac51d68624f2b7b03e3b4cba596205e735eed64ee57
F src/dbpage.c e90410e5d4c0217dfddc4184a81e38ec4903c25d4ec0f201060a0e54e7c2099f
F src/dbstat.c 73362c0df0f40ad5523a6f5501224959d0976757b511299bf892313e79d14f5c
F src/delete.c 03a77ba20e54f0f42ebd8eddf15411ed6bdb06a2c472ac4b6b336521bf7cea42
F src/expr.c 30a407765d4e4b592f9f958085fb4e8336e54fa46a70ade7f5a67111bc191563
F src/fault.c 460f3e55994363812d9d60844b2a6de88826e007
F src/fkey.c 928ed2517e8732113d2b9821aa37af639688d752f4ea9ac6e0e393d713eeb76f
F src/func.c 89b733a5f513c4bc06b7271384363d5693d62782de8295bc87b97d79862c9714
F src/func.c 30051410d0379059e1e3642ffc0caae6963a2b01b3b6d9dd44c5e09b1a66d066
F src/global.c a19e4b1ca1335f560e9560e590fc13081e21f670643367f99cb9e8f9dc7d615b
F src/hash.c 9ee4269fb1d6632a6fecfb9479c93a1f29271bddbbaf215dd60420bcb80c7220
F src/hash.h 3340ab6e1d13e725571d7cee6d3e3135f0779a7d8e76a9ce0a85971fa3953c51
@@ -741,7 +742,7 @@ F src/insert.c f8d1a0f8ee258411009c6b7f2d93170e351bd19f5ad89d57e1180644297cbe70
F src/json.c 68a98c020c22127f2d65f08855f7fc7460ff352a6ce0b543d8931dde83319c22
F src/legacy.c d7874bc885906868cd51e6c2156698f2754f02d9eee1bae2d687323c3ca8e5aa
F src/loadext.c 7432c944ff197046d67a1207790a1b13eec4548c85a9457eb0896bb3641dfb36
F src/main.c a19dc8b47760ed95f3fbb255cfa8d3f7146b33c263eb4af05ab05e0115d161b9
F src/main.c 84239c53aaac3aa1734eaf33a41d575c1d2494313bd8af5e6d885f0dc0547cfd
F src/malloc.c 410e570b30c26cc36e3372577df50f7a96ee3eed5b2b161c6b6b48773c650c5e
F src/mem0.c 6a55ebe57c46ca1a7d98da93aaa07f99f1059645
F src/mem1.c 3bb59158c38e05f6270e761a9f435bf19827a264c13d1631c58b84bdc96d73b2
@@ -762,10 +763,10 @@ F src/os.h 1ff5ae51d339d0e30d8a9d814f4b8f8e448169304d83a7ed9db66a65732f3e63
F src/os_common.h 6c0eb8dd40ef3e12fe585a13e709710267a258e2c8dd1c40b1948a1d14582e06
F src/os_kv.c 4d39e1f1c180b11162c6dc4aa8ad34053873a639bac6baae23272fc03349986a
F src/os_setup.h 6011ad7af5db4e05155f385eb3a9b4470688de6f65d6166b8956e58a3d872107
F src/os_unix.c d2edbd92b07a3f778c2defa8a2e9d75acceb6267bda56948c41e8cdda65224d6
F src/os_unix.c 4c73f89479d90412cb736a180e9ef89ac1495a158753a7f5de1260c197bc8e1f
F src/os_win.c 49c7725b500f5867e8360e75eeb30f9d70b62fa1f05c8a101da627210578df32
F src/os_win.h 7b073010f1451abe501be30d12f6bc599824944a
F src/pager.c 2fdd489447aa6bb0f672973bacb801ced92225ca9a1c874ed9b856d2741dc54e
F src/pager.c 3a1c4e7f69af482e33c8cba8a75afe0dda0ea6391240adac22b040ce1bdeef44
F src/pager.h 6137149346e6c8a3ddc1eeb40aee46381e9bc8b0fcc6dda8a1efde993c2275b8
F src/parse.y dcf45a81b61223ac93e61fdfe9b22d635dd371c446e8222634d90aa37e25e5f6
F src/pcache.c 588cc3c5ccaaadde689ed35ce5c5c891a1f7b1f4d1f56f6cf0143b74d8ee6484
@@ -779,15 +780,15 @@ F src/random.c 606b00941a1d7dd09c381d3279a058d771f406c5213c9932bbd93d5587be4b9c
F src/resolve.c c8a5372b97b2a2e972a280676f06ddb5b74e885d3b1f5ce383f839907b57ef68
F src/rowset.c 8432130e6c344b3401a8874c3cb49fefe6873fec593294de077afea2dce5ec97
F src/select.c 83e88fbb36f89b6703b348777491619554f0fd6f917c9fdf51e4c2e9cda6c04e
F src/shell.c.in beb370609906092a6810fcd9ea76737be2c91694445061c2eb05c4c0a3753de4
F src/sqlite.h.in 6afbcaae44140216704a6c82e4c4ea4118c46d5f6573d6c5fa4fc901ed9d369e
F src/shell.c.in 9915487b27e3169d59a4018c88d14246059c392c662d98fc516264267396b65e
F src/sqlite.h.in 666fa171bf5a9fa532b637571303a596c80723e89f3e10962c0d81378b2b789d
F src/sqlite3.rc 5121c9e10c3964d5755191c80dd1180c122fc3a8
F src/sqlite3ext.h 3f046c04ea3595d6bfda99b781926b17e672fd6d27da2ba6d8d8fc39981dcb54
F src/sqliteInt.h 3f20dfb5ae54e787b2643edc0b5bae0cecddfb89988e28afdc3c0b05892e25cc
F src/sqliteInt.h dd2385d05fbc892d865296fa3f493ba132044a2bbbd15bfad67984bb4afba1d3
F src/sqliteLimit.h 1bbdbf72bd0411d003267ffebc59a262f061df5653027a75627d03f48ca30523
F src/status.c cb11f8589a6912af2da3bb1ec509a94dd8ef27df4d4c1a97e0bcf2309ece972b
F src/table.c 0f141b58a16de7e2fbe81c308379e7279f4c6b50eb08efeec5892794a0ba30d1
F src/tclsqlite.c c6b9d3a0b1100e1e028460c418c41ca180dac5958e96bef79f6799b552522a37
F src/tclsqlite.c 6a7538560adc856faea295c0f09c33a57a1cfa5c59f85ab4e12aa50dba7ff2de
F src/tclsqlite.h 65e2c761446e1c9fa0342b7d2612a703483643c8b6a316d12a65b745a4727395
F src/test1.c 9d2da51b4c33633e7370e4068af6d16d2c52b22a5810ec012ac32e77f8397b64
F src/test2.c 7ebc518e6735939d8979273a6f7b1d9b5702babf059f6ad62499f7f60a9eb9a3
@@ -847,13 +848,13 @@ F src/upsert.c 215328c3f91623c520ec8672c44323553f12caeb4f01b1090ebdca99fdf7b4f1
F src/utf.c 8b29d9a5956569ea2700f869669b8ef67a9662ee5e724ff77ab3c387e27094ba
F src/util.c e5f6a5eeaa26b69054a43bbd0048cfe3d2851f6961052b35aed8f695df922850
F src/vacuum.c b763b6457bd058d2072ef9364832351fd8d11e8abf70cbb349657360f7d55c40
F src/vdbe.c 8a6eb02823b424b273614bae41579392a5c495424592b60423dd2c443a583df0
F src/vdbe.c b428a751953c0c2ff85e3e152ec16e29d488895cd541c8c20876ff9f3bf6978a
F src/vdbe.h 9676348d342bd04e21e384c63b57224171ce84fac77853357334ef94c4d33cf4
F src/vdbeInt.h bf294a0c8fc4cc80779e74b04b8bd82c6e1197b3137cefe0b16cdf002fc7dfd6
F src/vdbeapi.c 38c252a202d70b56cfb734460bc888ddbd581afec1a10cd4d6c894c9e0b5baea
F src/vdbeaux.c 5fcbc642a3d3d88c5ea15cadf2c8b8e4e067cb9ff374beb1875c9d209001299e
F src/vdbeInt.h 895b1ab7536f018d3d70d690f6c0adbd1062b6dddce1c2cad912927856d4033c
F src/vdbeapi.c 76fa76b21f46afc70e71ecd69954f601e9b80b5fb0c1eb7ace06d30802255768
F src/vdbeaux.c 885e16100597507fbbe09d82cbb963bff3fd8a9c1e358dc4f463fc95feb18e8b
F src/vdbeblob.c 255be187436da38b01f276c02e6a08103489bbe2a7c6c21537b7aecbe0e1f797
F src/vdbemem.c df568ef0187e4be2788c35174f6d9b8566ab9475f9aff2d73907ed05aa5684b2
F src/vdbemem.c 977438546df236c6a3e7d8b4fe86c0643c13b89b00235db1f11c3a91a4796d30
F src/vdbesort.c d0a3c7056c081703c8b6d91ad60f17da5e062a5c64bf568ed0fa1b5f4cae311f
F src/vdbetrace.c fe0bc29ebd4e02c8bc5c1945f1d2e6be5927ec12c06d89b03ef2a4def34bf823
F src/vdbevtab.c fc46b9cbd759dc013f0b3724549cc0d71379183c667df3a5988f7e2f1bd485f3
@@ -862,8 +863,8 @@ F src/vxworks.h d2988f4e5a61a4dfe82c6524dd3d6e4f2ce3cdb9
F src/wal.c 4e6181d8780ab0af2e1388d0754cbe6f2f04593d2b1ab6c41699a89942fd8997
F src/wal.h ba252daaa94f889f4b2c17c027e823d9be47ce39da1d3799886bbd51f0490452
F src/walker.c d5006d6b005e4ea7302ad390957a8d41ed83faa177e412f89bc5600a7462a014
F src/where.c 604f17baed46f4997ffe79f25c07c4b51a4165a5938cc27fe165c7e1ca485d11
F src/whereInt.h 1e36ec50392f7cc3d93d1152d4338064cd522b87156a0739388b7e273735f0ca
F src/where.c 5e74d76b264abcd7e6682e02853756b5d32f543c59fb47bb55a02575b73693ae
F src/whereInt.h 2b0804f300c7f65de4046a1d81c65f01b208d6c08950ccd1fa6b8c16162a8af7
F src/wherecode.c 0c3d3199a2b769a5e2bb70feb5003dc85b3d86842ecaf903a47f2b4205ca5dab
F src/whereexpr.c 0f93a29cabd3a338d09a1f5c6770620a1ac51ec1157f3229502a7e7767c60b6f
F src/window.c 2bf01f9941a64fbcead61a0e3cb5db3fca5094b30d2ff0d23274c2a81d2e2385
@@ -925,7 +926,7 @@ F test/auth2.test 9eb7fce9f34bf1f50d3f366fb3e606be5a2000a1
F test/auth3.test 76d20a7fa136d63bcfcf8bcb65c0b1455ed71078d81f22bcd0550d3eb18594ab
F test/autoanalyze1.test b9cc3f32a990fa56669b668d237c6d53e983554ae80c0604992e18869a0b2dec
F test/autoinc.test 997d6f185f138229dc4251583a1d04816423dddc2fc034871a01aeb1d728cb39
F test/autoindex1.test 714cac6e60beeb5a26ed346dd46505ba60b5a5597e9122c9ed3a55f89a922aa4
F test/autoindex1.test 65931519206bbec71948b11e125af0656435a0937973fe5fed70d776a712911f
F test/autoindex2.test 12ef578928102baaa0dc23ad397601a2f4ecb0df
F test/autoindex3.test ca502c8050166ac6107a7b4fe4e951f4d3270a23a958af02b14f1b962b83c4b6
F test/autoindex4.test 3c2105e9172920e26f950ba3c5823e4972190e022c1e6f260ba476b0af24c593
@@ -1067,7 +1068,7 @@ F test/ctime.test 340f362f41f92972bbd71f44e10569a5cc694062b692231bd08aa6fe6c1c47
F test/cursorhint.test 05cf0febe5c5f8a31f199401fd1c9322249e753950d55f26f9d5aca61408a270
F test/cursorhint2.test 6f3aa9cb19e7418967a10ec6905209bcbb5968054da855fc36c8beee9ae9c42f
F test/dataversion1.test 6e5e86ac681f0782e766ebcb56c019ae001522d114e0e111e5ebf68ccf2a7bb8
F test/date.test c8ff835023f2107b57ce7a45c92265d51c98a23fc93231e998f12d850831aad6
F test/date.test 8911c3d9fb0e496e92e0259697f431a00707222d2b3438ce1105d1790a3c0d51
F test/date2.test 7e12ec14aaf4d5e6294b4ba140445b0eca06ea50062a9c3a69c4ee13d0b6f8b1
F test/date3.test a1b77abf05c6772fe5ca2337cac1398892f2a41e62bce7e6be0f4a08a0e64ae5
F test/date4.test 75dc8401e8c0639a228cd26a6eaa4ff5ea8ccda912b9853d1c9462c476670e17
@@ -1153,7 +1154,7 @@ F test/fkey2.test 1063d65e5923c054cfb8f0555a92a3ae0fa8c067275a33ee1715bd856cdb30
F test/fkey3.test 76d475c80b84ee7a5d062e56ccb6ea68882e2b49
F test/fkey4.test 86446017011273aad8f9a99c1a65019e7bd9ca9d
F test/fkey5.test 6727452e163a427147e84e739da18713da553d79f9783559b04fdcd36d5c7421
F test/fkey6.test bdb9c808349a149575b87cf4bfd82d4c81612f0c4d954d27b3f42f043a385396
F test/fkey6.test ebd11efb00b9c70b57f4c6b6184445145c96e320329bd90a175036570c5b25ca
F test/fkey7.test 64fb28da03da5dfe3cdef5967aa7e832c2507bf7fb8f0780cacbca1f2338d031
F test/fkey8.test 51deda7f1a1448bca95875e4a6e1a3a75b4bd7215e924e845bd60de60e4d84bf
F test/fkey_malloc.test 594a7ea1fbab553c036c70813cd8bd9407d63749
@@ -1677,7 +1678,9 @@ F test/speed3.test 694affeb9100526007436334cf7d08f3d74b85ef
F test/speed4.test abc0ad3399dcf9703abed2fff8705e4f8e416715
F test/speed4p.explain 6b5f104ebeb34a038b2f714150f51d01143e59aa
F test/speed4p.test 377a0c48e5a92e0b11c1c5ebb1bc9d83a7312c922bc0cb05970ef5d6a96d1f0c
F test/speedtest1.c cc503febbb8559d541a67d7a33d3d7bb8a2c8cbbfc89eb336e2e2bd6ad6a63ee
F test/speedtest.md e4f467683acfdb2834ca1d6ce209c3d883dfecf73c41f77234b2368be9579de2
F test/speedtest.tcl 8a9362c1e429318e741b91d26888e7edcc326f98c3aea505ffd618cc5b9e7f0a x
F test/speedtest1.c 323ce0956430a5aae56ea20f502da7bea3fb62b8ed02e9b0f12ab078b2b258f5
F test/spellfix.test 951a6405d49d1a23d6b78027d3877b4a33eeb8221dcab5704b499755bb4f552e
F test/spellfix2.test dfc8f519a3fc204cb2dfa8b4f29821ae90f6f8c3
F test/spellfix3.test 0f9efaaa502a0e0a09848028518a6fb096c8ad33
@@ -2088,7 +2091,7 @@ F test/with2.test 181674a6cc86a601ca2ac052741cdfad5b529e07e870435d2f6cdb92d589ff
F test/with3.test e30369ea27aa27eb1bda4c5e510c8a9f782c8afd2ab99d1a02b8a7f25a5d3e65
F test/with4.test 257be66c0c67fee1defbbac0f685c3465e2cad037f21ce65f23f86084f198205
F test/with5.test 6248213c41fab36290b5b73aa3f937309dfba337004d9d8434c3fabc8c7d4be8
F test/with6.test 9ff3503c3ff7cd459dc4852a02aaefa998dccace53f4142a0eb726174ad5984a
F test/with6.test 281e4861b5e517f6c3c2f08517a520c1e2ee7c11966545d3901f258a4fe8ef76
F test/withM.test 693b61765f2b387b5e3e24a4536e2e82de15ff64
F test/without_rowid1.test a5210b8770dc4736bca4e74bc96588f43025ad03ad6a80f885afd36d9890e217
F test/without_rowid2.test af260339f79d13cb220288b67cd287fbcf81ad99
@@ -2140,7 +2143,7 @@ F tool/logest.c c34e5944318415de513d29a6098df247a9618c96d83c38d4abd88641fe46e669
F tool/max-limits.c cbb635fbb37ae4d05f240bfb5b5270bb63c54439
F tool/merge-test.tcl de76b62f2de2a92d4c1ca4f976bce0aea6899e0229e250479b229b2a1914b176
F tool/mkamalzip.tcl 8aa5ebe7973c8b8774062d34e15fea9815c4cc2ceea3a9b184695f005910876a
F tool/mkautoconfamal.sh cbdcf993fa83dccbef7fb77b39cdeb31ef9f77d9d88c9e343b58d35ca3898a6a
F tool/mkautoconfamal.sh 4fbfd523330c8cf12ead8f0e0acdb3c5c9c08a1bcb293119267aeaa3e0bbe3e1
F tool/mkccode.tcl 210159febe0ef0ecbc53c79833500663ceaba0115b2b374405818dc835b5f84b x
F tool/mkctimec.tcl ef6a67ec82e5b6fc19152a4c79f237227b18bf67ff16d155bac7adb94355d9cf x
F tool/mkkeywordhash.c 6b0be901c47f9ad42215fc995eb2f4384ac49213b1fba395102ec3e999acf559
@@ -2193,7 +2196,7 @@ F tool/src-verify.c d00f93263aa2fa6ba0cba0106d95458e6effb94fdb5fc634f56834f90c05
F tool/srcck1.c 371de5363b70154012955544f86fdee8f6e5326f
F tool/srctree-check.tcl 1f1f505835a4beca64c1751a7ebec5c41a1ddf22b1e80481345b95059eef6583
F tool/stack_usage.tcl f8e71b92cdb099a147dad572375595eae55eca43
F tool/stripccomments.c 20b8aabc4694d0d4af5566e42da1f1a03aff057689370326e9269a9ddcffdc37
F tool/stripccomments.c dfe9cc03cf87728ac9836be30763f8aa52b82caca0780b3d3f3572e4643b01d3
F tool/symbols-mingw.sh 4dbcea7e74768305384c9fd2ed2b41bbf9f0414d
F tool/symbols.sh 1612bd947750e21e7b47befad5f6b3825b06cce0705441f903bf35ced65ae9b9
F tool/tclConfigShToAutoDef.sh 44ec55046d86a3febb2cb3e099399b41794e80e9cd138eee7b9b016f819e882b x
@@ -2205,11 +2208,11 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350
F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7
F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139
F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
P 315079b150b47e013e2cde4985bc39d24e0f6f6c6e60f9383fb8ea4ea897c67a
R 0ed0cfcc7f2bc831da5d62a3490571ed
T +sym-major-relase *
T +sym-relase *
T +sym-version-3.48.0 *
P c20d21b473d8a45267262c5df1d7b102eccce8e4cfbe1e467ea66c474aea0af5
R 1e3a803f41f6c1dff31eede2c9428a7d
T *branch * enable-attach
T *sym-enable-attach *
T -sym-trunk *
U drh
Z cc77aac977f98c5521d75f4212754ff8
Z 45431d003e2c2a4fccdcefe1b482f2e1
# Remove this line to create a well-formed Fossil manifest.
+1 -1
View File
@@ -1 +1 @@
d2fe6b05f38d9d7cd78c5d252e99ac59f1aea071d669830c1ffe4e8966e84010
fe0c58d00b491d1af7c0894f5c32542954aeea2e6510853b3bcbf13ac0bf5ce0
+6
View File
@@ -175,6 +175,12 @@ static void attachFunc(
sqlite3_free(zErr);
return;
}
if( (db->flags & SQLITE_AttachWrite)==0 ){
flags &= ~(SQLITE_OPEN_CREATE|SQLITE_OPEN_READWRITE);
flags |= SQLITE_OPEN_READONLY;
}else if( (db->flags & SQLITE_AttachCreate)==0 ){
flags &= ~SQLITE_OPEN_CREATE;
}
assert( pVfs );
flags |= SQLITE_OPEN_MAIN_DB;
rc = sqlite3BtreeOpen(pVfs, zPath, db, &pNew->pBt, 0, flags);
+8 -2
View File
@@ -302,12 +302,18 @@ static int matchQuality(
u8 enc /* Desired text encoding */
){
int match;
assert( p->nArg>=-1 );
assert( p->nArg>=(-4) && p->nArg!=(-2) );
assert( nArg>=(-2) );
/* Wrong number of arguments means "no match" */
if( p->nArg!=nArg ){
if( nArg==(-2) ) return (p->xSFunc==0) ? 0 : FUNC_PERFECT_MATCH;
if( nArg==(-2) ) return p->xSFunc==0 ? 0 : FUNC_PERFECT_MATCH;
if( p->nArg>=0 ) return 0;
/* Special p->nArg values available to built-in functions only:
** -3 1 or more arguments required
** -4 2 or more arguments required
*/
if( p->nArg<(-2) && nArg<(-2-p->nArg) ) return 0;
}
/* Give a better score to a function with a specific number of arguments
+4 -1
View File
@@ -222,6 +222,9 @@ static int parseHhMmSs(const char *zDate, DateTime *p){
zDate++;
}
ms /= rScale;
/* Truncate to avoid problems with sub-milliseconds
** rounding. https://sqlite.org/forum/forumpost/766a2c9231 */
if( ms>0.999 ) ms = 0.999;
}
}else{
s = 0;
@@ -1429,7 +1432,7 @@ static void strftimeFunc(
}
case 'f': { /* Fractional seconds. (Non-standard) */
double s = x.s;
if( s>59.999 ) s = 59.999;
if( NEVER(s>59.999) ) s = 59.999;
sqlite3_str_appendf(&sRes, "%06.3f", s);
break;
}
+5 -12
View File
@@ -2695,12 +2695,10 @@ void sqlite3RegisterBuiltinFunctions(void){
FUNCTION(rtrim, 2, 2, 0, trimFunc ),
FUNCTION(trim, 1, 3, 0, trimFunc ),
FUNCTION(trim, 2, 3, 0, trimFunc ),
FUNCTION(min, -1, 0, 1, minmaxFunc ),
FUNCTION(min, 0, 0, 1, 0 ),
FUNCTION(min, -3, 0, 1, minmaxFunc ),
WAGGREGATE(min, 1, 0, 1, minmaxStep, minMaxFinalize, minMaxValue, 0,
SQLITE_FUNC_MINMAX|SQLITE_FUNC_ANYORDER ),
FUNCTION(max, -1, 1, 1, minmaxFunc ),
FUNCTION(max, 0, 1, 1, 0 ),
FUNCTION(max, -3, 1, 1, minmaxFunc ),
WAGGREGATE(max, 1, 1, 1, minmaxStep, minMaxFinalize, minMaxValue, 0,
SQLITE_FUNC_MINMAX|SQLITE_FUNC_ANYORDER ),
FUNCTION2(typeof, 1, 0, 0, typeofFunc, SQLITE_FUNC_TYPEOF),
@@ -2727,11 +2725,8 @@ void sqlite3RegisterBuiltinFunctions(void){
FUNCTION(hex, 1, 0, 0, hexFunc ),
FUNCTION(unhex, 1, 0, 0, unhexFunc ),
FUNCTION(unhex, 2, 0, 0, unhexFunc ),
FUNCTION(concat, -1, 0, 0, concatFunc ),
FUNCTION(concat, 0, 0, 0, 0 ),
FUNCTION(concat_ws, -1, 0, 0, concatwsFunc ),
FUNCTION(concat_ws, 0, 0, 0, 0 ),
FUNCTION(concat_ws, 1, 0, 0, 0 ),
FUNCTION(concat, -3, 0, 0, concatFunc ),
FUNCTION(concat_ws, -4, 0, 0, concatwsFunc ),
INLINE_FUNC(ifnull, 2, INLINEFUNC_coalesce, 0 ),
VFUNCTION(random, 0, 0, 0, randomFunc ),
VFUNCTION(randomblob, 1, 0, 0, randomBlob ),
@@ -2775,8 +2770,6 @@ void sqlite3RegisterBuiltinFunctions(void){
#ifdef SQLITE_ENABLE_UNKNOWN_SQL_FUNCTION
FUNCTION(unknown, -1, 0, 0, unknownFunc ),
#endif
FUNCTION(coalesce, 1, 0, 0, 0 ),
FUNCTION(coalesce, 0, 0, 0, 0 ),
#ifdef SQLITE_ENABLE_MATH_FUNCTIONS
MFUNCTION(ceil, 1, xCeil, ceilingFunc ),
MFUNCTION(ceiling, 1, xCeil, ceilingFunc ),
@@ -2814,7 +2807,7 @@ void sqlite3RegisterBuiltinFunctions(void){
MFUNCTION(pi, 0, 0, piFunc ),
#endif /* SQLITE_ENABLE_MATH_FUNCTIONS */
FUNCTION(sign, 1, 0, 0, signFunc ),
INLINE_FUNC(coalesce, -1, INLINEFUNC_coalesce, 0 ),
INLINE_FUNC(coalesce, -4, INLINEFUNC_coalesce, 0 ),
INLINE_FUNC(iif, 2, INLINEFUNC_iif, 0 ),
INLINE_FUNC(iif, 3, INLINEFUNC_iif, 0 ),
INLINE_FUNC(if, 2, INLINEFUNC_iif, 0 ),
+5 -1
View File
@@ -959,7 +959,7 @@ int sqlite3_db_config(sqlite3 *db, int op, ...){
default: {
static const struct {
int op; /* The opcode */
u32 mask; /* Mask of the bit in sqlite3.flags to set/clear */
u64 mask; /* Mask of the bit in sqlite3.flags to set/clear */
} aFlagOp[] = {
{ SQLITE_DBCONFIG_ENABLE_FKEY, SQLITE_ForeignKeys },
{ SQLITE_DBCONFIG_ENABLE_TRIGGER, SQLITE_EnableTrigger },
@@ -980,6 +980,8 @@ int sqlite3_db_config(sqlite3 *db, int op, ...){
{ SQLITE_DBCONFIG_TRUSTED_SCHEMA, SQLITE_TrustedSchema },
{ SQLITE_DBCONFIG_STMT_SCANSTATUS, SQLITE_StmtScanStatus },
{ SQLITE_DBCONFIG_REVERSE_SCANORDER, SQLITE_ReverseOrder },
{ SQLITE_DBCONFIG_ENABLE_ATTACH_CREATE, SQLITE_AttachCreate },
{ SQLITE_DBCONFIG_ENABLE_ATTACH_WRITE, SQLITE_AttachWrite },
};
unsigned int i;
rc = SQLITE_ERROR; /* IMP: R-42790-23372 */
@@ -3321,6 +3323,8 @@ static int openDatabase(
| SQLITE_EnableTrigger
| SQLITE_EnableView
| SQLITE_CacheSpill
| SQLITE_AttachCreate
| SQLITE_AttachWrite
#if !defined(SQLITE_TRUSTED_SCHEMA) || SQLITE_TRUSTED_SCHEMA+0!=0
| SQLITE_TrustedSchema
#endif
+1 -1
View File
@@ -1664,7 +1664,7 @@ static int unixFileLock(unixFile *pFile, struct flock *pLock){
if( (pFile->ctrlFlags & (UNIXFILE_EXCL|UNIXFILE_RDONLY))==UNIXFILE_EXCL ){
if( pInode->bProcessLock==0 ){
struct flock lock;
assert( pInode->nLock==0 );
/* assert( pInode->nLock==0 ); <-- Not true if unix-excl READONLY used */
lock.l_whence = SEEK_SET;
lock.l_start = SHARED_FIRST;
lock.l_len = SHARED_SIZE;
+1 -1
View File
@@ -808,7 +808,7 @@ int sqlite3PagerDirectReadOk(Pager *pPager, Pgno pgno){
if( pPager->pWal ){
u32 iRead = 0;
(void)sqlite3WalFindFrame(pPager->pWal, pgno, &iRead);
return iRead==0; /* Condition (4) */
if( iRead ) return 0; /* Case (4) */
}
#endif
assert( pPager->fd->pMethods->xDeviceCharacteristics!=0 );
+3
View File
@@ -8725,6 +8725,8 @@ static int do_meta_command(char *zLine, ShellState *p){
const char *zName;
int op;
} aDbConfig[] = {
{ "attach_create", SQLITE_DBCONFIG_ENABLE_ATTACH_CREATE },
{ "attach_write", SQLITE_DBCONFIG_ENABLE_ATTACH_WRITE },
{ "defensive", SQLITE_DBCONFIG_DEFENSIVE },
{ "dqs_ddl", SQLITE_DBCONFIG_DQS_DDL },
{ "dqs_dml", SQLITE_DBCONFIG_DQS_DML },
@@ -11475,6 +11477,7 @@ static int do_meta_command(char *zLine, ShellState *p){
{ 0x04000000, 1, "NullUnusedCols" },
{ 0x08000000, 1, "OnePass" },
{ 0x10000000, 1, "OrderBySubq" },
{ 0x20000000, 1, "StarQuery" },
{ 0xffffffff, 0, "All" },
};
unsigned int curOpt;
+38 -1
View File
@@ -2523,6 +2523,41 @@ struct sqlite3_mem_methods {
** first argument.
** </dd>
**
** [[SQLITE_DBCONFIG_ENABLE_ATTACH_CREATE]]
** <dt>SQLITE_DBCONFIG_ENABLE_ATTACH_CREATE</dt>
** <dd>The SQLITE_DBCONFIG_ENABLE_ATTACH_CREATE option enables the ability
** of the [ATTACH DATABASE] SQL command to create a new database if the
** database filed named by the SQL command does not already exist. This
** ability of [ATTACH] to create a new database is enabled by default, but
** can be disabled, using the current DBCONFIG option if desired.
** This option takes two arguments which are an integer and a pointer
** to an integer. The first argument is 1, 0, or -1 to enable, disable, or
** leave unchanged the attach-create flag, respectively. If the second
** argument is not NULL, then 0 or 1 is written into the integer that the
** second argument points to depending on if the attach-create flag is set
** after processing the first argument.
** </dd>
**
** [[SQLITE_DBCONFIG_ENABLE_ATTACH_WRITE]]
** <dt>SQLITE_DBCONFIG_ENABLE_ATTACH_WRITE</dt>
** <dd>The SQLITE_DBCONFIG_ENABLE_ATTACH_WRITE option enables the ability
** of the [ATTACH DATABASE] SQL command to create a new database that is
** open for writing. This capability is enabled by default, but
** can be disabled, using the current DBCONFIG option if desired. If this
** capability is disabled, the [ATTACH] command will still work, but the
** database is opened read-only. If this option is disabled, then the
** ability to create a new database using [ATTACH] is also disabled,
** regardless of the value of the [SQLITE_DBCONFIG_ENABLE_ATTACH_CREATE]
** option.
** This option takes two arguments which are an integer and a pointer
** to an integer. The first argument is 1, 0, or -1 to enable, disable, or
** leave unchanged the ability to ATTACH another database for writing,
** respectively. If the second argument is not NULL, then 0 or 1 is written
** into the integer that the second argument points to depending on if the
** ability to ATTACH a read/write database is set
** after processing the first argument.
** </dd>
**
** </dl>
*/
#define SQLITE_DBCONFIG_MAINDBNAME 1000 /* const char* */
@@ -2545,7 +2580,9 @@ struct sqlite3_mem_methods {
#define SQLITE_DBCONFIG_TRUSTED_SCHEMA 1017 /* int int* */
#define SQLITE_DBCONFIG_STMT_SCANSTATUS 1018 /* int int* */
#define SQLITE_DBCONFIG_REVERSE_SCANORDER 1019 /* int int* */
#define SQLITE_DBCONFIG_MAX 1019 /* Largest DBCONFIG */
#define SQLITE_DBCONFIG_ENABLE_ATTACH_CREATE 1020 /* int int* */
#define SQLITE_DBCONFIG_ENABLE_ATTACH_WRITE 1021 /* int int* */
#define SQLITE_DBCONFIG_MAX 1021 /* Largest DBCONFIG */
/*
** CAPI3REF: Enable Or Disable Extended Result Codes
+3
View File
@@ -1830,6 +1830,8 @@ struct sqlite3 {
#define SQLITE_CorruptRdOnly HI(0x00002) /* Prohibit writes due to error */
#define SQLITE_ReadUncommit HI(0x00004) /* READ UNCOMMITTED in shared-cache */
#define SQLITE_FkNoAction HI(0x00008) /* Treat all FK as NO ACTION */
#define SQLITE_AttachCreate HI(0x00010) /* ATTACH allowed to create new dbs */
#define SQLITE_AttachWrite HI(0x00020) /* ATTACH allowed to open for write */
/* Flags used only if debugging */
#ifdef SQLITE_DEBUG
@@ -1889,6 +1891,7 @@ struct sqlite3 {
#define SQLITE_NullUnusedCols 0x04000000 /* NULL unused columns in subqueries */
#define SQLITE_OnePass 0x08000000 /* Single-pass DELETE and UPDATE */
#define SQLITE_OrderBySubq 0x10000000 /* ORDER BY in subquery helps outer */
#define SQLITE_StarQuery 0x20000000 /* Heurists for star queries */
#define SQLITE_AllOpts 0xffffffff /* All optimizations */
/*
+1 -1
View File
@@ -1964,7 +1964,7 @@ static void DbHookCmd(
}
if( pArg ){
assert( !(*ppHook) );
if( Tcl_GetCharLength(pArg)>0 ){
if( Tcl_GetString(pArg)[0] ){
*ppHook = pArg;
Tcl_IncrRefCount(*ppHook);
}
+3
View File
@@ -607,6 +607,7 @@ static void registerTrace(int iReg, Mem *p){
printf("R[%d] = ", iReg);
memTracePrint(p);
if( p->pScopyFrom ){
assert( p->pScopyFrom->bScopy );
printf(" <== R[%d]", (int)(p->pScopyFrom - &p[-iReg]));
}
printf("\n");
@@ -1590,6 +1591,7 @@ case OP_Move: {
{ int i;
for(i=1; i<p->nMem; i++){
if( aMem[i].pScopyFrom==pIn1 ){
assert( aMem[i].bScopy );
aMem[i].pScopyFrom = pOut;
}
}
@@ -1662,6 +1664,7 @@ case OP_SCopy: { /* out2 */
#ifdef SQLITE_DEBUG
pOut->pScopyFrom = pIn1;
pOut->mScopyFlags = pIn1->flags;
pIn1->bScopy = 1;
#endif
break;
}
+1
View File
@@ -244,6 +244,7 @@ struct sqlite3_value {
#ifdef SQLITE_DEBUG
Mem *pScopyFrom; /* This Mem is a shallow copy of pScopyFrom */
u16 mScopyFlags; /* flags value immediately after the shallow copy */
u8 bScopy; /* The pScopyFrom of some other Mem *might* point here */
#endif
};
+2 -1
View File
@@ -783,7 +783,7 @@ static int sqlite3Step(Vdbe *p){
}
assert( db->nVdbeWrite>0 || db->autoCommit==0
|| (db->nDeferredCons==0 && db->nDeferredImmCons==0)
|| ((db->nDeferredCons + db->nDeferredImmCons)==0)
);
#ifndef SQLITE_OMIT_TRACE
@@ -1294,6 +1294,7 @@ static const Mem *columnNullValue(void){
#ifdef SQLITE_DEBUG
/* .pScopyFrom = */ (Mem*)0,
/* .mScopyFlags= */ 0,
/* .bScopy = */ 0,
#endif
};
return &nullMem;
+1
View File
@@ -2152,6 +2152,7 @@ static void initMemArray(Mem *p, int N, sqlite3 *db, u16 flags){
p->szMalloc = 0;
#ifdef SQLITE_DEBUG
p->pScopyFrom = 0;
p->bScopy = 0;
#endif
p++;
}while( (--N)>0 );
+22 -19
View File
@@ -1046,27 +1046,30 @@ int sqlite3VdbeMemTooBig(Mem *p){
void sqlite3VdbeMemAboutToChange(Vdbe *pVdbe, Mem *pMem){
int i;
Mem *pX;
for(i=1, pX=pVdbe->aMem+1; i<pVdbe->nMem; i++, pX++){
if( pX->pScopyFrom==pMem ){
u16 mFlags;
if( pVdbe->db->flags & SQLITE_VdbeTrace ){
sqlite3DebugPrintf("Invalidate R[%d] due to change in R[%d]\n",
(int)(pX - pVdbe->aMem), (int)(pMem - pVdbe->aMem));
if( pMem->bScopy ){
for(i=1, pX=pVdbe->aMem+1; i<pVdbe->nMem; i++, pX++){
if( pX->pScopyFrom==pMem ){
u16 mFlags;
if( pVdbe->db->flags & SQLITE_VdbeTrace ){
sqlite3DebugPrintf("Invalidate R[%d] due to change in R[%d]\n",
(int)(pX - pVdbe->aMem), (int)(pMem - pVdbe->aMem));
}
/* If pX is marked as a shallow copy of pMem, then try to verify that
** no significant changes have been made to pX since the OP_SCopy.
** A significant change would indicated a missed call to this
** function for pX. Minor changes, such as adding or removing a
** dual type, are allowed, as long as the underlying value is the
** same. */
mFlags = pMem->flags & pX->flags & pX->mScopyFlags;
assert( (mFlags&(MEM_Int|MEM_IntReal))==0 || pMem->u.i==pX->u.i );
/* pMem is the register that is changing. But also mark pX as
** undefined so that we can quickly detect the shallow-copy error */
pX->flags = MEM_Undefined;
pX->pScopyFrom = 0;
}
/* If pX is marked as a shallow copy of pMem, then try to verify that
** no significant changes have been made to pX since the OP_SCopy.
** A significant change would indicated a missed call to this
** function for pX. Minor changes, such as adding or removing a
** dual type, are allowed, as long as the underlying value is the
** same. */
mFlags = pMem->flags & pX->flags & pX->mScopyFlags;
assert( (mFlags&(MEM_Int|MEM_IntReal))==0 || pMem->u.i==pX->u.i );
/* pMem is the register that is changing. But also mark pX as
** undefined so that we can quickly detect the shallow-copy error */
pX->flags = MEM_Undefined;
pX->pScopyFrom = 0;
}
pMem->bScopy = 0;
}
pMem->pScopyFrom = 0;
}
+84 -39
View File
@@ -949,7 +949,7 @@ static void explainAutomaticIndex(
sqlite3_str *pStr = sqlite3_str_new(pParse->db);
sqlite3_str_appendf(pStr,"CREATE AUTOMATIC INDEX ON %s(", pTab->zName);
assert( pIdx->nColumn>1 );
assert( pIdx->aiColumn[pIdx->nColumn-1]==XN_ROWID );
assert( pIdx->aiColumn[pIdx->nColumn-1]==XN_ROWID || !HasRowid(pTab) );
for(ii=0; ii<(pIdx->nColumn-1); ii++){
const char *zName = 0;
int iCol = pIdx->aiColumn[ii];
@@ -1080,6 +1080,19 @@ static SQLITE_NOINLINE void constructAutomaticIndex(
}else{
extraCols = pSrc->colUsed & (~idxCols | MASKBIT(BMS-1));
}
if( !HasRowid(pTable) ){
/* For WITHOUT ROWID tables, ensure that all PRIMARY KEY columns are
** either in the idxCols mask or in the extraCols mask */
for(i=0; i<pTable->nCol; i++){
if( (pTable->aCol[i].colFlags & COLFLAG_PRIMKEY)==0 ) continue;
if( i>=BMS-1 ){
extraCols |= MASKBIT(BMS-1);
break;
}
if( idxCols & MASKBIT(i) ) continue;
extraCols |= MASKBIT(i);
}
}
mxBitCol = MIN(BMS-1,pTable->nCol);
testcase( pTable->nCol==BMS-1 );
testcase( pTable->nCol==BMS-2 );
@@ -1091,7 +1104,8 @@ static SQLITE_NOINLINE void constructAutomaticIndex(
}
/* Construct the Index object to describe this index */
pIdx = sqlite3AllocateIndexObject(pParse->db, nKeyCol+1, 0, &zNotUsed);
pIdx = sqlite3AllocateIndexObject(pParse->db, nKeyCol+HasRowid(pTable),
0, &zNotUsed);
if( pIdx==0 ) goto end_auto_index_create;
pLoop->u.btree.pIndex = pIdx;
pIdx->zName = "auto-index";
@@ -1147,8 +1161,10 @@ static SQLITE_NOINLINE void constructAutomaticIndex(
}
}
assert( n==nKeyCol );
pIdx->aiColumn[n] = XN_ROWID;
pIdx->azColl[n] = sqlite3StrBINARY;
if( HasRowid(pTable) ){
pIdx->aiColumn[n] = XN_ROWID;
pIdx->azColl[n] = sqlite3StrBINARY;
}
/* Create the automatic index */
explainAutomaticIndex(pParse, pIdx, pPartial!=0, &addrExp);
@@ -3923,7 +3939,6 @@ static int whereLoopAddBtree(
&& (pWInfo->pParse->db->flags & SQLITE_AutoIndex)!=0
&& !pSrc->fg.isIndexedBy /* Has no INDEXED BY clause */
&& !pSrc->fg.notIndexed /* Has no NOT INDEXED clause */
&& HasRowid(pTab) /* Not WITHOUT ROWID table. (FIXME: Why not?) */
&& !pSrc->fg.isCorrelated /* Not a correlated subquery */
&& !pSrc->fg.isRecursive /* Not a recursive common table expression. */
&& (pSrc->fg.jointype & JT_RIGHT)==0 /* Not the right tab of a RIGHT JOIN */
@@ -5427,9 +5442,10 @@ static LogEst whereSortingCost(
** 12 otherwise
**
** For the purposes of SQLite, a star-query is defined as a query
** with a large central table that is joined against four or more
** smaller tables. The central table is called the "fact" table.
** The smaller tables that get joined are "dimension tables".
** with a large central table that is joined (using an INNER JOIN,
** not a LEFT JOIN) against four or more smaller tables. The central
** table is called the "fact" table. The smaller tables that get
** joined are "dimension tables".
**
** SIDE EFFECT: (and really the whole point of this subroutine)
**
@@ -5443,7 +5459,10 @@ static LogEst whereSortingCost(
*/
static int computeMxChoice(WhereInfo *pWInfo, LogEst nRowEst){
int nLoop = pWInfo->nLevel; /* Number of terms in the join */
if( nRowEst==0 && nLoop>=5 ){
if( nRowEst==0
&& nLoop>=5
&& OptimizationEnabled(pWInfo->pParse->db, SQLITE_StarQuery)
){
/* Check to see if we are dealing with a star schema and if so, reduce
** the cost of fact tables relative to dimension tables, as a heuristic
** to help keep the fact tables in outer loops.
@@ -5457,7 +5476,11 @@ static int computeMxChoice(WhereInfo *pWInfo, LogEst nRowEst){
LogEst rDelta; /* Heuristic cost adjustment */
Bitmask mSeen = 0; /* Mask of dimension tables */
for(pWLoop=pWInfo->pLoops; pWLoop; pWLoop=pWLoop->pNextLoop){
if( (pWLoop->prereq & m)!=0 && (pWLoop->maskSelf & mSeen)==0 ){
if( (pWLoop->prereq & m)!=0 /* pWInfo depends on iLoop */
&& (pWLoop->maskSelf & mSeen)==0 /* pWInfo not already a dependency */
&& (pWInfo->pTabList->a[pWLoop->iTab].fg.jointype & JT_LEFT)==0
/* ^- pWInfo isn't a LEFT JOIN */
){
nDep++;
mSeen |= pWLoop->maskSelf;
}
@@ -5467,8 +5490,9 @@ static int computeMxChoice(WhereInfo *pWInfo, LogEst nRowEst){
#ifdef WHERETRACE_ENABLED /* 0x4 */
if( sqlite3WhereTrace&0x4 ){
SrcItem *pItem = pWInfo->pTabList->a + iLoop;
sqlite3DebugPrintf("Fact-table %s: %d dimensions, cost reduced %d\n",
pItem->zAlias ? pItem->zAlias : pItem->pSTab->zName,
sqlite3DebugPrintf(
"Fact-table %s(%d): %d dimensions, cost reduced %d\n",
pItem->zAlias ? pItem->zAlias : pItem->pSTab->zName, iLoop,
nDep, rDelta);
}
#endif
@@ -5490,6 +5514,28 @@ static int computeMxChoice(WhereInfo *pWInfo, LogEst nRowEst){
return pWInfo->nOutStarDelta>0 ? 18 : 12;
}
/*
** Two WhereLoop objects, pCandidate and pBaseline, are known to have the
** same cost. Look deep into each to see if pCandidate is even slightly
** better than pBaseline. Return false if it is, if pCandidate is is preferred.
** Return true if pBaseline is preferred or if we cannot tell the difference.
**
** Result Meaning
** -------- ----------------------------------------------------------
** true We cannot tell the difference in pCandidate and pBaseline
** false pCandidate seems like a better choice than pBaseline
*/
static SQLITE_NOINLINE int whereLoopIsNoBetter(
const WhereLoop *pCandidate,
const WhereLoop *pBaseline
){
if( (pCandidate->wsFlags & WHERE_INDEXED)==0 ) return 1;
if( (pBaseline->wsFlags & WHERE_INDEXED)==0 ) return 1;
if( pCandidate->u.btree.pIndex->szIdxRow <
pBaseline->u.btree.pIndex->szIdxRow ) return 0;
return 1;
}
/*
** Given the list of WhereLoop objects at pWInfo->pLoops, this routine
** attempts to find the lowest cost path that visits each WhereLoop
@@ -5511,7 +5557,7 @@ static int wherePathSolver(WhereInfo *pWInfo, LogEst nRowEst){
int mxI = 0; /* Index of next entry to replace */
int nOrderBy; /* Number of ORDER BY clause terms */
LogEst mxCost = 0; /* Maximum cost of a set of paths */
LogEst mxUnsorted = 0; /* Maximum unsorted cost of a set of path */
LogEst mxUnsort = 0; /* Maximum unsorted cost of a set of path */
int nTo, nFrom; /* Number of valid entries in aTo[] and aFrom[] */
WherePath *aFrom; /* All nFrom paths at the previous level */
WherePath *aTo; /* The nTo best paths at the current level */
@@ -5608,7 +5654,7 @@ static int wherePathSolver(WhereInfo *pWInfo, LogEst nRowEst){
for(pWLoop=pWInfo->pLoops; pWLoop; pWLoop=pWLoop->pNextLoop){
LogEst nOut; /* Rows visited by (pFrom+pWLoop) */
LogEst rCost; /* Cost of path (pFrom+pWLoop) */
LogEst rUnsorted; /* Unsorted cost of (pFrom+pWLoop) */
LogEst rUnsort; /* Unsorted cost of (pFrom+pWLoop) */
i8 isOrdered; /* isOrdered for (pFrom+pWLoop) */
Bitmask maskNew; /* Mask of src visited by (..) */
Bitmask revMask; /* Mask of rev-order loops for (..) */
@@ -5626,11 +5672,11 @@ static int wherePathSolver(WhereInfo *pWInfo, LogEst nRowEst){
/* At this point, pWLoop is a candidate to be the next loop.
** Compute its cost */
rUnsorted = pWLoop->rRun + pFrom->nRow;
rUnsort = pWLoop->rRun + pFrom->nRow;
if( pWLoop->rSetup ){
rUnsorted = sqlite3LogEstAdd(pWLoop->rSetup, rUnsorted);
rUnsort = sqlite3LogEstAdd(pWLoop->rSetup, rUnsort);
}
rUnsorted = sqlite3LogEstAdd(rUnsorted, pFrom->rUnsorted);
rUnsort = sqlite3LogEstAdd(rUnsort, pFrom->rUnsort);
nOut = pFrom->nRow + pWLoop->nOut;
maskNew = pFrom->maskLoop | pWLoop->maskSelf;
isOrdered = pFrom->isOrdered;
@@ -5652,15 +5698,15 @@ static int wherePathSolver(WhereInfo *pWInfo, LogEst nRowEst){
** extra encouragement to the query planner to select a plan
** where the rows emerge in the correct order without any sorting
** required. */
rCost = sqlite3LogEstAdd(rUnsorted, aSortCost[isOrdered]) + 3;
rCost = sqlite3LogEstAdd(rUnsort, aSortCost[isOrdered]) + 3;
WHERETRACE(0x002,
("---- sort cost=%-3d (%d/%d) increases cost %3d to %-3d\n",
aSortCost[isOrdered], (nOrderBy-isOrdered), nOrderBy,
rUnsorted, rCost));
rUnsort, rCost));
}else{
rCost = rUnsorted;
rUnsorted -= 2; /* TUNING: Slight bias in favor of no-sort plans */
rCost = rUnsort;
rUnsort -= 2; /* TUNING: Slight bias in favor of no-sort plans */
}
/* Check to see if pWLoop should be added to the set of
@@ -5686,7 +5732,7 @@ static int wherePathSolver(WhereInfo *pWInfo, LogEst nRowEst){
if( jj>=nTo ){
/* None of the existing best-so-far paths match the candidate. */
if( nTo>=mxChoice
&& (rCost>mxCost || (rCost==mxCost && rUnsorted>=mxUnsorted))
&& (rCost>mxCost || (rCost==mxCost && rUnsort>=mxUnsort))
){
/* The current candidate is no better than any of the mxChoice
** paths currently in the best-so-far buffer. So discard
@@ -5694,7 +5740,7 @@ static int wherePathSolver(WhereInfo *pWInfo, LogEst nRowEst){
#ifdef WHERETRACE_ENABLED /* 0x4 */
if( sqlite3WhereTrace&0x4 ){
sqlite3DebugPrintf("Skip %s cost=%-3d,%3d,%3d order=%c\n",
wherePathName(pFrom, iLoop, pWLoop), rCost, nOut, rUnsorted,
wherePathName(pFrom, iLoop, pWLoop), rCost, nOut, rUnsort,
isOrdered>=0 ? isOrdered+'0' : '?');
}
#endif
@@ -5713,7 +5759,7 @@ static int wherePathSolver(WhereInfo *pWInfo, LogEst nRowEst){
#ifdef WHERETRACE_ENABLED /* 0x4 */
if( sqlite3WhereTrace&0x4 ){
sqlite3DebugPrintf("New %s cost=%-3d,%3d,%3d order=%c\n",
wherePathName(pFrom, iLoop, pWLoop), rCost, nOut, rUnsorted,
wherePathName(pFrom, iLoop, pWLoop), rCost, nOut, rUnsort,
isOrdered>=0 ? isOrdered+'0' : '?');
}
#endif
@@ -5724,24 +5770,23 @@ static int wherePathSolver(WhereInfo *pWInfo, LogEst nRowEst){
** pTo or if the candidate should be skipped.
**
** The conditional is an expanded vector comparison equivalent to:
** (pTo->rCost,pTo->nRow,pTo->rUnsorted) <= (rCost,nOut,rUnsorted)
** (pTo->rCost,pTo->nRow,pTo->rUnsort) <= (rCost,nOut,rUnsort)
*/
if( pTo->rCost<rCost
|| (pTo->rCost==rCost
&& (pTo->nRow<nOut
|| (pTo->nRow==nOut && pTo->rUnsorted<=rUnsorted)
)
)
if( (pTo->rCost<rCost)
|| (pTo->rCost==rCost && pTo->nRow<nOut)
|| (pTo->rCost==rCost && pTo->nRow==nOut && pTo->rUnsort<rUnsort)
|| (pTo->rCost==rCost && pTo->nRow==nOut && pTo->rUnsort==rUnsort
&& whereLoopIsNoBetter(pWLoop, pTo->aLoop[iLoop]) )
){
#ifdef WHERETRACE_ENABLED /* 0x4 */
if( sqlite3WhereTrace&0x4 ){
sqlite3DebugPrintf(
"Skip %s cost=%-3d,%3d,%3d order=%c",
wherePathName(pFrom, iLoop, pWLoop), rCost, nOut, rUnsorted,
wherePathName(pFrom, iLoop, pWLoop), rCost, nOut, rUnsort,
isOrdered>=0 ? isOrdered+'0' : '?');
sqlite3DebugPrintf(" vs %s cost=%-3d,%3d,%3d order=%c\n",
wherePathName(pTo, iLoop+1, 0), pTo->rCost, pTo->nRow,
pTo->rUnsorted, pTo->isOrdered>=0 ? pTo->isOrdered+'0' : '?');
pTo->rUnsort, pTo->isOrdered>=0 ? pTo->isOrdered+'0' : '?');
}
#endif
/* Discard the candidate path from further consideration */
@@ -5755,11 +5800,11 @@ static int wherePathSolver(WhereInfo *pWInfo, LogEst nRowEst){
if( sqlite3WhereTrace&0x4 ){
sqlite3DebugPrintf(
"Update %s cost=%-3d,%3d,%3d order=%c",
wherePathName(pFrom, iLoop, pWLoop), rCost, nOut, rUnsorted,
wherePathName(pFrom, iLoop, pWLoop), rCost, nOut, rUnsort,
isOrdered>=0 ? isOrdered+'0' : '?');
sqlite3DebugPrintf(" was %s cost=%-3d,%3d,%3d order=%c\n",
wherePathName(pTo, iLoop+1, 0), pTo->rCost, pTo->nRow,
pTo->rUnsorted, pTo->isOrdered>=0 ? pTo->isOrdered+'0' : '?');
pTo->rUnsort, pTo->isOrdered>=0 ? pTo->isOrdered+'0' : '?');
}
#endif
}
@@ -5768,20 +5813,20 @@ static int wherePathSolver(WhereInfo *pWInfo, LogEst nRowEst){
pTo->revLoop = revMask;
pTo->nRow = nOut;
pTo->rCost = rCost;
pTo->rUnsorted = rUnsorted;
pTo->rUnsort = rUnsort;
pTo->isOrdered = isOrdered;
memcpy(pTo->aLoop, pFrom->aLoop, sizeof(WhereLoop*)*iLoop);
pTo->aLoop[iLoop] = pWLoop;
if( nTo>=mxChoice ){
mxI = 0;
mxCost = aTo[0].rCost;
mxUnsorted = aTo[0].nRow;
mxUnsort = aTo[0].nRow;
for(jj=1, pTo=&aTo[1]; jj<mxChoice; jj++, pTo++){
if( pTo->rCost>mxCost
|| (pTo->rCost==mxCost && pTo->rUnsorted>mxUnsorted)
|| (pTo->rCost==mxCost && pTo->rUnsort>mxUnsort)
){
mxCost = pTo->rCost;
mxUnsorted = pTo->rUnsorted;
mxUnsort = pTo->rUnsort;
mxI = jj;
}
}
+1 -1
View File
@@ -212,7 +212,7 @@ struct WherePath {
Bitmask revLoop; /* aLoop[]s that should be reversed for ORDER BY */
LogEst nRow; /* Estimated number of rows generated by this path */
LogEst rCost; /* Total cost of this path */
LogEst rUnsorted; /* Total cost of this path ignoring sorting costs */
LogEst rUnsort; /* Total cost of this path ignoring sorting costs */
i8 isOrdered; /* No. of ORDER BY terms satisfied. -1 for unknown */
WhereLoop **aLoop; /* Array of WhereLoop objects implementing this path */
};
+28
View File
@@ -563,4 +563,32 @@ do_execsql_test autoindex-1120 {
SELECT * FROM t1 LEFT JOIN t2 ON (t2.c=+t1.a) LEFT JOIN t3 ON (t2.d IS NULL);
} {1 1 1 2 {} {}}
# 2025-01-18
# Added support for automatic indexes on WITHOUT ROWID tables.
#
reset_db
do_execsql_test autoindex-1200 {
CREATE TABLE t1(a INT, b INT, x INT, PRIMARY KEY(a,b)) WITHOUT ROWID;
INSERT INTO t1 VALUES(1,2,90),(1,3,91),(1,4,92);
CREATE TABLE t2a(c INTEGER PRIMARY KEY, i1 INT);
CREATE TABLE t2b(i1 INTEGER PRIMARY KEY, d INT);
CREATE VIEW t2(c,d) AS SELECT c, d FROM t2a NATURAL JOIN t2b;
INSERT INTO t2a VALUES(3,93),(4,94),(5,95),(6,96),(7,97);
INSERT INTO t2b VALUES(91,11),(92,22),(93,33),(94,44),(95,55);
CREATE TABLE dual(dummy TEXT);
INSERT INTO dual(dummy) VALUES('x');
}
db null NULL
do_execsql_test autoindex-1210 {
SELECT t1.*, t2.* FROM t2 LEFT OUTER JOIN t1 ON b=c ORDER BY +b;
} {
NULL NULL NULL 5 55
1 3 91 3 33
1 4 92 4 44
}
do_execsql_test autoindex-1211 {
EXPLAIN QUERY PLAN
SELECT t1.*, t2.* FROM t2 LEFT OUTER JOIN t1 ON b=c ORDER BY +b;
} {/SEARCH t1 USING AUTOMATIC COVERING INDEX/}
finish_test
+8
View File
@@ -651,5 +651,13 @@ datetest 19.51 {date('2000-08-31','+0022-06-00','floor')} {2023-02-28}
datetest 19.52 {date('2000-08-31','+0023-06-00','ceiling')} {2024-03-02}
datetest 19.53 {date('2000-08-31','+0022-06-00','ceiling')} {2023-03-03}
# 2025-01-21
# https://sqlite.org/forum/forumpost/766a2c9231
#
datetest 20.1 {datetime('2024-12-31 23:59:59.9990')} {2024-12-31 23:59:59}
datetest 20.2 {datetime('2024-12-31 23:59:59.9999999999999')} \
{2024-12-31 23:59:59}
datetest 20.3 {datetime('2024-12-31 23:59:59.9995')} {2024-12-31 23:59:59}
datetest 20.4 {datetime('2024-12-31 23:59:58.9995')} {2024-12-31 23:59:58}
finish_test
+15
View File
@@ -250,7 +250,22 @@ do_catchsql_test 4.2 {
COMMIT;
} {1 {FOREIGN KEY constraint failed}}
#-------------------------------------------------------------------------
#
reset_db
do_execsql_test 5.0 {
PRAGMA foreign_keys = 1;
CREATE TABLE p1(a INTEGER PRIMARY KEY, b);
CREATE TABLE c1(x REFERENCES p1 DEFERRABLE INITIALLY DEFERRED);
}
do_execsql_test 5.1 {
BEGIN;
INSERT INTO c1 VALUES(123);
PRAGMA defer_foreign_keys = 1;
INSERT INTO p1 VALUES(123, 'one two three');
COMMIT;
}
finish_test
+53
View File
@@ -0,0 +1,53 @@
# Performance And Size Measurements
This document shows a procedure for making performance and size
comparisons between two versions of the SQLite Amalgamation "sqlite3.c".
You will need:
* fossil
* valgrind
* tclsh
* A script or program named "open" that brings up *.txt files in an
editor for viewing. (Macs provide this by default. You'll need to
come up with your own on Linxu and Windows.)
* An SQLite source tree
The procedure described in this document is not the only way to make
performance and size measurements. Use this as a guide and make
adjustments as needed.
## Establish the baseline measurement
* Begin at the root the SQLite source tree
* <b>mkdir -p ../speed</b> <br>
&uarr; Speed measurement output files will go into this directory.
You can actually put those files wherever you want. This is just a
suggestion. It might be good to keep these files outside of the
source tree so that "fossil clean" does not delete them.
* Obtain the baseline SQLite amalgamation. For the purpose of this
technical note, assume the baseline SQLite sources are in files
"../baseline/sqlite3.c" and "../baseline/sqlite3.h".
* <b>test/speedtest.tcl ../baseline/sqlite3.c ../speed/baseline.txt</b> <br>
&uarr; The performance measure will be written into ../speed/baseline.txt
and that file will be brought up in an editor for easy viewing. <br>
&uarr; The "sqlite3.h" will be taken from the directory that contains
the "sqlite3.c" amalgamation file.
## Comparing the current checkout against the baseline
* <b>make sqlite3.c</b>
* <b>test/speedtest.tcl sqlite3.c ../speed/test.txt ../speed/baseline.txt</b> <br>
&uarr; Test results written into ../speed/test.txt and then
"fossil xdiff" is run to compare ../speed/baseline.txt against
the new test results.
## When to do this
Performance and size checks should be done prior to trunk check-ins.
Sometimes a seemingly innocuous change can have large performance
impacts. A large impact does not mean that the change cannot continue,
but it is important to be aware of the impact.
## Additional hints
Use the --help option to test/speedtest.tcl to see other available options.
+290
View File
@@ -0,0 +1,290 @@
#!/bin/sh
# the next line restarts using tclsh \
exec tclsh "$0" ${1+"$@"}
#
# This program runs performance testing on sqlite3.c. Usage:
set usage {USAGE:
speedtest.tcl sqlite3.c x1.txt trunk.txt -Os -DSQLITE_ENABLE_STAT4
| | | `-----------------------'
File to test ----' | | |
| | `- options
Output filename --------' |
`--- optional prior output to diff
Do a cache-grind performance analysis of the sqlite3.c file named and
write the results into the output file. The ".txt" is appended to the
output file (and diff-file) name if it is not already present. If the
diff-file is specified then show a diff from the diff-file to the new
output.
Other options include:
CC=... Specify an alternative C compiler. Default is "gcc".
-D... -D and -O options are passed through to the C compiler.
--dryrun Show what would happen but don't do anything.
--help Show this help screen.
--lean "Lean" mode.
--lookaside N SZ Lookahead uses N slots of SZ bytes each.
--pagesize N Use N as the page size.
--quiet | -q "Quite". Put results in file but don't pop up editor
--testset TEST Specify the specific testset to use. The default
is "mix1". Other options include: "main", "json",
"cte", "orm", "fp", "rtree".
}
set srcfile {}
set outfile {}
set difffile {}
set cflags {-DSQLITE_OMIT_LOAD_EXTENSION -DSQLITE_THREADSAFE=0}
set cc gcc
set testset mix1
set dryrun 0
set quiet 0
set speedtestflags {--shrink-memory --reprepare --stats --heap 40000000 64}
lappend speedtestflags --journal wal --size 5
for {set i 0} {$i<[llength $argv]} {incr i} {
set arg [lindex $argv $i]
if {[string index $arg 0]=="-"} {
switch -- $arg {
-pagesize -
--pagesize {
lappend speedtestflags --pagesize
incr i
lappend speedtestflags [lindex $argv $i]
}
-lookaside -
--lookaside {
lappend speedtestflags --lookaside
incr i
lappend speedtestflags [lindex $argv $i]
incr i
lappend speedtestflags [lindex $argv $i]
}
-lean -
--lean {
lappend cflags \
-DSQLITE_DEFAULT_MEMSTATUS=0 \
-DSQLITE_DEFAULT_WAL_SYNCHRONOUS=1 \
-DSQLITE_LIKE_DOESNT_MATCH_BLOBS=1 \
-DSQLITE_MAX_EXPR_DEPTH=1 \
-DSQLITE_OMIT_DECLTYPE \
-DSQLITE_OMIT_DEPRECATED \
-DSQLITE_OMIT_PROGRESS_CALLBACK \
-DSQLITE_OMIT_SHARED_CACHE \
-DSQLITE_USE_ALLOCA
}
-testset -
--testset {
incr i
set testset [lindex $argv $i]
}
-n -
-dryrun -
--dryrun {
set dryrun 1
}
-? -
-help -
--help {
puts $usage
exit 0
}
-q -
-quiet -
--quiet {
set quiet 1
}
default {
lappend cflags $arg
}
}
continue
}
if {[string match CC=* $arg]} {
set cc [lrange $arg 3 end]
continue
}
if {[string match *.c $arg]} {
if {$srcfile!=""} {
puts stderr "multiple source files: $srcfile $arg"
exit 1
}
set srcfile $arg
continue
}
if {[lsearch {main cte rtree orm fp json parsenumber mix1} $arg]>=0} {
set testset $arg
continue
}
if {$outfile==""} {
set outfile $arg
continue
}
if {$difffile==""} {
set difffile $arg
continue
}
puts stderr "unknown option: \"$arg\". Use --help for more info."
exit 1
}
if {[lsearch -glob $cflags -O*]<0} {
lappend cflags -Os
}
if {[lsearch -glob $cflags -DSQLITE_ENABLE_MEMSYS*]<0} {
lappend cflags -DSQLITE_ENABLE_MEMSYS5
}
if {[lsearch -glob $cflags -DSQLITE_ENABLE_RTREE*]<0} {
lappend cflags -DSQLITE_ENABLE_RTREE
}
if {$srcfile==""} {
puts stderr "no sqlite3.c source file specified"
exit 1
}
if {![file readable $srcfile]} {
puts stderr "source file \"$srcfile\" does not exist"
exit 1
}
if {$outfile==""} {
puts stderr "no output file specified"
exit 1
}
if {![string match *.* [file tail $outfile]]} {
append outfile .txt
}
if {$difffile!=""} {
if {![file exists $difffile]} {
if {[file exists $difffile.txt]} {
append difffile .txt
} else {
puts stderr "No such file: \"$difffile\""
exit 1
}
}
}
set cccmd [list $cc -g]
lappend cccmd -I[file dir $srcfile]
lappend cccmd {*}[lsort $cflags]
lappend cccmd [file dir $argv0]/speedtest1.c
lappend cccmd $srcfile
lappend cccmd -o speedtest1
puts $cccmd
if {!$dryrun} {
exec {*}$cccmd
}
lappend speedtestflags --testset $testset
set stcmd [list valgrind --tool=cachegrind ./speedtest1 {*}$speedtestflags]
lappend stcmd >valgrind-out.txt 2>valgrind-err.txt
puts $stcmd
if {!$dryrun} {
exec {*}$stcmd
}
set maxmtime 0
set cgfile {}
foreach cgout [glob -nocomplain cachegrind.out.*] {
if {[file mtime $cgout]>$maxmtime} {
set cgfile $cgout
set maxmtime [file mtime $cgfile]
}
}
if {$cgfile==""} {
puts "no cachegrind output"
exit 1
}
############# Process the cachegrind.out.# file ##########################
set fd [open $outfile wb]
set in [open "|cg_annotate --show=Ir --auto=yes --context=40 $cgfile" r]
set dest !
set out(!) {}
set linenum 0
set cntlines 0 ;# true to remember cycle counts on each line
set seenSqlite3 0 ;# true if we have seen the sqlite3.c file
while {![eof $in]} {
set line [string map {\t { }} [gets $in]]
if {[regexp {^-- Auto-annotated source: (.*)} $line all name]} {
set dest $name
if {[string match */sqlite3.c $dest]} {
set cntlines 1
set seenSqlite3 1
} else {
set cntlines 0
}
} elseif {[regexp {^-- line (\d+) ------} $line all ln]} {
set line [lreplace $line 2 2 {#}]
set linenum [expr {$ln-1}]
} elseif {[regexp {^The following files chosen for } $line]} {
set dest !
}
append out($dest) $line\n
if {$cntlines} {
incr linenum
if {[regexp {^ *([0-9,]+) } $line all x]} {
set x [string map {, {}} $x]
set cycles($linenum) $x
}
}
}
foreach x [lsort [array names out]] {
puts $fd $out($x)
}
# If the sqlite3.c file has been seen, then output a summary of the
# cycle counts for each file that went into making up sqlite3.c
#
if {$seenSqlite3} {
close $in
set in [open sqlite3.c]
set linenum 0
set fn sqlite3.c
set pattern1 {^/\*+ Begin file ([^ ]+) \*}
set pattern2 {^/\*+ Continuing where we left off in ([^ ]+) \*}
while {![eof $in]} {
set line [gets $in]
incr linenum
if {[regexp $pattern1 $line all newfn]} {
set fn $newfn
} elseif {[regexp $pattern2 $line all newfn]} {
set fn $newfn
} elseif {[info exists cycles($linenum)]} {
incr fcycles($fn) $cycles($linenum)
}
}
close $in
puts $fd \
{**********************************************************************}
set lx {}
set sum 0
foreach {fn cnt} [array get fcycles] {
lappend lx [list $cnt $fn]
incr sum $cnt
}
puts $fd [format {%20s %14d %8.3f%%} TOTAL $sum 100]
foreach entry [lsort -index 0 -integer -decreasing $lx] {
foreach {cnt fn} $entry break
puts $fd [format {%20s %14d %8.3f%%} $fn $cnt [expr {$cnt*100.0/$sum}]]
}
}
puts $fd "Executable size:"
close $fd
exec size speedtest1 >>$outfile
#
# Processed cachegrind output should now be in the $outfile
#############################################################################
if {$quiet} {
# Skip this last part of popping up a GUI viewer
} elseif {$difffile!=""} {
set fossilcmd {fossil xdiff --tk -c 20}
lappend fossilcmd $difffile
lappend fossilcmd $outfile
lappend fossilcmd &
puts $fossilcmd
if {!$dryrun} {
exec {*}$fossilcmd
}
} else {
if {!$dryrun} {
exec open $outfile
}
}
+143 -7
View File
@@ -42,7 +42,9 @@ static const char zHelp[] =
" --stats Show statistics at the end\n"
" --stmtscanstatus Activate SQLITE_DBCONFIG_STMT_SCANSTATUS\n"
" --temp N N from 0 to 9. 0: no temp table. 9: all temp tables\n"
" --testset T Run test-set T (main, cte, rtree, orm, fp, debug)\n"
" --testset T Run test-set T (main, cte, rtree, orm, fp, json, debug)\n"
" Can be a comma-separated list of values, with /SCALE suffixes\n"
" or macro \"mix1\"\n"
" --trace Turn on SQL tracing\n"
" --threads N Use up to N threads for sorting\n"
" --utf16be Set text encoding to UTF-16BE\n"
@@ -99,6 +101,7 @@ static struct Global {
int bMemShrink; /* Call sqlite3_db_release_memory() often */
int eTemp; /* 0: no TEMP. 9: always TEMP. */
int szTest; /* Scale factor for test iterations */
int szBase; /* Base size prior to testset scaling */
int nRepeat; /* Repeat selects this many times */
int doCheckpoint; /* Run PRAGMA wal_checkpoint after each trans */
int nReserve; /* Reserve bytes */
@@ -2149,6 +2152,120 @@ void testset_debug1(void){
}
}
/*
** Performance tests for JSON.
*/
void testset_json(void){
unsigned int r = 0x12345678;
sqlite3_test_control(SQLITE_TESTCTRL_PRNG_SEED, r, g.db);
speedtest1_begin_test(100, "table J1 is %d rows of JSONB",
g.szTest*5);
speedtest1_exec(
"CREATE TABLE j1(x JSONB);\n"
"WITH RECURSIVE\n"
" jval(n,j) AS (\n"
" VALUES(0,'{}'),(1,'[]'),(2,'true'),(3,'false'),(4,'null'),\n"
" (5,'{x:1,y:2}'),(6,'0.0'),(7,'3.14159'),(8,'-99.9'),\n"
" (9,'[1,2,\"\\n\\u2192\\\"\\u2190\",4]')\n"
" ),\n"
" c(x) AS (VALUES(1) UNION ALL SELECT x+1 FROM c WHERE x<26*26-1),\n"
" array1(y) AS MATERIALIZED (\n"
" SELECT jsonb_group_array(\n"
" jsonb_object('x',x,\n"
" 'y',jsonb(coalesce(j,random()%%10000)),\n"
" 'z',hex(randomblob(50)))\n"
" )\n"
" FROM c LEFT JOIN jval ON (x%%20)=n\n"
" ),\n"
" object1(z) AS MATERIALIZED (\n"
" SELECT jsonb_group_object(char(0x61+x%%26,0x61+(x/26)%%26),\n"
" jsonb( coalesce(j,random()%%10000)))\n"
" FROM c LEFT JOIN jval ON (x%%20)=n\n"
" ),\n"
" c2(n) AS (VALUES(1) UNION ALL SELECT n+1 FROM c2 WHERE n<%d)\n"
"INSERT INTO j1(x)\n"
" SELECT jsonb_object('a',n,'b',n+10000,'c',jsonb(y),'d',jsonb(z),\n"
" 'e',n+20000,'f',n+30000)\n"
" FROM array1, object1, c2;",
g.szTest*5
);
speedtest1_end_test();
speedtest1_begin_test(110, "table J2 is %d rows from J1 converted to text", g.szTest);
speedtest1_exec(
"CREATE TABLE j2(x JSON TEXT);\n"
"INSERT INTO j2(x) SELECT json(x) FROM j1 LIMIT %d", g.szTest
);
speedtest1_end_test();
speedtest1_begin_test(120, "create indexes on JSON expressions on J1");
speedtest1_exec(
"BEGIN;\n"
"CREATE INDEX j1x1 ON j1(x->>'a');\n"
"CREATE INDEX j1x2 ON j1(x->>'b');\n"
"CREATE INDEX j1x3 ON j1(x->>'f');\n"
"COMMIT;\n"
);
speedtest1_end_test();
speedtest1_begin_test(130, "create indexes on JSON expressions on J2");
speedtest1_exec(
"BEGIN;\n"
"CREATE INDEX j2x1 ON j2(x->>'a');\n"
"CREATE INDEX j2x2 ON j2(x->>'b');\n"
"CREATE INDEX j2x3 ON j2(x->>'f');\n"
"COMMIT;\n"
);
speedtest1_end_test();
speedtest1_begin_test(140, "queries against J1");
speedtest1_exec(
"WITH c(n) AS (VALUES(0) UNION ALL SELECT n+1 FROM c WHERE n<7)\n"
" SELECT sum(x->>format('$.c[%%d].x',n)) FROM c, j1;\n"
"WITH c(n) AS (VALUES(1) UNION ALL SELECT n+1 FROM c WHERE n<5)\n"
" SELECT sum(x->>format('$.\"c\"[#-%%d].y',n)) FROM c, j1;\n"
"SELECT sum(x->>'$.d.ez' + x->>'$.d.\"xz\"' + x->>'a' + x->>'$.c[10].y') FROM j1;\n"
"SELECT x->>'$.d.tz[2]', x->'$.d.tz' FROM j1;\n"
);
speedtest1_end_test();
speedtest1_begin_test(141, "queries involving json_type()");
speedtest1_exec(
"WITH c(n) AS (VALUES(1) UNION ALL SELECT n+1 FROM c WHERE n<20)\n"
" SELECT json_type(x,format('$.c[#-%%d].y',n)), count(*)\n"
" FROM c, j1\n"
" WHERE j1.rowid=1\n"
" GROUP BY 1 ORDER BY 2;"
);
speedtest1_end_test();
speedtest1_begin_test(150, "json_insert()/set()/remove() on every row of J1");
speedtest1_exec(
"BEGIN;\n"
"UPDATE j1 SET x=jsonb_insert(x,'$.g',(x->>'f')+1,'$.h',3.14159,'$.i','hello',\n"
" '$.j',json('{x:99}'),'$.k','{y:98}');\n"
"UPDATE j1 SET x=jsonb_set(x,'$.e',(x->>'f')-1);\n"
"UPDATE j1 SET x=jsonb_remove(x,'$.d');\n"
"COMMIT;\n"
);
speedtest1_end_test();
speedtest1_begin_test(160, "json_insert()/set()/remove() on every row of J2");
speedtest1_exec(
"BEGIN;\n"
"UPDATE j2 SET x=json_insert(x,'$.g',(x->>'f')+1);\n"
"UPDATE j2 SET x=json_set(x,'$.e',(x->>'f')-1);\n"
"UPDATE j2 SET x=json_remove(x,'$.d');\n"
"COMMIT;\n"
);
speedtest1_end_test();
}
/*
** This testset focuses on the speed of parsing numeric literals (integers
** and real numbers). This was added to test the impact of allowing "_"
@@ -2168,25 +2285,25 @@ void testset_parsenumber(void){
const int NROW = 100*g.szTest;
int ii;
speedtest1_begin_test(100, "parsing small integers");
speedtest1_begin_test(100, "parsing %d small integers", NROW);
for(ii=0; ii<NROW; ii++){
sqlite3_exec(g.db, zSql1, 0, 0, 0);
}
speedtest1_end_test();
speedtest1_begin_test(110, "parsing large integers");
speedtest1_begin_test(110, "parsing %d large integers", NROW);
for(ii=0; ii<NROW; ii++){
sqlite3_exec(g.db, zSql2, 0, 0, 0);
}
speedtest1_end_test();
speedtest1_begin_test(200, "parsing small reals");
speedtest1_begin_test(200, "parsing %d small reals", NROW);
for(ii=0; ii<NROW; ii++){
sqlite3_exec(g.db, zSql3, 0, 0, 0);
}
speedtest1_end_test();
speedtest1_begin_test(210, "parsing large reals");
speedtest1_begin_test(210, "parsing %d large reals", NROW);
for(ii=0; ii<NROW; ii++){
sqlite3_exec(g.db, zSql4, 0, 0, 0);
}
@@ -2299,6 +2416,7 @@ int main(int argc, char **argv){
g.zNN = "";
g.zPK = "UNIQUE";
g.szTest = 100;
g.szBase = 100;
g.nRepeat = 1;
for(i=1; i<argc; i++){
const char *z = argv[i];
@@ -2408,7 +2526,7 @@ int main(int argc, char **argv){
g.bMemShrink = 1;
}else if( strcmp(z,"size")==0 ){
ARGC_VALUE_CHECK(1);
g.szTest = integerValue(argv[++i]);
g.szTest = g.szBase = integerValue(argv[++i]);
}else if( strcmp(z,"stats")==0 ){
showStats = 1;
}else if( strcmp(z,"temp")==0 ){
@@ -2419,8 +2537,10 @@ int main(int argc, char **argv){
}
g.eTemp = argv[i][0] - '0';
}else if( strcmp(z,"testset")==0 ){
static char zMix1Tests[] = "main,orm/25,cte/20,json,fp/3,parsenumber/25,rtree/10";
ARGC_VALUE_CHECK(1);
zTSet = argv[++i];
if( strcmp(zTSet,"mix1")==0 ) zTSet = zMix1Tests;
}else if( strcmp(z,"trace")==0 ){
doTrace = 1;
}else if( strcmp(z,"threads")==0 ){
@@ -2574,6 +2694,7 @@ int main(int argc, char **argv){
if( g.bExplain ) printf(".explain\n.echo on\n");
do{
char *zThisTest = zTSet;
char *zSep;
char *zComma = strchr(zThisTest,',');
if( zComma ){
*zComma = 0;
@@ -2581,7 +2702,20 @@ int main(int argc, char **argv){
}else{
zTSet = "";
}
if( g.iTotal>0 || zComma!=0 ){
zSep = strchr(zThisTest, '/');
if( zSep ){
int kk;
for(kk=1; zSep[kk] && ISDIGIT(zSep[kk]); kk++){}
if( kk==1 || zSep[kk]!=0 ){
fatal_error("bad modifier on testset name: \"%s\"", zThisTest);
}
g.szTest = g.szBase*integerValue(zSep+1)/100;
if( g.szTest<=0 ) g.szTest = 1;
zSep[0] = 0;
}else{
g.szTest = g.szBase;
}
if( g.iTotal>0 || zComma==0 ){
printf(" Begin testset \"%s\"\n", zThisTest);
}
if( strcmp(zThisTest,"main")==0 ){
@@ -2594,6 +2728,8 @@ int main(int argc, char **argv){
testset_cte();
}else if( strcmp(zThisTest,"fp")==0 ){
testset_fp();
}else if( strcmp(zThisTest,"json")==0 ){
testset_json();
}else if( strcmp(zThisTest,"trigger")==0 ){
testset_trigger();
}else if( strcmp(zThisTest,"parsenumber")==0 ){
+6
View File
@@ -325,6 +325,12 @@ do_eqp_test 331 {
# marked with M10d_Yes and hence prohibited from participating in the
# query flattening optimization.
#
# Updated 2025-01-02.
# https://sqlite.org/forum/forumpost/8f38fc9878a92aa9
#
# The same optimization that made Grunthos's query fast made
# Jean-Noël Mayor's query slow. Bummer.
#
reset_db
db eval {
CREATE TABLE raw(country,date,total,delta, UNIQUE(country,date));
+4
View File
@@ -68,6 +68,10 @@ cat $TMPSPACE/configure.ac |
sed "s/--SQLITE-VERSION--/$VERSION/" > $TMPSPACE/tmp
mv $TMPSPACE/tmp $TMPSPACE/configure.ac
cat $TMPSPACE/sqlite3.pc.in |
sed "s/^Libs.private:.*/Libs.private: @LIBS@/" > $TMPSPACE/tmp
mv $TMPSPACE/tmp $TMPSPACE/sqlite3.pc.in
cd $TMPSPACE
autoreconf -i
#libtoolize
+18 -1
View File
@@ -111,7 +111,24 @@ void do_it_all(void){
}
else if(slash == ch){
/* MARKER(("state 0 ==> 1 @ %d:%d\n", line, col)); */
state = S_SLASH1;
if( '\\'==prev ){
/**
JS regexes may contain slash-asterisks, as happened at:
https://github.com/emscripten-core/emscripten/issues/23412
Such regexes will always necessarily be preceeded by a
backslash, though.
It is hypothetically possible for a legitimate comment
slash-asterisk to appear immediately before a
backslash, but that seems like an even rarer corner
case than the JS regex case.
*/
fputc(ch, out);
}else{
state = S_SLASH1;
}
break;
}
fputc(ch, out);