From de30fb5fc2a9832f1f7954779347efef1504acf5 Mon Sep 17 00:00:00 2001 From: dan Date: Tue, 3 Sep 2024 18:55:38 +0000 Subject: [PATCH 01/34] Store the values of any UNINDEXED columns of a contentless fts5 table persistently in the database. Warning: This currently creates a (technically) incompatible file-format for contentless fts5 tables that have UNINDEXED columns. FossilOrigin-Name: dcacb1a8ef359b4507b4733356d3150ba5dc105cc9867c103d16a0908a1a9f64 --- ext/fts5/fts5Int.h | 7 +- ext/fts5/fts5_config.c | 22 +++- ext/fts5/fts5_main.c | 4 +- ext/fts5/fts5_storage.c | 104 +++++++++++------- ext/fts5/test/fts5unindexed2.test | 176 ++++++++++++++++++++++++++++++ manifest | 24 ++-- manifest.uuid | 2 +- 7 files changed, 279 insertions(+), 60 deletions(-) create mode 100644 ext/fts5/test/fts5unindexed2.test diff --git a/ext/fts5/fts5Int.h b/ext/fts5/fts5Int.h index 7e41119572..552f065837 100644 --- a/ext/fts5/fts5Int.h +++ b/ext/fts5/fts5Int.h @@ -262,9 +262,10 @@ struct Fts5Config { #define FTS5_CURRENT_VERSION 4 #define FTS5_CURRENT_VERSION_SECUREDELETE 5 -#define FTS5_CONTENT_NORMAL 0 -#define FTS5_CONTENT_NONE 1 -#define FTS5_CONTENT_EXTERNAL 2 +#define FTS5_CONTENT_NORMAL 0 +#define FTS5_CONTENT_NONE 1 +#define FTS5_CONTENT_EXTERNAL 2 +#define FTS5_CONTENT_UNINDEXED 3 #define FTS5_DETAIL_FULL 0 #define FTS5_DETAIL_NONE 1 diff --git a/ext/fts5/fts5_config.c b/ext/fts5/fts5_config.c index 3cb1bd3bea..8f4e57b4b8 100644 --- a/ext/fts5/fts5_config.c +++ b/ext/fts5/fts5_config.c @@ -477,7 +477,8 @@ static int fts5ConfigParseColumn( Fts5Config *p, char *zCol, char *zArg, - char **pzErr + char **pzErr, + int *pbUnindexed ){ int rc = SQLITE_OK; if( 0==sqlite3_stricmp(zCol, FTS5_RANK_NAME) @@ -488,6 +489,7 @@ static int fts5ConfigParseColumn( }else if( zArg ){ if( 0==sqlite3_stricmp(zArg, "unindexed") ){ p->abUnindexed[p->nCol] = 1; + *pbUnindexed = 1; }else{ *pzErr = sqlite3_mprintf("unrecognized column option: %s", zArg); rc = SQLITE_ERROR; @@ -508,11 +510,17 @@ static int fts5ConfigMakeExprlist(Fts5Config *p){ sqlite3Fts5BufferAppendPrintf(&rc, &buf, "T.%Q", p->zContentRowid); if( p->eContent!=FTS5_CONTENT_NONE ){ + assert( p->eContent==FTS5_CONTENT_EXTERNAL + || p->eContent==FTS5_CONTENT_NORMAL + || p->eContent==FTS5_CONTENT_UNINDEXED + ); for(i=0; inCol; i++){ if( p->eContent==FTS5_CONTENT_EXTERNAL ){ sqlite3Fts5BufferAppendPrintf(&rc, &buf, ", T.%Q", p->azCol[i]); - }else{ + }else if( p->eContent==FTS5_CONTENT_NORMAL || p->abUnindexed[i] ){ sqlite3Fts5BufferAppendPrintf(&rc, &buf, ", T.c%d", i); + }else{ + sqlite3Fts5BufferAppendPrintf(&rc, &buf, ", NULL"); } } } @@ -546,6 +554,7 @@ int sqlite3Fts5ConfigParse( Fts5Config *pRet; /* New object to return */ int i; sqlite3_int64 nByte; + int bUnindexed = 0; /* True if there are one or more UNINDEXED */ *ppOut = pRet = (Fts5Config*)sqlite3_malloc(sizeof(Fts5Config)); if( pRet==0 ) return SQLITE_NOMEM; @@ -605,7 +614,7 @@ int sqlite3Fts5ConfigParse( pzErr ); }else{ - rc = fts5ConfigParseColumn(pRet, zOne, zTwo, pzErr); + rc = fts5ConfigParseColumn(pRet, zOne, zTwo, pzErr, &bUnindexed); zOne = 0; } } @@ -640,11 +649,14 @@ int sqlite3Fts5ConfigParse( /* If no zContent option was specified, fill in the default values. */ if( rc==SQLITE_OK && pRet->zContent==0 ){ const char *zTail = 0; - assert( pRet->eContent==FTS5_CONTENT_NORMAL - || pRet->eContent==FTS5_CONTENT_NONE + assert( pRet->eContent==FTS5_CONTENT_NORMAL + || pRet->eContent==FTS5_CONTENT_NONE ); if( pRet->eContent==FTS5_CONTENT_NORMAL ){ zTail = "content"; + }else if( bUnindexed ){ + pRet->eContent = FTS5_CONTENT_UNINDEXED; + zTail = "content"; }else if( pRet->bColumnsize ){ zTail = "docsize"; } diff --git a/ext/fts5/fts5_main.c b/ext/fts5/fts5_main.c index 03c1bb83fa..c5ff2fad75 100644 --- a/ext/fts5/fts5_main.c +++ b/ext/fts5/fts5_main.c @@ -1778,7 +1778,9 @@ static int fts5SpecialInsert( } bLoadConfig = 1; }else if( 0==sqlite3_stricmp("rebuild", zCmd) ){ - if( pConfig->eContent==FTS5_CONTENT_NONE ){ + if( pConfig->eContent==FTS5_CONTENT_NONE + || pConfig->eContent==FTS5_CONTENT_UNINDEXED + ){ fts5SetVtabError(pTab, "'rebuild' may not be used with a contentless fts5 table" ); diff --git a/ext/fts5/fts5_storage.c b/ext/fts5/fts5_storage.c index cf25eb361e..e2c47c0072 100644 --- a/ext/fts5/fts5_storage.c +++ b/ext/fts5/fts5_storage.c @@ -144,19 +144,21 @@ static int fts5StorageGetStmt( case FTS5_STMT_INSERT_CONTENT: case FTS5_STMT_REPLACE_CONTENT: { int nCol = pC->nCol + 1; - char *zBind; + char *zBind = 0; int i; - zBind = sqlite3_malloc64(1 + nCol*2); - if( zBind ){ - for(i=0; ieContent==FTS5_CONTENT_NORMAL + || pC->eContent==FTS5_CONTENT_UNINDEXED + ); + + for(i=0; rc==SQLITE_OK && ieContent==FTS5_CONTENT_NORMAL || pC->abUnindexed[i-1] ){ + zBind = sqlite3Fts5Mprintf(&rc, "%z%s?%d", zBind, zBind?",":"",i+1); } - zBind[i*2-1] = '\0'; - zSql = sqlite3_mprintf(azStmt[eStmt], pC->zDb, pC->zName, zBind); - sqlite3_free(zBind); } + + zSql = sqlite3Fts5Mprintf(&rc, azStmt[eStmt], pC->zDb, pC->zName,zBind); + sqlite3_free(zBind); break; } @@ -342,7 +344,9 @@ int sqlite3Fts5StorageOpen( p->pIndex = pIndex; if( bCreate ){ - if( pConfig->eContent==FTS5_CONTENT_NORMAL ){ + if( pConfig->eContent==FTS5_CONTENT_NORMAL + || pConfig->eContent==FTS5_CONTENT_UNINDEXED + ){ int nDefn = 32 + pConfig->nCol*10; char *zDefn = sqlite3_malloc64(32 + (sqlite3_int64)pConfig->nCol * 10); if( zDefn==0 ){ @@ -353,8 +357,12 @@ int sqlite3Fts5StorageOpen( sqlite3_snprintf(nDefn, zDefn, "id INTEGER PRIMARY KEY"); iOff = (int)strlen(zDefn); for(i=0; inCol; i++){ - sqlite3_snprintf(nDefn-iOff, &zDefn[iOff], ", c%d", i); - iOff += (int)strlen(&zDefn[iOff]); + if( pConfig->eContent==FTS5_CONTENT_NORMAL + || pConfig->abUnindexed[i] + ){ + sqlite3_snprintf(nDefn-iOff, &zDefn[iOff], ", c%d", i); + iOff += (int)strlen(&zDefn[iOff]); + } } rc = sqlite3Fts5CreateTable(pConfig, "content", zDefn, 0, pzErr); } @@ -574,7 +582,9 @@ static int fts5StorageContentlessDelete(Fts5Storage *p, i64 iDel){ int rc = SQLITE_OK; assert( p->pConfig->bContentlessDelete ); - assert( p->pConfig->eContent==FTS5_CONTENT_NONE ); + assert( p->pConfig->eContent==FTS5_CONTENT_NONE + || p->pConfig->eContent==FTS5_CONTENT_UNINDEXED + ); /* Look up the origin of the document in the %_docsize table. Store ** this in stack variable iOrigin. */ @@ -714,7 +724,9 @@ int sqlite3Fts5StorageDelete( } /* Delete the %_content record */ - if( pConfig->eContent==FTS5_CONTENT_NORMAL ){ + if( pConfig->eContent==FTS5_CONTENT_NORMAL + || pConfig->eContent==FTS5_CONTENT_UNINDEXED + ){ if( rc==SQLITE_OK ){ rc = fts5StorageGetStmt(p, FTS5_STMT_DELETE_CONTENT, &pDel, 0); } @@ -746,8 +758,13 @@ int sqlite3Fts5StorageDeleteAll(Fts5Storage *p){ ); if( rc==SQLITE_OK && pConfig->bColumnsize ){ rc = fts5ExecPrintf(pConfig->db, 0, - "DELETE FROM %Q.'%q_docsize';", - pConfig->zDb, pConfig->zName + "DELETE FROM %Q.'%q_docsize';", pConfig->zDb, pConfig->zName + ); + } + + if( rc==SQLITE_OK && pConfig->eContent==FTS5_CONTENT_UNINDEXED ){ + rc = fts5ExecPrintf(pConfig->db, 0, + "DELETE FROM %Q.'%q_content';", pConfig->zDb, pConfig->zName ); } @@ -875,7 +892,9 @@ int sqlite3Fts5StorageContentInsert( int rc = SQLITE_OK; /* Insert the new row into the %_content table. */ - if( pConfig->eContent!=FTS5_CONTENT_NORMAL ){ + if( pConfig->eContent!=FTS5_CONTENT_NORMAL + && pConfig->eContent!=FTS5_CONTENT_UNINDEXED + ){ if( sqlite3_value_type(apVal[1])==SQLITE_INTEGER ){ *piRowid = sqlite3_value_int64(apVal[1]); }else{ @@ -886,31 +905,36 @@ int sqlite3Fts5StorageContentInsert( int i; /* Counter variable */ rc = fts5StorageGetStmt(p, FTS5_STMT_INSERT_CONTENT, &pInsert, 0); for(i=1; rc==SQLITE_OK && i<=pConfig->nCol+1; i++){ - sqlite3_value *pVal = apVal[i]; - if( sqlite3_value_nochange(pVal) && p->pSavedRow ){ - /* This is an UPDATE statement, and column (i-2) was not modified. - ** Retrieve the value from Fts5Storage.pSavedRow instead. */ - pVal = sqlite3_column_value(p->pSavedRow, i-1); - }else if( sqlite3_value_subtype(pVal)==FTS5_LOCALE_SUBTYPE ){ - assert( pConfig->bLocale ); - assert( i>1 ); - if( pConfig->abUnindexed[i-2] ){ - /* At attempt to insert an fts5_locale() value into an UNINDEXED - ** column. Strip the locale away and just bind the text. */ - const char *pText = 0; - int nText = 0; - rc = sqlite3Fts5ExtractText(pConfig, pVal, 0, 0, &pText, &nText); - sqlite3_bind_text(pInsert, i, pText, nText, SQLITE_TRANSIENT); - }else{ - const u8 *pBlob = (const u8*)sqlite3_value_blob(pVal); - int nBlob = sqlite3_value_bytes(pVal); - assert( nBlob>4 ); - sqlite3_bind_blob(pInsert, i, pBlob+4, nBlob-4, SQLITE_TRANSIENT); + if( i==1 + || pConfig->eContent==FTS5_CONTENT_NORMAL + || pConfig->abUnindexed[i-2] + ){ + sqlite3_value *pVal = apVal[i]; + if( sqlite3_value_nochange(pVal) && p->pSavedRow ){ + /* This is an UPDATE statement, and column (i-2) was not modified. + ** Retrieve the value from Fts5Storage.pSavedRow instead. */ + pVal = sqlite3_column_value(p->pSavedRow, i-1); + }else if( sqlite3_value_subtype(pVal)==FTS5_LOCALE_SUBTYPE ){ + assert( pConfig->bLocale ); + assert( i>1 ); + if( pConfig->abUnindexed[i-2] ){ + /* At attempt to insert an fts5_locale() value into an UNINDEXED + ** column. Strip the locale away and just bind the text. */ + const char *pText = 0; + int nText = 0; + rc = sqlite3Fts5ExtractText(pConfig, pVal, 0, 0, &pText, &nText); + sqlite3_bind_text(pInsert, i, pText, nText, SQLITE_TRANSIENT); + }else{ + const u8 *pBlob = (const u8*)sqlite3_value_blob(pVal); + int nBlob = sqlite3_value_bytes(pVal); + assert( nBlob>4 ); + sqlite3_bind_blob(pInsert, i, pBlob+4, nBlob-4, SQLITE_TRANSIENT); + } + continue; } - continue; + + rc = sqlite3_bind_value(pInsert, i, pVal); } - - rc = sqlite3_bind_value(pInsert, i, pVal); } if( rc==SQLITE_OK ){ sqlite3_step(pInsert); diff --git a/ext/fts5/test/fts5unindexed2.test b/ext/fts5/test/fts5unindexed2.test new file mode 100644 index 0000000000..3f71fa7a93 --- /dev/null +++ b/ext/fts5/test/fts5unindexed2.test @@ -0,0 +1,176 @@ +# 2015 Apr 24 +# +# The author disclaims copyright to this source code. In place of +# a legal notice, here is a blessing: +# +# May you do good and not evil. +# May you find forgiveness for yourself and forgive others. +# May you share freely, never taking more than you give. +# +#*********************************************************************** +# +# The tests in this file focus on "unindexed" columns in contentless +# tables. +# + +source [file join [file dirname [info script]] fts5_common.tcl] +set testprefix fts5unindexed2 + +# If SQLITE_ENABLE_FTS5 is not defined, omit this file. +ifcapable !fts5 { + finish_test + return +} + + +do_execsql_test 1.1 { + CREATE VIRTUAL TABLE t1 USING fts5(a, b UNINDEXED, content=); +} {} + +do_execsql_test 1.2 { + INSERT INTO t1 VALUES('abc def', 'ghi jkl'); +} + +do_execsql_test 1.3 { + SELECT rowid, a, b FROM t1 +} {1 {} {ghi jkl}} + +do_execsql_test 1.4 { + INSERT INTO t1(rowid, a, b) VALUES(11, 'hello world', 'one two three'); +} + +do_execsql_test 1.5 { + INSERT INTO t1(t1, rowid, a, b) VALUES('delete', 1, 'abc def', 'ghi jkl'); +} + +do_execsql_test 1.6 { + SELECT rowid, a, b FROM t1 +} { + 11 {} {one two three} +} + +do_execsql_test 1.7 { + PRAGMA integrity_check +} {ok} + +do_execsql_test 1.8 { + INSERT INTO t1(rowid, a, b) VALUES(12, 'abc def', 'ghi jkl'); +} + +do_execsql_test 1.9 { + SELECT rowid, a, b FROM t1('def') +} {12 {} {ghi jkl}} + +do_execsql_test 1.10 { + SELECT rowid, a, b FROM t1('def OR hello') ORDER BY rank +} {11 {} {one two three} 12 {} {ghi jkl}} + +do_execsql_test 1.11 { + SELECT rowid, a, b FROM t1 WHERE rowid=11 +} {11 {} {one two three}} + +do_execsql_test 1.12 { + SELECT rowid, a, b FROM t1 +} {11 {} {one two three} 12 {} {ghi jkl}} + + +fts5_aux_test_functions db +do_execsql_test 1.12.2 { + SELECT rowid, fts5_test_columntext(t1) FROM t1('def OR hello') +} {11 {{} {one two three}} 12 {{} {ghi jkl}}} + +do_execsql_test 1.13 { + INSERT INTO t1(t1) VALUES('delete-all'); +} + +do_execsql_test 1.14 { + SELECT rowid, a, b FROM t1 +} + +do_execsql_test 1.15 { + PRAGMA integrity_check +} {ok} + +do_execsql_test 2.0 { + CREATE VIRTUAL TABLE t4 USING fts5( + x, y UNINDEXED, z, columnsize=0, content='' + ); +} + +do_execsql_test 2.1 { + INSERT INTO t4(rowid, x, y, z) VALUES(1, 'a a', 'b b b', 'c'); +} + +#------------------------------------------------------------------------- +reset_db + +do_execsql_test 3.0 { + CREATE VIRTUAL TABLE x1 USING fts5( + a UNINDEXED, b, c UNINDEXED, d, content=, contentless_delete=1 + ); +} + +do_execsql_test 3.1 { + INSERT INTO x1(rowid, a, b, c, d) VALUES(131, 'aaa', 'bbb', 'ccc', 'ddd'); +} + +do_execsql_test 3.2 { + SELECT * FROM x1 +} {aaa {} ccc {}} + +do_execsql_test 3.3 { + INSERT INTO x1(rowid, a, b, c, d) VALUES(1000, 'AAA', 'BBB', 'CCC', 'DDD'); +} + +do_execsql_test 3.4 { + SELECT rowid, * FROM x1 +} { + 131 aaa {} ccc {} + 1000 AAA {} CCC {} +} + +do_execsql_test 3.5 { + DELETE FROM x1 WHERE rowid=131; + SELECT rowid, * FROM x1 +} { + 1000 AAA {} CCC {} +} + +do_execsql_test 3.6 { + INSERT INTO x1(rowid, a, b, c, d) VALUES(112, 'aaa', 'bbb', 'ccc', 'ddd'); + SELECT rowid, * FROM x1 +} { + 112 aaa {} ccc {} + 1000 AAA {} CCC {} +} + +do_execsql_test 3.7 { + UPDATE x1 SET b='hello', d='world', rowid=1120 WHERE rowid=112 +} + +do_execsql_test 3.8 { + SELECT rowid, * FROM x1 +} { + 1000 AAA {} CCC {} + 1120 aaa {} ccc {} +} + +do_execsql_test 3.9 { + SELECT rowid, * FROM x1('hello'); +} { + 1120 aaa {} ccc {} +} + +do_execsql_test 3.9 { + SELECT rowid, * FROM x1('bbb'); +} { + 1000 AAA {} CCC {} +} + +fts5_aux_test_functions db +do_execsql_test 3.10 { + SELECT rowid, fts5_test_columntext(x1) FROM x1('b*') +} {1000 {AAA {} CCC {}}} + +finish_test + diff --git a/manifest b/manifest index bec335f8c6..1e012e151a 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C In\stestrunner.tcl,\sallow\ssetting\snjob\sto\szero,\swhich\scauses\sno\snew\sjobs\nto\sbe\slaunched\sand\sfor\sthe\sprocess\sto\sshut\sdown\sonce\sall\scurrent\sjobs\sare\ncompleted. -D 2024-09-03T10:53:32.903 +C Store\sthe\svalues\sof\sany\sUNINDEXED\scolumns\sof\sa\scontentless\sfts5\stable\spersistently\sin\sthe\sdatabase.\sWarning:\sThis\scurrently\screates\sa\s(technically)\sincompatible\sfile-format\sfor\scontentless\sfts5\stables\sthat\shave\sUNINDEXED\scolumns. +D 2024-09-03T18:55:38.957 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 @@ -93,15 +93,15 @@ F ext/fts3/unicode/mkunicode.tcl 63db9624ccf70d4887836c320eda93ab552f21008f3be7e F ext/fts3/unicode/parseunicode.tcl a981bd6466d12dd17967515801c3ff23f74a281be1a03cf1e6f52a6959fc77eb F ext/fts5/extract_api_docs.tcl 009cf59c77afa86d137b0cca3e3b1a5efbe2264faa2df233f9a7aa8563926d15 F ext/fts5/fts5.h efaaac0df3d3bc740383044c144b582f47921aafa21d7b10eb98f42c24c740b0 -F ext/fts5/fts5Int.h 26a71a09cefa4ef6b4516b204ed48da3e1380970a19b3482eea7c5d805655360 +F ext/fts5/fts5Int.h d0c9bee4edfff9f0899648a9efc0afdebabbadb24403e2e50a1bb17aed6267d0 F ext/fts5/fts5_aux.c 65a0468dd177d6093aa9ae1622e6d86b0136b8d267c62c0ad6493ad1e9a3d759 F ext/fts5/fts5_buffer.c 0eec58bff585f1a44ea9147eae5da2447292080ea435957f7488c70673cb6f09 -F ext/fts5/fts5_config.c 353d2a0d12678cae6ab5b9ce54aed8dac0825667b69248b5a4ed81cbefc109ea +F ext/fts5/fts5_config.c 8dba11620a7964e1e561aaae3d27fdd2d16b2769c979f157dd55a53903a9b734 F ext/fts5/fts5_expr.c 9a56f53700d1860f0ee2f373c2b9074eaf2a7aa0637d0e27a6476de26a3fee33 F ext/fts5/fts5_hash.c adda4272be401566a6e0ba1acbe70ee5cb97fce944bc2e04dc707152a0ec91b1 F ext/fts5/fts5_index.c 571483823193f09439356741669aa8c81da838ae6f5e1bfa7517f7ee2fb3addd -F ext/fts5/fts5_main.c 1fddb53f495425d9314c74b30c5848a9dd254be0e5f445bfe38292d5ab21c288 -F ext/fts5/fts5_storage.c 9a9b880be12901f1962ae2a5a7e1b74348b3099a1e728764e419f75d98e3e612 +F ext/fts5/fts5_main.c 402a65b6d922203a90e7d440f29d71f19f6863e6b663ca9f06c7321f291bda40 +F ext/fts5/fts5_storage.c ca3bdb799b9b039133e9b6e4881fc974ba34ae4ea57530210289f82313b409b5 F ext/fts5/fts5_tcl.c 4db9258a7882c5eac0da4433042132aaf15b87dd1e1636c7a6ca203abd2c8bfe F ext/fts5/fts5_test_mi.c 08c11ec968148d4cb4119d96d819f8c1f329812c568bac3684f5464be177d3ee F ext/fts5/fts5_test_tok.c 3cb0a9b508b30d17ef025ccddd26ae3dc8ddffbe76c057616e59a9aa85d36f3b @@ -246,6 +246,7 @@ F ext/fts5/test/fts5unicode2.test 3bbd30152f9f760bf13886e5b1e5ec23ff62f56758ddda F ext/fts5/test/fts5unicode3.test f4891a3dac3b49c3d7c0fdb29566e9eb0ecff35263370c89f9661b1952b20818 F ext/fts5/test/fts5unicode4.test 728c8f0caafb05567f524ad313d9f8b780fa45987b8a8df04eff87923c74b4d0 F ext/fts5/test/fts5unindexed.test 168838d2c385e131120bbf5b516d2432a5fabc4caa2259c932e1d49ae209a4ae +F ext/fts5/test/fts5unindexed2.test f8453dcf1df11544263d350d388d5c612be4b379079b308f1ad74cdaa940804e F ext/fts5/test/fts5update.test b8affd796e45c94a4d19ad5c26606ea06065a0f162a9562d9f005b5a80ccf0bc F ext/fts5/test/fts5version.test c22d163c17e60a99f022cbc52de5a48bb7f84deaa00fe15e9bc4c3aa1996204e F ext/fts5/test/fts5vocab.test 2a2bdb60d0998fa3124d541b6d30b019504918dc43a6584645b63a24be72f992 @@ -2212,8 +2213,11 @@ F vsixtest/vsixtest.tcl 6195aba1f12a5e10efc2b8c0009532167be5e301abe5b31385638080 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P 7891a266c4425722ae8b9231397ef9e42e2432be9e6b70632dfaf9ff15300d2c -R 6a86d12ea82ce01298969ad043e5cc65 -U drh -Z 5112afd2e4dab18f4b12bbba01825cee +P 0ef65fd4ba17def4c13986365b3af300c4024725af4bc314845d1af8be568ab4 +R 87dfb79be977919afc56ac91ca0cf0b0 +T *branch * fts5-contentless-unindexed +T *sym-fts5-contentless-unindexed * +T -sym-trunk * +U dan +Z f39a0e93422c865c24dfd629a9a47017 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 9843b7b310..b545e371ff 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -0ef65fd4ba17def4c13986365b3af300c4024725af4bc314845d1af8be568ab4 +dcacb1a8ef359b4507b4733356d3150ba5dc105cc9867c103d16a0908a1a9f64 From 0218424e5aefeac54f98305d972eabadafd40d84 Mon Sep 17 00:00:00 2001 From: dan Date: Fri, 13 Sep 2024 16:30:18 +0000 Subject: [PATCH 02/34] Require that the contentless_unindexed=1 option be specified before storing the values of fts5 UNINDEXED column belonging to contentless tables. FossilOrigin-Name: c51dc2a5e75baacbd905cf314e7b1a58a81993ff05ca656739e028d7db25d5b2 --- ext/fts5/fts5Int.h | 1 + ext/fts5/fts5_config.c | 26 +++++++++++++++++++++- ext/fts5/test/fts5unindexed2.test | 37 +++++++++++++++++++++++++++---- manifest | 18 +++++++-------- manifest.uuid | 2 +- 5 files changed, 69 insertions(+), 15 deletions(-) diff --git a/ext/fts5/fts5Int.h b/ext/fts5/fts5Int.h index 310d4f4390..f189edf312 100644 --- a/ext/fts5/fts5Int.h +++ b/ext/fts5/fts5Int.h @@ -224,6 +224,7 @@ struct Fts5Config { int *aPrefix; /* Sizes in bytes of nPrefix prefix indexes */ int eContent; /* An FTS5_CONTENT value */ int bContentlessDelete; /* "contentless_delete=" option (dflt==0) */ + int bContentlessUnindexed; /* "contentless_unindexed=" option (dflt=0) */ char *zContent; /* content table */ char *zContentRowid; /* "content_rowid=" option value */ int bColumnsize; /* "columnsize=" option value (dflt==1) */ diff --git a/ext/fts5/fts5_config.c b/ext/fts5/fts5_config.c index 93ef333285..a674b44d0b 100644 --- a/ext/fts5/fts5_config.c +++ b/ext/fts5/fts5_config.c @@ -241,6 +241,7 @@ static int fts5ConfigParseSpecial( ){ int rc = SQLITE_OK; int nCmd = (int)strlen(zCmd); + if( sqlite3_strnicmp("prefix", zCmd, nCmd)==0 ){ const int nByte = sizeof(int) * FTS5_MAX_PREFIX_INDEXES; const char *p; @@ -360,6 +361,16 @@ static int fts5ConfigParseSpecial( return rc; } + if( sqlite3_strnicmp("contentless_unindexed", zCmd, nCmd)==0 ){ + if( (zArg[0]!='0' && zArg[0]!='1') || zArg[1]!='\0' ){ + *pzErr = sqlite3_mprintf("malformed contentless_delete=... directive"); + rc = SQLITE_ERROR; + }else{ + pConfig->bContentlessUnindexed = (zArg[0]=='1'); + } + return rc; + } + if( sqlite3_strnicmp("content_rowid", zCmd, nCmd)==0 ){ if( pConfig->zContentRowid ){ *pzErr = sqlite3_mprintf("multiple content_rowid=... directives"); @@ -655,6 +666,19 @@ int sqlite3Fts5ConfigParse( rc = SQLITE_ERROR; } + /* We only allow contentless_unindexed=1 if the table is actually a + ** contentless one. + */ + if( rc==SQLITE_OK + && pRet->bContentlessUnindexed + && pRet->eContent!=FTS5_CONTENT_NONE + ){ + *pzErr = sqlite3_mprintf( + "contentless_unindexed=1 requires a contentless table" + ); + rc = SQLITE_ERROR; + } + /* If no zContent option was specified, fill in the default values. */ if( rc==SQLITE_OK && pRet->zContent==0 ){ const char *zTail = 0; @@ -663,7 +687,7 @@ int sqlite3Fts5ConfigParse( ); if( pRet->eContent==FTS5_CONTENT_NORMAL ){ zTail = "content"; - }else if( bUnindexed ){ + }else if( bUnindexed && pRet->bContentlessUnindexed ){ pRet->eContent = FTS5_CONTENT_UNINDEXED; zTail = "content"; }else if( pRet->bColumnsize ){ diff --git a/ext/fts5/test/fts5unindexed2.test b/ext/fts5/test/fts5unindexed2.test index 3f71fa7a93..cc4ddd28d1 100644 --- a/ext/fts5/test/fts5unindexed2.test +++ b/ext/fts5/test/fts5unindexed2.test @@ -1,4 +1,4 @@ -# 2015 Apr 24 +# 2024 Sep 13 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: @@ -24,7 +24,9 @@ ifcapable !fts5 { do_execsql_test 1.1 { - CREATE VIRTUAL TABLE t1 USING fts5(a, b UNINDEXED, content=); + CREATE VIRTUAL TABLE t1 USING fts5( + a, b UNINDEXED, content=, contentless_unindexed=1 + ); } {} do_execsql_test 1.2 { @@ -93,7 +95,7 @@ do_execsql_test 1.15 { do_execsql_test 2.0 { CREATE VIRTUAL TABLE t4 USING fts5( - x, y UNINDEXED, z, columnsize=0, content='' + x, y UNINDEXED, z, columnsize=0, content='', contentless_unindexed=1 ); } @@ -106,7 +108,8 @@ reset_db do_execsql_test 3.0 { CREATE VIRTUAL TABLE x1 USING fts5( - a UNINDEXED, b, c UNINDEXED, d, content=, contentless_delete=1 + a UNINDEXED, b, c UNINDEXED, d, content=, contentless_delete=1, + contentless_unindexed=1 ); } @@ -172,5 +175,31 @@ do_execsql_test 3.10 { SELECT rowid, fts5_test_columntext(x1) FROM x1('b*') } {1000 {AAA {} CCC {}}} +#------------------------------------------------------------------------- +# Check that if contentless_unindexed=1 is not specified, the values +# of UNINDEXED columns are not stored in the database. +# +# Also check that contentless_unindexed=1 is not allowed unless the table +# is actually contentless. +# +reset_db +do_execsql_test 4.0 { + CREATE VIRTUAL TABLE ft USING fts5(a, b, c UNINDEXED, content=''); + INSERT INTO ft VALUES('one', 'two', 'three'); + SELECT rowid, * FROM ft; +} {1 {} {} {}} + +do_execsql_test 4.1 { + SELECT name FROM sqlite_schema ORDER BY 1 +} { + ft ft_config ft_data ft_docsize ft_idx +} + +do_catchsql_test 4.2 { + CREATE VIRTUAL TABLE ft2 USING fts5( + a, b, c UNINDEXED, contentless_unindexed=1 + ); +} {1 {contentless_unindexed=1 requires a contentless table}} + finish_test diff --git a/manifest b/manifest index 5812d09993..251e6f0bd6 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Merge\slatest\strunk\schanges,\sincluding\sthe\schanges\sto\sthe\sfts5\slocale=1\sfeature,\sinto\sthis\sbranch. -D 2024-09-13T15:37:31.588 +C Require\sthat\sthe\scontentless_unindexed=1\soption\sbe\sspecified\sbefore\sstoring\sthe\svalues\sof\sfts5\sUNINDEXED\scolumn\sbelonging\sto\scontentless\stables. +D 2024-09-13T16:30:18.635 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 @@ -93,10 +93,10 @@ F ext/fts3/unicode/mkunicode.tcl 63db9624ccf70d4887836c320eda93ab552f21008f3be7e F ext/fts3/unicode/parseunicode.tcl a981bd6466d12dd17967515801c3ff23f74a281be1a03cf1e6f52a6959fc77eb F ext/fts5/extract_api_docs.tcl 009cf59c77afa86d137b0cca3e3b1a5efbe2264faa2df233f9a7aa8563926d15 F ext/fts5/fts5.h efaaac0df3d3bc740383044c144b582f47921aafa21d7b10eb98f42c24c740b0 -F ext/fts5/fts5Int.h 6ec0c8a49412e2d7433ebc416cc5a5fd8583dbda30ba46c8835027a4e5c9b41a +F ext/fts5/fts5Int.h 927772e795bc897a210630296531c6a397b247f0b6f65ef9e9dc8e03baa77d1d F ext/fts5/fts5_aux.c 65a0468dd177d6093aa9ae1622e6d86b0136b8d267c62c0ad6493ad1e9a3d759 F ext/fts5/fts5_buffer.c 0eec58bff585f1a44ea9147eae5da2447292080ea435957f7488c70673cb6f09 -F ext/fts5/fts5_config.c 700d7accca99d931390c4fcb7c71b92bbcff9093aa9c2d566d7f16a3c9550a59 +F ext/fts5/fts5_config.c a6633d88596758941c625b526075b85d3d9fd1089d8d9eab5db6e8a71fd347ad F ext/fts5/fts5_expr.c 9a56f53700d1860f0ee2f373c2b9074eaf2a7aa0637d0e27a6476de26a3fee33 F ext/fts5/fts5_hash.c adda4272be401566a6e0ba1acbe70ee5cb97fce944bc2e04dc707152a0ec91b1 F ext/fts5/fts5_index.c 571483823193f09439356741669aa8c81da838ae6f5e1bfa7517f7ee2fb3addd @@ -246,7 +246,7 @@ F ext/fts5/test/fts5unicode2.test 3bbd30152f9f760bf13886e5b1e5ec23ff62f56758ddda F ext/fts5/test/fts5unicode3.test f4891a3dac3b49c3d7c0fdb29566e9eb0ecff35263370c89f9661b1952b20818 F ext/fts5/test/fts5unicode4.test 728c8f0caafb05567f524ad313d9f8b780fa45987b8a8df04eff87923c74b4d0 F ext/fts5/test/fts5unindexed.test 168838d2c385e131120bbf5b516d2432a5fabc4caa2259c932e1d49ae209a4ae -F ext/fts5/test/fts5unindexed2.test f8453dcf1df11544263d350d388d5c612be4b379079b308f1ad74cdaa940804e +F ext/fts5/test/fts5unindexed2.test ec091c92a74d9dd8fa968c6de743982a39ab48b3f1d78e85a45865a615a982ce F ext/fts5/test/fts5update.test b8affd796e45c94a4d19ad5c26606ea06065a0f162a9562d9f005b5a80ccf0bc F ext/fts5/test/fts5version.test c22d163c17e60a99f022cbc52de5a48bb7f84deaa00fe15e9bc4c3aa1996204e F ext/fts5/test/fts5vocab.test 2a2bdb60d0998fa3124d541b6d30b019504918dc43a6584645b63a24be72f992 @@ -436,7 +436,7 @@ F ext/misc/urifuncs.c f71360d14fa9e7626b563f1f781c6148109462741c5235ac63ae0f8917 F ext/misc/uuid.c 5bb2264c1b64d163efa46509544fd7500cb8769cb7c16dd52052da8d961505cf F ext/misc/vfslog.c 3932ab932eeb2601dbc4447cb14d445aaa9fbe43b863ef5f014401c3420afd20 F ext/misc/vfsstat.c a85df08654743922a19410d7b1e3111de41bb7cd07d20dd16eda4e2b808d269d -F ext/misc/vfstrace.c 03f90dd465968e01f5d1d3e79c36cbc53a5bfe1bd55d239435ce94df19d5b0ac w src/test_vfstrace.c +F ext/misc/vfstrace.c 03f90dd465968e01f5d1d3e79c36cbc53a5bfe1bd55d239435ce94df19d5b0ac F ext/misc/vtablog.c 1100250ce8782db37c833e3a9a5c9a3ecf1af5e15b8325572b82e6e0a138ffb5 F ext/misc/vtshim.c 1976e6dd68dd0d64508c91a6dfab8e75f8aaf6cd F ext/misc/wholenumber.c 0fa0c082676b7868bf2fa918e911133f2b349bcdceabd1198bba5f65b4fc0668 @@ -2213,8 +2213,8 @@ F vsixtest/vsixtest.tcl 6195aba1f12a5e10efc2b8c0009532167be5e301abe5b31385638080 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P dcacb1a8ef359b4507b4733356d3150ba5dc105cc9867c103d16a0908a1a9f64 4cad385b90eaca2d90e3375e473472145af4134160b81097a8535d06638c2e4a -R 6b427d068701369235fcf90674c4aaf6 +P d2f0d19936222911bc317efecc831007d3aba81f9b32877030ffb29d1728bbdc +R e6e3b6faf33ff387284e052d2e40ed37 U dan -Z a31c0a78609956d9ed51a360c49325fd +Z 7aa60982204ecdadda49bd214e78d921 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index e5ba7a6786..59b7cd9252 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -d2f0d19936222911bc317efecc831007d3aba81f9b32877030ffb29d1728bbdc +c51dc2a5e75baacbd905cf314e7b1a58a81993ff05ca656739e028d7db25d5b2 From 777c35dbe8d8081a29d1f4283f901a4ac6c777b8 Mon Sep 17 00:00:00 2001 From: dan Date: Wed, 25 Sep 2024 12:03:08 +0000 Subject: [PATCH 03/34] Prevent regular DELETE and UPDATE statements from running against contentless_unindexed=1 tables that are not also contentless_delete=1. FossilOrigin-Name: 21539e9d0d57fdc762affbce9220d1bb1ca009d9dc751b4ccfe63eecbbe2f575 --- ext/fts5/fts5_main.c | 32 ++++++++++-------- ext/fts5/test/fts5unindexed2.test | 54 +++++++++++++++++++++++++++++++ manifest | 14 ++++---- manifest.uuid | 2 +- 4 files changed, 81 insertions(+), 21 deletions(-) diff --git a/ext/fts5/fts5_main.c b/ext/fts5/fts5_main.c index f2749ffff1..781a8a8719 100644 --- a/ext/fts5/fts5_main.c +++ b/ext/fts5/fts5_main.c @@ -332,10 +332,16 @@ static void fts5CheckTransactionState(Fts5FullTable *p, int op, int iSavepoint){ #endif /* -** Return true if pTab is a contentless table. +** Return true if pTab is a contentless table. If parameter bIncludeUnindexed +** is true, this includes contentless tables that store UNINDEXED columns +** only. */ -static int fts5IsContentless(Fts5FullTable *pTab){ - return pTab->p.pConfig->eContent==FTS5_CONTENT_NONE; +static int fts5IsContentless(Fts5FullTable *pTab, int bIncludeUnindexed){ + int eContent = pTab->p.pConfig->eContent; + return ( + eContent==FTS5_CONTENT_NONE + || (bIncludeUnindexed && eContent==FTS5_CONTENT_UNINDEXED) + ); } /* @@ -1726,9 +1732,7 @@ static int fts5SpecialInsert( } bLoadConfig = 1; }else if( 0==sqlite3_stricmp("rebuild", zCmd) ){ - if( pConfig->eContent==FTS5_CONTENT_NONE - || pConfig->eContent==FTS5_CONTENT_UNINDEXED - ){ + if( fts5IsContentless(pTab, 1) ){ fts5SetVtabError(pTab, "'rebuild' may not be used with a contentless fts5 table" ); @@ -1895,7 +1899,7 @@ static int fts5UpdateMethod( ** This is not suported. Except - they are both supported if the CREATE ** VIRTUAL TABLE statement contained "contentless_delete=1". */ if( eType0==SQLITE_INTEGER - && pConfig->eContent==FTS5_CONTENT_NONE + && fts5IsContentless(pTab, 1) && pConfig->bContentlessDelete==0 ){ pTab->p.base.zErrMsg = sqlite3_mprintf( @@ -2172,7 +2176,7 @@ static int fts5ApiColumnText( assert( pCsr->ePlan!=FTS5_PLAN_SPECIAL ); if( iCol<0 || iCol>=pTab->pConfig->nCol ){ rc = SQLITE_RANGE; - }else if( fts5IsContentless((Fts5FullTable*)(pCsr->base.pVtab)) ){ + }else if( fts5IsContentless((Fts5FullTable*)(pCsr->base.pVtab), 0) ){ *pz = 0; *pn = 0; }else{ @@ -2205,7 +2209,7 @@ static int fts5CsrPoslist( if( iPhrase<0 || iPhrase>=sqlite3Fts5ExprPhraseCount(pCsr->pExpr) ){ rc = SQLITE_RANGE; }else if( pConfig->eDetail!=FTS5_DETAIL_FULL - && pConfig->eContent==FTS5_CONTENT_NONE + && fts5IsContentless((Fts5FullTable*)pCsr->base.pVtab, 1) ){ *pa = 0; *pn = 0; @@ -2689,7 +2693,7 @@ static int fts5ApiColumnLocale( rc = SQLITE_RANGE; }else if( pConfig->abUnindexed[iCol]==0 - && pConfig->eContent!=FTS5_CONTENT_NONE + && 0==fts5IsContentless((Fts5FullTable*)pCsr->base.pVtab, 1) && pConfig->bLocale ){ rc = fts5SeekCursor(pCsr, 0); @@ -2967,13 +2971,15 @@ static int fts5ColumnMethod( /* A column created by the user containing values. */ int bNochange = sqlite3_vtab_nochange(pCtx); - if( fts5IsContentless(pTab) ){ - if( bNochange && pConfig->bContentlessDelete ){ + if( bNochange ){ + if( pConfig->bContentlessDelete + && (pConfig->eContent==FTS5_CONTENT_NONE || !pConfig->abUnindexed[iCol]) + ){ fts5ResultError(pCtx, "cannot UPDATE a subset of " "columns on fts5 contentless-delete table: %s", pConfig->zName ); } - }else if( bNochange==0 || pConfig->eContent!=FTS5_CONTENT_NORMAL ){ + }else if( pConfig->eContent!=FTS5_CONTENT_NONE ){ pConfig->pzErrmsg = &pTab->p.base.zErrMsg; rc = fts5SeekCursor(pCsr, 1); if( rc==SQLITE_OK ){ diff --git a/ext/fts5/test/fts5unindexed2.test b/ext/fts5/test/fts5unindexed2.test index cc4ddd28d1..f2703ac374 100644 --- a/ext/fts5/test/fts5unindexed2.test +++ b/ext/fts5/test/fts5unindexed2.test @@ -201,5 +201,59 @@ do_catchsql_test 4.2 { ); } {1 {contentless_unindexed=1 requires a contentless table}} +do_catchsql_test 4.3 { + DELETE FROM ft WHERE rowid=1 +} {1 {cannot DELETE from contentless fts5 table: ft}} + +#------------------------------------------------------------------------- +# Check that the usual restrictions on contentless tables apply to +# contentless_unindexed=1 tables. +# +reset_db +do_execsql_test 5.0 { + CREATE VIRTUAL TABLE ft USING fts5( + a, b UNINDEXED, c, content='', contentless_unindexed=1 + ); + INSERT INTO ft VALUES('one', 'two', 'three'); + INSERT INTO ft VALUES('four', 'five', 'six'); + INSERT INTO ft VALUES('seven', 'eight', 'nine'); + SELECT rowid, * FROM ft; +} { + 1 {} two {} + 2 {} five {} + 3 {} eight {} +} + +do_execsql_test 5.1 { + PRAGMA integrity_check +} {ok} + +do_catchsql_test 5.2 { + DELETE FROM ft WHERE rowid=2 +} {1 {cannot DELETE from contentless fts5 table: ft}} + +do_execsql_test 5.3 { + SELECT rowid, * FROM ft('six') +} { + 2 {} five {} +} + +do_catchsql_test 5.4 { + UPDATE ft SET a='x', b='y', c='z' WHERE rowid=3 +} {1 {cannot UPDATE contentless fts5 table: ft}} + +fts5_aux_test_functions db + +do_execsql_test 5.5 { + SELECT fts5_test_columntext(ft) FROM ft WHERE rowid=3 +} { + {{} eight {}} +} +do_execsql_test 5.6 { + SELECT fts5_test_columntext(ft) FROM ft('three'); +} { + {{} two {}} +} + finish_test diff --git a/manifest b/manifest index 251e6f0bd6..c9871be60a 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Require\sthat\sthe\scontentless_unindexed=1\soption\sbe\sspecified\sbefore\sstoring\sthe\svalues\sof\sfts5\sUNINDEXED\scolumn\sbelonging\sto\scontentless\stables. -D 2024-09-13T16:30:18.635 +C Prevent\sregular\sDELETE\sand\sUPDATE\sstatements\sfrom\srunning\sagainst\scontentless_unindexed=1\stables\sthat\sare\snot\salso\scontentless_delete=1. +D 2024-09-25T12:03:08.340 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 @@ -100,7 +100,7 @@ F ext/fts5/fts5_config.c a6633d88596758941c625b526075b85d3d9fd1089d8d9eab5db6e8a F ext/fts5/fts5_expr.c 9a56f53700d1860f0ee2f373c2b9074eaf2a7aa0637d0e27a6476de26a3fee33 F ext/fts5/fts5_hash.c adda4272be401566a6e0ba1acbe70ee5cb97fce944bc2e04dc707152a0ec91b1 F ext/fts5/fts5_index.c 571483823193f09439356741669aa8c81da838ae6f5e1bfa7517f7ee2fb3addd -F ext/fts5/fts5_main.c be195e918c40c304f81d899f8a9b00d47ed266583dd931e22730e83b011ddadc +F ext/fts5/fts5_main.c 0d2013bd03285f4bbcea0f4594f2cd33b68337da709da79cd46379be189d11da F ext/fts5/fts5_storage.c 1fbaf212042bdb363d74a48d3293b2c453a46880e86656df3ee19ade63472681 F ext/fts5/fts5_tcl.c 4db9258a7882c5eac0da4433042132aaf15b87dd1e1636c7a6ca203abd2c8bfe F ext/fts5/fts5_test_mi.c 08c11ec968148d4cb4119d96d819f8c1f329812c568bac3684f5464be177d3ee @@ -246,7 +246,7 @@ F ext/fts5/test/fts5unicode2.test 3bbd30152f9f760bf13886e5b1e5ec23ff62f56758ddda F ext/fts5/test/fts5unicode3.test f4891a3dac3b49c3d7c0fdb29566e9eb0ecff35263370c89f9661b1952b20818 F ext/fts5/test/fts5unicode4.test 728c8f0caafb05567f524ad313d9f8b780fa45987b8a8df04eff87923c74b4d0 F ext/fts5/test/fts5unindexed.test 168838d2c385e131120bbf5b516d2432a5fabc4caa2259c932e1d49ae209a4ae -F ext/fts5/test/fts5unindexed2.test ec091c92a74d9dd8fa968c6de743982a39ab48b3f1d78e85a45865a615a982ce +F ext/fts5/test/fts5unindexed2.test 54a924b8acc6270350898e09d56c1b942b6e3cae789b9e5f31ec7b9a3dc7953e F ext/fts5/test/fts5update.test b8affd796e45c94a4d19ad5c26606ea06065a0f162a9562d9f005b5a80ccf0bc F ext/fts5/test/fts5version.test c22d163c17e60a99f022cbc52de5a48bb7f84deaa00fe15e9bc4c3aa1996204e F ext/fts5/test/fts5vocab.test 2a2bdb60d0998fa3124d541b6d30b019504918dc43a6584645b63a24be72f992 @@ -2213,8 +2213,8 @@ F vsixtest/vsixtest.tcl 6195aba1f12a5e10efc2b8c0009532167be5e301abe5b31385638080 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P d2f0d19936222911bc317efecc831007d3aba81f9b32877030ffb29d1728bbdc -R e6e3b6faf33ff387284e052d2e40ed37 +P c51dc2a5e75baacbd905cf314e7b1a58a81993ff05ca656739e028d7db25d5b2 +R 0573b4e17b15d974d21966942a753c69 U dan -Z 7aa60982204ecdadda49bd214e78d921 +Z 19e56c0d30986f9b0323b85fbd6aa264 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 59b7cd9252..957a7db2aa 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -c51dc2a5e75baacbd905cf314e7b1a58a81993ff05ca656739e028d7db25d5b2 +21539e9d0d57fdc762affbce9220d1bb1ca009d9dc751b4ccfe63eecbbe2f575 From d0720eee5e19d9d6889b275bdb652e5e0160899c Mon Sep 17 00:00:00 2001 From: dan Date: Thu, 26 Sep 2024 18:02:17 +0000 Subject: [PATCH 04/34] When possible, avoid taking wal file read-lock 0 in sqlite3_snapshot_get(). FossilOrigin-Name: 34b6ac3d76dbc6819778ec2a0f81cbcdcc0cd1a6303381d97f1c479e4ecdd132 --- manifest | 22 ++++++++++++---------- manifest.uuid | 2 +- src/main.c | 4 ++++ src/wal.c | 18 ++++++++++++++++-- test/snapshot3.test | 39 +++++++++++++++++++++++++++++++++++++++ 5 files changed, 72 insertions(+), 13 deletions(-) diff --git a/manifest b/manifest index e74bcacf3c..83d6936a7d 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C In\sthe\sCLI,\sfor\scolumnar\soutput\sformats,\stry\sto\saccount\sfor\sthe\spresence\sof\nzero-width\sand\sdouble-width\scharacters\sin\sthe\soutput\sand\sadjust\scolumn\swidths\naccordingly. -D 2024-09-25T09:39:11.501 +C When\spossible,\savoid\staking\swal\sfile\sread-lock\s0\sin\ssqlite3_snapshot_get(). +D 2024-09-26T18:02:17.495 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 @@ -730,7 +730,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 4db6e3bde55ba0b24ccc83600c2b6ea11429f61ce7b3a2e7e3b42e1b45366c3e +F src/main.c 3bb768eeeee1cceaed391327362b8be8b5ce61a12fe24d5b555ce9c6b4a883de F src/malloc.c 410e570b30c26cc36e3372577df50f7a96ee3eed5b2b161c6b6b48773c650c5e F src/mem0.c 6a55ebe57c46ca1a7d98da93aaa07f99f1059645 F src/mem1.c 3bb59158c38e05f6270e761a9f435bf19827a264c13d1631c58b84bdc96d73b2 @@ -849,7 +849,7 @@ F src/vdbetrace.c fe0bc29ebd4e02c8bc5c1945f1d2e6be5927ec12c06d89b03ef2a4def34bf8 F src/vdbevtab.c fc46b9cbd759dc013f0b3724549cc0d71379183c667df3a5988f7e2f1bd485f3 F src/vtab.c 316cd48e9320660db3047cd306cd056e4361180cebb4d0f10a39244e10c11422 F src/vxworks.h d2988f4e5a61a4dfe82c6524dd3d6e4f2ce3cdb9 -F src/wal.c ef68130ba330ee18c1cb22da36a881c82e3a3b109badbdc6a9b9acaf788a6688 +F src/wal.c a0d42bfdef935e1389737152394d08e59e7c48697f40a9fc2e0552cb19dc731f F src/wal.h ba252daaa94f889f4b2c17c027e823d9be47ce39da1d3799886bbd51f0490452 F src/walker.c d5006d6b005e4ea7302ad390957a8d41ed83faa177e412f89bc5600a7462a014 F src/where.c 461d41017d900d4248a268df96d2d30506c4dcc2257f4167c4f46072003ce2cf @@ -1647,7 +1647,7 @@ F test/skipscan5.test 0672103fd2c8f96bd114133f356192b35ece45c794fe3677e1d9e5e310 F test/skipscan6.test bddbb35dd335e2d21b7791a61e3b2e1f3255dc307ce80aa6fe19cc298e6feb13 F test/snapshot.test a504f2e7009f512ef66c719f0ea1c55a556bdaf1e1312c80a04d46fc1a3e9632 F test/snapshot2.test 8d6ff5dd9cc503f6e12d408a30409c3f9c653507b24408d9cd7195931c89bc54 -F test/snapshot3.test 8744313270c55f6e18574283553d3c5c5fe4c5970585663613a0e75c151e599b +F test/snapshot3.test 41350216abc6c7da37113ad462259c070786e5ad70bdc8709daaed148b1b3a2c F test/snapshot4.test d4e9347ef2fcabc491fc893506c7bbaf334da3be111d6eb4f3a97cc623b78322 F test/snapshot_fault.test 129234ceb9b26a0e1000e8563a16e790f5c1412354e70749cbd78c3d5d07d60a F test/snapshot_up.test 77dc7853bfb2b4fa249f76e1714cfa1e596826165d9ef22c06ac3a0b7b778d9a @@ -2213,9 +2213,11 @@ F vsixtest/vsixtest.tcl 6195aba1f12a5e10efc2b8c0009532167be5e301abe5b31385638080 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P 42bb941584a1ac922ee6b0b6ecadce71c9259555563cf49913a6f820f3f9b887 b217e3004b58af0e777726bdd652b999ad41815261299ef4ce8f8d2f6b0afe8d -R 5fcf6775e686fdd76943c66cce860cb0 -T +closed b217e3004b58af0e777726bdd652b999ad41815261299ef4ce8f8d2f6b0afe8d -U drh -Z af457fc67e3efab459ef7260d9a5da46 +P 9592b9ba3ad7a842cdd4c4010da278485a6fdec7e811bda01ebe640162a8c3b6 +R 8553e4183ac33940fe95918021cfe535 +T *branch * snapshot_get-locking +T *sym-snapshot_get-locking * +T -sym-trunk * +U dan +Z 2b5e37766517d26ed8f4d4495c7d929b # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 5d05a8c7ec..986575a33e 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -9592b9ba3ad7a842cdd4c4010da278485a6fdec7e811bda01ebe640162a8c3b6 +34b6ac3d76dbc6819778ec2a0f81cbcdcc0cd1a6303381d97f1c479e4ecdd132 diff --git a/src/main.c b/src/main.c index 6ab09c5560..fceb7957b9 100644 --- a/src/main.c +++ b/src/main.c @@ -4963,7 +4963,11 @@ int sqlite3_snapshot_get( if( iDb==0 || iDb>1 ){ Btree *pBt = db->aDb[iDb].pBt; if( SQLITE_TXN_WRITE!=sqlite3BtreeTxnState(pBt) ){ + Pager *pPager = sqlite3BtreePager(pBt); + i64 dummy = 0; + sqlite3PagerSnapshotOpen(pPager, (sqlite3_snapshot*)&dummy); rc = sqlite3BtreeBeginTrans(pBt, 0, 0); + sqlite3PagerSnapshotOpen(pPager, 0); if( rc==SQLITE_OK ){ rc = sqlite3PagerSnapshotGet(sqlite3BtreePager(pBt), ppSnapshot); } diff --git a/src/wal.c b/src/wal.c index 89106038b8..f4aa663fd3 100644 --- a/src/wal.c +++ b/src/wal.c @@ -541,6 +541,7 @@ struct Wal { #endif #ifdef SQLITE_ENABLE_SNAPSHOT WalIndexHdr *pSnapshot; /* Start transaction here if not NULL */ + int bGetSnapshot; /* Transaction opened for sqlite3_get_snapshot() */ #endif #ifdef SQLITE_ENABLE_SETLK_TIMEOUT sqlite3 *db; @@ -3097,7 +3098,7 @@ static int walTryBeginRead(Wal *pWal, int *pChanged, int useWal, int *pCnt){ SEH_INJECT_FAULT; if( !useWal && AtomicLoad(&pInfo->nBackfill)==pWal->hdr.mxFrame #ifdef SQLITE_ENABLE_SNAPSHOT - && (pWal->pSnapshot==0 || pWal->hdr.mxFrame==0) + && ((pWal->bGetSnapshot==0 && pWal->pSnapshot==0) || pWal->hdr.mxFrame==0) #endif ){ /* The WAL has been completely backfilled (or it is empty). @@ -4497,7 +4498,20 @@ void sqlite3WalSnapshotOpen( Wal *pWal, sqlite3_snapshot *pSnapshot ){ - pWal->pSnapshot = (WalIndexHdr*)pSnapshot; + if( pSnapshot && ((WalIndexHdr*)pSnapshot)->iVersion==0 ){ + /* iVersion==0 means that this is a call to sqlite3_snapshot_get(). In + ** this case set the bGetSnapshot flag so that if the call to + ** sqlite3_snapshot_get() is about to read transaction on this wal + ** file, it does not take read-lock 0 if the wal file has been completely + ** checkpointed. Taking read-lock 0 would work, but then it would be + ** possible for a subsequent writer to destroy the snapshot even while + ** this connection is holding its read-transaction open. This is contrary + ** to user expectations, so we avoid it by not taking read-lock 0. */ + pWal->bGetSnapshot = 1; + }else{ + pWal->pSnapshot = (WalIndexHdr*)pSnapshot; + pWal->bGetSnapshot = 0; + } } /* diff --git a/test/snapshot3.test b/test/snapshot3.test index 4dca202b1c..470d463a66 100644 --- a/test/snapshot3.test +++ b/test/snapshot3.test @@ -96,4 +96,43 @@ do_test 1.8 { list [catch { sqlite3_snapshot_open_blob db3 main $snap } msg] $msg } {1 SQLITE_ERROR_SNAPSHOT} +#------------------------------------------------------------------------- +reset_db +do_execsql_test 2.0 { + PRAGMA journal_mode = wal; + CREATE TABLE t1(a, b); + INSERT INTO t1 VALUES(1, 2); + INSERT INTO t1 VALUES(3, 4); +} {wal} + +sqlite3 db2 test.db +sqlite3 db3 test.db +do_execsql_test -db db2 2.0.1 { + SELECT * FROM t1 +} {1 2 3 4} +do_execsql_test -db db3 2.0.2 { + SELECT * FROM t1 +} {1 2 3 4} + +do_execsql_test -db db2 2.2 { + PRAGMA wal_checkpoint; +} {0 4 4} + +do_test 2.1 { + db eval { BEGIN } + set snap [sqlite3_snapshot_get db main] + set {} {} +} {} + +do_execsql_test -db db2 2.3 { + INSERT INTO t1 VALUES(5, 6); +} {} + +do_test 2.2 { + execsql { BEGIN } db3 + sqlite3_snapshot_open db3 main $snap +} {} + +sqlite3_snapshot_free $snap + finish_test From bcd6d5d393ddcce137156a7f73d723e4d3e9ca3f Mon Sep 17 00:00:00 2001 From: dan Date: Fri, 27 Sep 2024 10:57:41 +0000 Subject: [PATCH 05/34] Allow UPDATEs of unindexed columns in fts5 contentless_unindexed=1 tables. Testing to come. FossilOrigin-Name: cd36d66c88d7282eb0a3ccde5713253f72f5843e451b2693b71adfdae28b41fb --- ext/fts5/fts5Int.h | 2 +- ext/fts5/fts5_main.c | 128 +++++++++++++++++++++--------- ext/fts5/fts5_storage.c | 9 ++- ext/fts5/test/fts5unindexed2.test | 38 +++++++++ manifest | 18 ++--- manifest.uuid | 2 +- 6 files changed, 146 insertions(+), 51 deletions(-) diff --git a/ext/fts5/fts5Int.h b/ext/fts5/fts5Int.h index f189edf312..51d8081774 100644 --- a/ext/fts5/fts5Int.h +++ b/ext/fts5/fts5Int.h @@ -726,7 +726,7 @@ int sqlite3Fts5DropAll(Fts5Config*); int sqlite3Fts5CreateTable(Fts5Config*, const char*, const char*, int, char **); int sqlite3Fts5StorageDelete(Fts5Storage *p, i64, sqlite3_value**, int); -int sqlite3Fts5StorageContentInsert(Fts5Storage *p, sqlite3_value**, i64*); +int sqlite3Fts5StorageContentInsert(Fts5Storage *p, int, sqlite3_value**, i64*); int sqlite3Fts5StorageIndexInsert(Fts5Storage *p, sqlite3_value**, i64); int sqlite3Fts5StorageIntegrity(Fts5Storage *p, int iArg); diff --git a/ext/fts5/fts5_main.c b/ext/fts5/fts5_main.c index 781a8a8719..ff8b76694b 100644 --- a/ext/fts5/fts5_main.c +++ b/ext/fts5/fts5_main.c @@ -1801,7 +1801,7 @@ static void fts5StorageInsert( ){ int rc = *pRc; if( rc==SQLITE_OK ){ - rc = sqlite3Fts5StorageContentInsert(pTab->pStorage, apVal, piRowid); + rc = sqlite3Fts5StorageContentInsert(pTab->pStorage, 0, apVal, piRowid); } if( rc==SQLITE_OK ){ rc = sqlite3Fts5StorageIndexInsert(pTab->pStorage, apVal, *piRowid); @@ -1809,6 +1809,45 @@ static void fts5StorageInsert( *pRc = rc; } +static int fts5ContentlessUpdateOk( + Fts5Config *pConfig, + sqlite3_value **apVal, + i64 iOld, + i64 iNew, + int *pbContent +){ + int ii; + int bSeenIndex = 0; + int bSeenIndexNC = 0; + int rc = SQLITE_OK; + + for(ii=0; iinCol; ii++){ + if( pConfig->abUnindexed[ii]==0 ){ + if( sqlite3_value_nochange(apVal[ii]) ){ + bSeenIndexNC++; + }else{ + bSeenIndex++; + } + } + } + + if( bSeenIndex==0 && iOld==iNew ){ + *pbContent = 1; + }else{ + if( bSeenIndexNC || pConfig->bContentlessDelete==0 ){ + rc = SQLITE_ERROR; + sqlite3Fts5ConfigErrmsg(pConfig, + (pConfig->bContentlessDelete ? + "%s a subset of columns on fts5 contentless-delete table: %s" : + "%s contentless fts5 table: %s") + , "cannot UPDATE", pConfig->zName + ); + } + } + + return rc; +} + /* ** This function is the implementation of the xUpdate callback used by ** FTS3 virtual tables. It is invoked by SQLite each time a row is to be @@ -1895,25 +1934,35 @@ static int fts5UpdateMethod( assert( eType0==SQLITE_INTEGER || eType0==SQLITE_NULL ); assert( nArg!=1 || eType0==SQLITE_INTEGER ); - /* Filter out attempts to run UPDATE or DELETE on contentless tables. - ** This is not suported. Except - they are both supported if the CREATE - ** VIRTUAL TABLE statement contained "contentless_delete=1". */ - if( eType0==SQLITE_INTEGER - && fts5IsContentless(pTab, 1) - && pConfig->bContentlessDelete==0 - ){ - pTab->p.base.zErrMsg = sqlite3_mprintf( - "cannot %s contentless fts5 table: %s", - (nArg>1 ? "UPDATE" : "DELETE from"), pConfig->zName - ); - rc = SQLITE_ERROR; - } + /* + ** Extra rule for contentless tables: + ** + ** DELETE: + ** It is only possible to DELETE if the contentless_delete=1 flag + ** is set. + ** + ** UPDATE: + ** A "content-only" UPDATE is one that only affects UNINDEXED + ** columns. And that does not modify the rowid value. + ** + ** If the contentless_delete flag is clear, then content-only UPDATEs + ** are the only ones supported. Or, if contentless_delete=1 is set, + ** then updates that modify all indexed columns are also supported. + ** If all indexed columns are updated, then rowid updates are allowed. + */ /* DELETE */ - else if( nArg==1 ){ - i64 iDel = sqlite3_value_int64(apVal[0]); /* Rowid to delete */ - rc = sqlite3Fts5StorageDelete(pTab->pStorage, iDel, 0, 0); - bUpdateOrDelete = 1; + if( nArg==1 ){ + if( fts5IsContentless(pTab, 1) && pConfig->bContentlessDelete==0 ){ + fts5SetVtabError(pTab, + "cannot DELETE from contentless fts5 table: %s", pConfig->zName + ); + rc = SQLITE_ERROR; + }else{ + i64 iDel = sqlite3_value_int64(apVal[0]); /* Rowid to delete */ + rc = sqlite3Fts5StorageDelete(pTab->pStorage, iDel, 0, 0); + bUpdateOrDelete = 1; + } } /* INSERT or UPDATE */ @@ -1947,35 +1996,49 @@ static int fts5UpdateMethod( /* UPDATE */ else{ + Fts5Storage *pStorage = pTab->pStorage; i64 iOld = sqlite3_value_int64(apVal[0]); /* Old rowid */ i64 iNew = sqlite3_value_int64(apVal[1]); /* New rowid */ + int bContent = 0; /* Content only update */ + + if( fts5IsContentless(pTab, 1) ){ + rc = fts5ContentlessUpdateOk(pConfig,&apVal[2],iOld,iNew,&bContent); + if( rc!=SQLITE_OK ) goto update_out; + } + if( eType1!=SQLITE_INTEGER ){ rc = SQLITE_MISMATCH; }else if( iOld!=iNew ){ + assert( bContent==0 ); if( eConflict==SQLITE_REPLACE ){ - rc = sqlite3Fts5StorageDelete(pTab->pStorage, iOld, 0, 1); + rc = sqlite3Fts5StorageDelete(pStorage, iOld, 0, 1); if( rc==SQLITE_OK ){ - rc = sqlite3Fts5StorageDelete(pTab->pStorage, iNew, 0, 0); + rc = sqlite3Fts5StorageDelete(pStorage, iNew, 0, 0); } fts5StorageInsert(&rc, pTab, apVal, pRowid); }else{ - rc = sqlite3Fts5StorageFindDeleteRow(pTab->pStorage, iOld); + rc = sqlite3Fts5StorageFindDeleteRow(pStorage, iOld); if( rc==SQLITE_OK ){ - rc = sqlite3Fts5StorageContentInsert(pTab->pStorage,apVal,pRowid); + rc = sqlite3Fts5StorageContentInsert(pStorage, 0, apVal, pRowid); } if( rc==SQLITE_OK ){ - rc = sqlite3Fts5StorageDelete(pTab->pStorage, iOld, 0, 1); + rc = sqlite3Fts5StorageDelete(pStorage, iOld, 0, 1); } if( rc==SQLITE_OK ){ - rc = sqlite3Fts5StorageIndexInsert(pTab->pStorage, apVal,*pRowid); + rc = sqlite3Fts5StorageIndexInsert(pStorage, apVal,*pRowid); } } + }else if( bContent ){ + rc = sqlite3Fts5StorageFindDeleteRow(pStorage, iOld); + if( rc==SQLITE_OK ){ + rc = sqlite3Fts5StorageContentInsert(pStorage, 1, apVal, pRowid); + } }else{ - rc = sqlite3Fts5StorageDelete(pTab->pStorage, iOld, 0, 1); + rc = sqlite3Fts5StorageDelete(pStorage, iOld, 0, 1); fts5StorageInsert(&rc, pTab, apVal, pRowid); } bUpdateOrDelete = 1; - sqlite3Fts5StorageReleaseDeleteRow(pTab->pStorage); + sqlite3Fts5StorageReleaseDeleteRow(pStorage); } } @@ -2968,18 +3031,7 @@ static int fts5ColumnMethod( } } }else{ - /* A column created by the user containing values. */ - int bNochange = sqlite3_vtab_nochange(pCtx); - - if( bNochange ){ - if( pConfig->bContentlessDelete - && (pConfig->eContent==FTS5_CONTENT_NONE || !pConfig->abUnindexed[iCol]) - ){ - fts5ResultError(pCtx, "cannot UPDATE a subset of " - "columns on fts5 contentless-delete table: %s", pConfig->zName - ); - } - }else if( pConfig->eContent!=FTS5_CONTENT_NONE ){ + if( !sqlite3_vtab_nochange(pCtx) && pConfig->eContent!=FTS5_CONTENT_NONE ){ pConfig->pzErrmsg = &pTab->p.base.zErrMsg; rc = fts5SeekCursor(pCsr, 1); if( rc==SQLITE_OK ){ diff --git a/ext/fts5/fts5_storage.c b/ext/fts5/fts5_storage.c index ee65b0f7ee..7f149eee8a 100644 --- a/ext/fts5/fts5_storage.c +++ b/ext/fts5/fts5_storage.c @@ -141,7 +141,8 @@ static int fts5StorageGetStmt( ); break; - case FTS5_STMT_INSERT_CONTENT: { + case FTS5_STMT_INSERT_CONTENT: + case FTS5_STMT_REPLACE_CONTENT: { char *zBind = 0; int i; @@ -930,6 +931,7 @@ static int fts5StorageNewRowid(Fts5Storage *p, i64 *piRowid){ */ int sqlite3Fts5StorageContentInsert( Fts5Storage *p, + int bReplace, /* True to use REPLACE instead of INSERT */ sqlite3_value **apVal, i64 *piRowid ){ @@ -948,7 +950,10 @@ int sqlite3Fts5StorageContentInsert( }else{ sqlite3_stmt *pInsert = 0; /* Statement to write %_content table */ int i; /* Counter variable */ - rc = fts5StorageGetStmt(p, FTS5_STMT_INSERT_CONTENT, &pInsert, 0); + + assert( FTS5_STMT_INSERT_CONTENT+1==FTS5_STMT_REPLACE_CONTENT ); + assert( bReplace==0 || bReplace==1 ); + rc = fts5StorageGetStmt(p, FTS5_STMT_INSERT_CONTENT+bReplace, &pInsert, 0); if( pInsert ) sqlite3_clear_bindings(pInsert); /* Bind the rowid value */ diff --git a/ext/fts5/test/fts5unindexed2.test b/ext/fts5/test/fts5unindexed2.test index f2703ac374..c0abfc3980 100644 --- a/ext/fts5/test/fts5unindexed2.test +++ b/ext/fts5/test/fts5unindexed2.test @@ -255,5 +255,43 @@ do_execsql_test 5.6 { {{} two {}} } +#------------------------------------------------------------------------- +# Check that it is possible to UPDATE a contentless_unindexed=1 table +# if the only columns being modified are UNINDEXED. +# +# If the contentless_unindexed=1 table is also contentless_delete=1, then +# it is also possible to update indexed columns - but only if *all* indexed +# columns are updated. +# +reset_db +do_execsql_test 6.0 { + CREATE VIRTUAL TABLE ft1 USING fts5(a, b UNINDEXED, c UNINDEXED, d, + contentless_unindexed=1, content='' + ); + + INSERT INTO ft1(rowid, a, b, c, d) VALUES + (100, 'x y', 'b1', 'c1', 'a b'), + (200, 'c d', 'b2', 'c2', 'a b'), + (300, 'e f', 'b3', 'c3', 'a b'); +} + +do_execsql_test 6.1 { + UPDATE ft1 SET b='b1.1', c='c1.1' WHERE rowid=100; +} +do_execsql_test 6.2 { + UPDATE ft1 SET b='b2.1' WHERE rowid=200; +} +do_execsql_test 6.3 { + UPDATE ft1 SET c='c3.1' WHERE rowid=300; +} + +do_execsql_test 6.4 { + SELECT rowid, a, b, c, d FROM ft1 +} { + 100 {} b1.1 c1.1 {} + 200 {} b2.1 c2 {} + 300 {} b3 c3.1 {} +} + finish_test diff --git a/manifest b/manifest index c9871be60a..0daa473be9 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Prevent\sregular\sDELETE\sand\sUPDATE\sstatements\sfrom\srunning\sagainst\scontentless_unindexed=1\stables\sthat\sare\snot\salso\scontentless_delete=1. -D 2024-09-25T12:03:08.340 +C Allow\sUPDATEs\sof\sunindexed\scolumns\sin\sfts5\scontentless_unindexed=1\stables.\sTesting\sto\scome. +D 2024-09-27T10:57:41.777 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 @@ -93,15 +93,15 @@ F ext/fts3/unicode/mkunicode.tcl 63db9624ccf70d4887836c320eda93ab552f21008f3be7e F ext/fts3/unicode/parseunicode.tcl a981bd6466d12dd17967515801c3ff23f74a281be1a03cf1e6f52a6959fc77eb F ext/fts5/extract_api_docs.tcl 009cf59c77afa86d137b0cca3e3b1a5efbe2264faa2df233f9a7aa8563926d15 F ext/fts5/fts5.h efaaac0df3d3bc740383044c144b582f47921aafa21d7b10eb98f42c24c740b0 -F ext/fts5/fts5Int.h 927772e795bc897a210630296531c6a397b247f0b6f65ef9e9dc8e03baa77d1d +F ext/fts5/fts5Int.h bf0d3efa144f36e00f9b5206626aec2f436f58186a0835092394f2202e9828e3 F ext/fts5/fts5_aux.c 65a0468dd177d6093aa9ae1622e6d86b0136b8d267c62c0ad6493ad1e9a3d759 F ext/fts5/fts5_buffer.c 0eec58bff585f1a44ea9147eae5da2447292080ea435957f7488c70673cb6f09 F ext/fts5/fts5_config.c a6633d88596758941c625b526075b85d3d9fd1089d8d9eab5db6e8a71fd347ad F ext/fts5/fts5_expr.c 9a56f53700d1860f0ee2f373c2b9074eaf2a7aa0637d0e27a6476de26a3fee33 F ext/fts5/fts5_hash.c adda4272be401566a6e0ba1acbe70ee5cb97fce944bc2e04dc707152a0ec91b1 F ext/fts5/fts5_index.c 571483823193f09439356741669aa8c81da838ae6f5e1bfa7517f7ee2fb3addd -F ext/fts5/fts5_main.c 0d2013bd03285f4bbcea0f4594f2cd33b68337da709da79cd46379be189d11da -F ext/fts5/fts5_storage.c 1fbaf212042bdb363d74a48d3293b2c453a46880e86656df3ee19ade63472681 +F ext/fts5/fts5_main.c 853d44c804b6d842f0197002a03ecf482b721834b0bf3d2f1ab3a21e4fd13df5 +F ext/fts5/fts5_storage.c 3b5d743e97502263961e706aedd1000c394ee9df7942ba6671ce4bc41fcf9993 F ext/fts5/fts5_tcl.c 4db9258a7882c5eac0da4433042132aaf15b87dd1e1636c7a6ca203abd2c8bfe F ext/fts5/fts5_test_mi.c 08c11ec968148d4cb4119d96d819f8c1f329812c568bac3684f5464be177d3ee F ext/fts5/fts5_test_tok.c 3cb0a9b508b30d17ef025ccddd26ae3dc8ddffbe76c057616e59a9aa85d36f3b @@ -246,7 +246,7 @@ F ext/fts5/test/fts5unicode2.test 3bbd30152f9f760bf13886e5b1e5ec23ff62f56758ddda F ext/fts5/test/fts5unicode3.test f4891a3dac3b49c3d7c0fdb29566e9eb0ecff35263370c89f9661b1952b20818 F ext/fts5/test/fts5unicode4.test 728c8f0caafb05567f524ad313d9f8b780fa45987b8a8df04eff87923c74b4d0 F ext/fts5/test/fts5unindexed.test 168838d2c385e131120bbf5b516d2432a5fabc4caa2259c932e1d49ae209a4ae -F ext/fts5/test/fts5unindexed2.test 54a924b8acc6270350898e09d56c1b942b6e3cae789b9e5f31ec7b9a3dc7953e +F ext/fts5/test/fts5unindexed2.test 516236eceaac05ace322290a0d3705b4c4ffe4760d8eb9d014d9d27d56dfcc02 F ext/fts5/test/fts5update.test b8affd796e45c94a4d19ad5c26606ea06065a0f162a9562d9f005b5a80ccf0bc F ext/fts5/test/fts5version.test c22d163c17e60a99f022cbc52de5a48bb7f84deaa00fe15e9bc4c3aa1996204e F ext/fts5/test/fts5vocab.test 2a2bdb60d0998fa3124d541b6d30b019504918dc43a6584645b63a24be72f992 @@ -2213,8 +2213,8 @@ F vsixtest/vsixtest.tcl 6195aba1f12a5e10efc2b8c0009532167be5e301abe5b31385638080 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P c51dc2a5e75baacbd905cf314e7b1a58a81993ff05ca656739e028d7db25d5b2 -R 0573b4e17b15d974d21966942a753c69 +P 21539e9d0d57fdc762affbce9220d1bb1ca009d9dc751b4ccfe63eecbbe2f575 +R de377aee83cef1249306ac8b9c4a8126 U dan -Z 19e56c0d30986f9b0323b85fbd6aa264 +Z cfbbba283553b2d6b64e253eb6c401a0 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 957a7db2aa..28116b337f 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -21539e9d0d57fdc762affbce9220d1bb1ca009d9dc751b4ccfe63eecbbe2f575 +cd36d66c88d7282eb0a3ccde5713253f72f5843e451b2693b71adfdae28b41fb From 08f1ba0767d6bfe1cf098e8e81aa74681277ec0f Mon Sep 17 00:00:00 2001 From: dan Date: Fri, 27 Sep 2024 18:32:52 +0000 Subject: [PATCH 06/34] Fix a problem with UPDATEs that do not modify all UNINDEXED columns of a contentless_delete=1, contentless_unindexed=1 table. FossilOrigin-Name: b6b1db8d343d3e55c3a5589af3ec629762e06c6b689b77defd445347198cb2e7 --- ext/fts5/fts5_main.c | 61 ++++++++++------- ext/fts5/fts5_storage.c | 6 ++ ext/fts5/test/fts5update2.test | 122 +++++++++++++++++++++++++++++++++ manifest | 15 ++-- manifest.uuid | 2 +- 5 files changed, 174 insertions(+), 32 deletions(-) create mode 100644 ext/fts5/test/fts5update2.test diff --git a/ext/fts5/fts5_main.c b/ext/fts5/fts5_main.c index ff8b76694b..4ea727cac2 100644 --- a/ext/fts5/fts5_main.c +++ b/ext/fts5/fts5_main.c @@ -1809,16 +1809,38 @@ static void fts5StorageInsert( *pRc = rc; } -static int fts5ContentlessUpdateOk( +/* +** +** This function is called when the user attempts an UPDATE on a contentless +** table. Parameter bRowidModified is true if the UPDATE statement modifies +** the rowid value. Parameter apVal[] contains the new values for each user +** defined column of the fts5 table. pConfig is the configuration object of the +** table being updated (guaranteed to be contentless). The contentless_delete=1 +** and contentless_unindexed=1 options may or may not be set. +** +** This function returns SQLITE_OK if the UPDATE can go ahead, or an SQLite +** error code if it cannot. In this case an error message is also loaded into +** pConfig. Output parameter (*pbContent) is set to true if the caller should +** update the %_content table only - not the FTS index or any other shadow +** table. This occurs when an UPDATE modifies only UNINDEXED columns of the +** table. +** +** An UPDATE may proceed if: +** +** * The only columns modified are UNINDEXED columns, or +** +** * The contentless_delete=1 option was specified and all of the indexed +** columns (not a subset) have been modified. +*/ +static int fts5ContentlessUpdate( Fts5Config *pConfig, sqlite3_value **apVal, - i64 iOld, - i64 iNew, + int bRowidModified, int *pbContent ){ int ii; - int bSeenIndex = 0; - int bSeenIndexNC = 0; + int bSeenIndex = 0; /* Have seen modified indexed column */ + int bSeenIndexNC = 0; /* Have seen unmodified indexed column */ int rc = SQLITE_OK; for(ii=0; iinCol; ii++){ @@ -1831,7 +1853,7 @@ static int fts5ContentlessUpdateOk( } } - if( bSeenIndex==0 && iOld==iNew ){ + if( bSeenIndex==0 && bRowidModified==0 ){ *pbContent = 1; }else{ if( bSeenIndexNC || pConfig->bContentlessDelete==0 ){ @@ -1934,25 +1956,10 @@ static int fts5UpdateMethod( assert( eType0==SQLITE_INTEGER || eType0==SQLITE_NULL ); assert( nArg!=1 || eType0==SQLITE_INTEGER ); - /* - ** Extra rule for contentless tables: - ** - ** DELETE: - ** It is only possible to DELETE if the contentless_delete=1 flag - ** is set. - ** - ** UPDATE: - ** A "content-only" UPDATE is one that only affects UNINDEXED - ** columns. And that does not modify the rowid value. - ** - ** If the contentless_delete flag is clear, then content-only UPDATEs - ** are the only ones supported. Or, if contentless_delete=1 is set, - ** then updates that modify all indexed columns are also supported. - ** If all indexed columns are updated, then rowid updates are allowed. - */ - /* DELETE */ if( nArg==1 ){ + /* It is only possible to DELETE from a contentless table if the + ** contentless_delete=1 flag is set. */ if( fts5IsContentless(pTab, 1) && pConfig->bContentlessDelete==0 ){ fts5SetVtabError(pTab, "cannot DELETE from contentless fts5 table: %s", pConfig->zName @@ -2001,8 +2008,10 @@ static int fts5UpdateMethod( i64 iNew = sqlite3_value_int64(apVal[1]); /* New rowid */ int bContent = 0; /* Content only update */ + /* If this is a contentless table (including contentless_unindexed=1 + ** tables), check if the UPDATE may proceed. */ if( fts5IsContentless(pTab, 1) ){ - rc = fts5ContentlessUpdateOk(pConfig,&apVal[2],iOld,iNew,&bContent); + rc = fts5ContentlessUpdate(pConfig, &apVal[2], iOld!=iNew, &bContent); if( rc!=SQLITE_OK ) goto update_out; } @@ -2029,6 +2038,10 @@ static int fts5UpdateMethod( } } }else if( bContent ){ + /* This occurs when an UPDATE on a contentless table affects *only* + ** UNINDEXED columns. This is a no-op for contentless_unindexed=0 + ** tables, or a write to the %_content table only for =1 tables. */ + assert( fts5IsContentless(pTab, 1) ); rc = sqlite3Fts5StorageFindDeleteRow(pStorage, iOld); if( rc==SQLITE_OK ){ rc = sqlite3Fts5StorageContentInsert(pStorage, 1, apVal, pRowid); diff --git a/ext/fts5/fts5_storage.c b/ext/fts5/fts5_storage.c index 7f149eee8a..31f5fc5dc3 100644 --- a/ext/fts5/fts5_storage.c +++ b/ext/fts5/fts5_storage.c @@ -739,6 +739,12 @@ int sqlite3Fts5StorageDelete( if( rc==SQLITE_OK ){ if( p->pConfig->bContentlessDelete ){ rc = fts5StorageContentlessDelete(p, iDel); + if( rc==SQLITE_OK + && bSaveRow + && p->pConfig->eContent==FTS5_CONTENT_UNINDEXED + ){ + rc = sqlite3Fts5StorageFindDeleteRow(p, iDel); + } }else{ rc = fts5StorageDeleteFromIndex(p, iDel, apVal, bSaveRow); } diff --git a/ext/fts5/test/fts5update2.test b/ext/fts5/test/fts5update2.test new file mode 100644 index 0000000000..a402b3cb23 --- /dev/null +++ b/ext/fts5/test/fts5update2.test @@ -0,0 +1,122 @@ +# 2024 Sep 27 +# +# The author disclaims copyright to this source code. In place of +# a legal notice, here is a blessing: +# +# May you do good and not evil. +# May you find forgiveness for yourself and forgive others. +# May you share freely, never taking more than you give. +# +#************************************************************************* +# This file implements regression tests for SQLite library. The +# focus of this script is testing the FTS5 module. +# + +source [file join [file dirname [info script]] fts5_common.tcl] +set testprefix fts5update2 + +# If SQLITE_ENABLE_FTS5 is not defined, omit this file. +ifcapable !fts5 { + finish_test + return +} + + +#------------------------------------------------------------------------- +# Test that the various types of UPDATE statement are handled correctly +# by different table types. +# +foreach {tn cu} { + 1 0 + 2 1 +} { + reset_db + do_execsql_test 1.$tn.1 " + CREATE VIRTUAL TABLE ft1 USING fts5(a, b UNINDEXED, c UNINDEXED, d, + content='', + contentless_unindexed=$cu + ); + CREATE VIRTUAL TABLE ft2 USING fts5(a, b UNINDEXED, c UNINDEXED, d, + content='', + contentless_unindexed=$cu, contentless_delete=1 + ); + " + + do_execsql_test 1.$tn.2 { + INSERT INTO ft1(rowid, a, b, c, d) VALUES(1, 'a1', 'b1', 'c1', 'd1'); + INSERT INTO ft1(rowid, a, b, c, d) VALUES(2, 'a2', 'b2', 'c2', 'd2'); + INSERT INTO ft1(rowid, a, b, c, d) VALUES(3, 'a3', 'b3', 'c3', 'd3'); + + INSERT INTO ft2(rowid, a, b, c, d) VALUES(1, 'a1', 'b1', 'c1', 'd1'); + INSERT INTO ft2(rowid, a, b, c, d) VALUES(2, 'a2', 'b2', 'c2', 'd2'); + INSERT INTO ft2(rowid, a, b, c, d) VALUES(3, 'a3', 'b3', 'c3', 'd3'); + } + + # It should be possible to update a subset of the UNINDEXED columns of + # a contentless table. Regardless of whether or not contentless_unindexed=1 + # or contentless_delete=1 is set. + do_execsql_test 1.$tn.3 { + UPDATE ft1 SET b=b||'.1'; + UPDATE ft2 SET b=b||'.1'; + } + do_execsql_test 1.$tn.4 { + UPDATE ft1 SET b=b||'.2', c=c||'.2'; + UPDATE ft2 SET b=b||'.2', c=c||'.2'; + } + + set res(0) { + 1 {} {} {} {} + 2 {} {} {} {} + 3 {} {} {} {} + } + set res(1) { + 1 {} b1.1.2 c1.2 {} + 2 {} b2.1.2 c2.2 {} + 3 {} b3.1.2 c3.2 {} + } + + do_execsql_test 1.$tn.5 { + SELECT rowid, * FROM ft2 + } $res($cu) + + do_execsql_test 1.6.1 { SELECT rowid FROM ft1('a2') } {2} + do_execsql_test 1.6.2 { SELECT rowid FROM ft2('a2') } {2} + + # It should be possible to update all indexed columns (but no other subset) + # if the contentless_delete=1 option is set, as it is for "ft2". + do_execsql_test 1.$tn.7 { + UPDATE ft2 SET a='a22', d='d22' WHERE rowid=2; + } + do_execsql_test 1.$tn.8 { SELECT rowid FROM ft2('a22 AND d22') } {2} + + do_execsql_test 1.$tn.9 { + UPDATE ft2 SET a='a33', d='d33', b='b3' WHERE rowid=3; + } + + set res(1) { + 1 {} b1.1.2 c1.2 {} + 2 {} b2.1.2 c2.2 {} + 3 {} b3 c3.2 {} + } + do_execsql_test 1.$tn.10 { + SELECT rowid, * FROM ft2 + } $res($cu) + + do_catchsql_test 1.$tn.11 { + UPDATE ft2 SET a='a11' WHERE rowid=1 + } {1 {cannot UPDATE a subset of columns on fts5 contentless-delete table: ft2}} + do_catchsql_test 1.$tn.12 { + UPDATE ft2 SET d='d11' WHERE rowid=1 + } {1 {cannot UPDATE a subset of columns on fts5 contentless-delete table: ft2}} + + # It is not possible to update the values of indexed columns if + # contentless_delete=1 is not set. + do_catchsql_test 1.$tn.13 { + UPDATE ft1 SET a='a11' WHERE rowid=1 + } {1 {cannot UPDATE contentless fts5 table: ft1}} + do_catchsql_test 1.$tn.14 { + UPDATE ft1 SET d='d11' WHERE rowid=1 + } {1 {cannot UPDATE contentless fts5 table: ft1}} +} + +finish_test diff --git a/manifest b/manifest index 2888f0d958..9524da68c3 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Merge\strunk\schanges\sinto\sthis\sbranch. -D 2024-09-27T11:35:22.006 +C Fix\sa\sproblem\swith\sUPDATEs\sthat\sdo\snot\smodify\sall\sUNINDEXED\scolumns\sof\sa\scontentless_delete=1,\scontentless_unindexed=1\stable. +D 2024-09-27T18:32:52.251 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 @@ -100,8 +100,8 @@ F ext/fts5/fts5_config.c a6633d88596758941c625b526075b85d3d9fd1089d8d9eab5db6e8a F ext/fts5/fts5_expr.c 9a56f53700d1860f0ee2f373c2b9074eaf2a7aa0637d0e27a6476de26a3fee33 F ext/fts5/fts5_hash.c adda4272be401566a6e0ba1acbe70ee5cb97fce944bc2e04dc707152a0ec91b1 F ext/fts5/fts5_index.c 571483823193f09439356741669aa8c81da838ae6f5e1bfa7517f7ee2fb3addd -F ext/fts5/fts5_main.c 853d44c804b6d842f0197002a03ecf482b721834b0bf3d2f1ab3a21e4fd13df5 -F ext/fts5/fts5_storage.c 3b5d743e97502263961e706aedd1000c394ee9df7942ba6671ce4bc41fcf9993 +F ext/fts5/fts5_main.c 4e4a23b76b7ec8d93c6bcad0468d0871cf2d6d270369bfa80d2e1d3a1fc33d92 +F ext/fts5/fts5_storage.c 337b05e4c66fc822d031e264d65bde807ec2fab08665ca2cc8aaf9c5fa06792c F ext/fts5/fts5_tcl.c 4db9258a7882c5eac0da4433042132aaf15b87dd1e1636c7a6ca203abd2c8bfe F ext/fts5/fts5_test_mi.c 08c11ec968148d4cb4119d96d819f8c1f329812c568bac3684f5464be177d3ee F ext/fts5/fts5_test_tok.c 3cb0a9b508b30d17ef025ccddd26ae3dc8ddffbe76c057616e59a9aa85d36f3b @@ -248,6 +248,7 @@ F ext/fts5/test/fts5unicode4.test 728c8f0caafb05567f524ad313d9f8b780fa45987b8a8d F ext/fts5/test/fts5unindexed.test 168838d2c385e131120bbf5b516d2432a5fabc4caa2259c932e1d49ae209a4ae F ext/fts5/test/fts5unindexed2.test 516236eceaac05ace322290a0d3705b4c4ffe4760d8eb9d014d9d27d56dfcc02 F ext/fts5/test/fts5update.test b8affd796e45c94a4d19ad5c26606ea06065a0f162a9562d9f005b5a80ccf0bc +F ext/fts5/test/fts5update2.test 1564d67b209a7d9358c450ecc53b12fcfbf176e865a3d340a31fc603cf3c0c2b F ext/fts5/test/fts5version.test c22d163c17e60a99f022cbc52de5a48bb7f84deaa00fe15e9bc4c3aa1996204e F ext/fts5/test/fts5vocab.test 2a2bdb60d0998fa3124d541b6d30b019504918dc43a6584645b63a24be72f992 F ext/fts5/test/fts5vocab2.test bbba149c254375d00055930c1a501c9a51e80b0d20bf7b98f3e9fa3b03786373 @@ -2216,8 +2217,8 @@ F vsixtest/vsixtest.tcl 6195aba1f12a5e10efc2b8c0009532167be5e301abe5b31385638080 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P cd36d66c88d7282eb0a3ccde5713253f72f5843e451b2693b71adfdae28b41fb 27ef1909bb0c4d9470c6074b40500632c68341127a079a3eb3b6a19dbfb2aeac -R af6ff70b1f29deaae408cb2f001619bf +P 4a26a4e0015bc42b1d007def3750caf7baefe429270a295cc2f4499c98c07247 +R 95c3ae17f3cd6ac697952fa425e027b2 U dan -Z 395c4e3ba81ec86081df96a010608d77 +Z 35986965a22be180ac5ad4eb973f5b34 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 9188350703..7207c2799c 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -4a26a4e0015bc42b1d007def3750caf7baefe429270a295cc2f4499c98c07247 +b6b1db8d343d3e55c3a5589af3ec629762e06c6b689b77defd445347198cb2e7 From 43eafb7b7608257d2263256c6b3bc9c2e31ad35f Mon Sep 17 00:00:00 2001 From: dan Date: Fri, 27 Sep 2024 19:10:54 +0000 Subject: [PATCH 07/34] Fix a problem with UPDATE statements that modify the rowid of contentless_delete=1 tables. FossilOrigin-Name: d69abca82145465c85241a12322986f22bf12ffe42f86c2c8e8e2f2a77d53bf8 --- ext/fts5/fts5_main.c | 4 ++-- ext/fts5/test/fts5update2.test | 21 +++++++++++++++++++++ manifest | 14 +++++++------- manifest.uuid | 2 +- 4 files changed, 31 insertions(+), 10 deletions(-) diff --git a/ext/fts5/fts5_main.c b/ext/fts5/fts5_main.c index 4ea727cac2..5713fccdd1 100644 --- a/ext/fts5/fts5_main.c +++ b/ext/fts5/fts5_main.c @@ -2031,10 +2031,10 @@ static int fts5UpdateMethod( rc = sqlite3Fts5StorageContentInsert(pStorage, 0, apVal, pRowid); } if( rc==SQLITE_OK ){ - rc = sqlite3Fts5StorageDelete(pStorage, iOld, 0, 1); + rc = sqlite3Fts5StorageDelete(pStorage, iOld, 0, 0); } if( rc==SQLITE_OK ){ - rc = sqlite3Fts5StorageIndexInsert(pStorage, apVal,*pRowid); + rc = sqlite3Fts5StorageIndexInsert(pStorage, apVal, *pRowid); } } }else if( bContent ){ diff --git a/ext/fts5/test/fts5update2.test b/ext/fts5/test/fts5update2.test index a402b3cb23..64bc856452 100644 --- a/ext/fts5/test/fts5update2.test +++ b/ext/fts5/test/fts5update2.test @@ -117,6 +117,27 @@ foreach {tn cu} { do_catchsql_test 1.$tn.14 { UPDATE ft1 SET d='d11' WHERE rowid=1 } {1 {cannot UPDATE contentless fts5 table: ft1}} + + # It should be possible to update the rowid if contentless_delete=1 is + # set and all indexed columns are updated. + if {$tn==2} breakpoint + do_execsql_test 1.$tn.15 { + UPDATE ft2 SET a='a_one', d='d_one', rowid=11 WHERE rowid=1 + } + + set res(0) { + 2 {} {} {} {} + 3 {} {} {} {} + 11 {} {} {} {} + } + set res(1) { + 2 {} b2.1.2 c2.2 {} + 3 {} b3 c3.2 {} + 11 {} b1.1.2 c1.2 {} + } + do_execsql_test 1.$tn.16 { + SELECT rowid, * FROM ft2 + } $res($cu) } finish_test diff --git a/manifest b/manifest index 9524da68c3..fbcaee7341 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Fix\sa\sproblem\swith\sUPDATEs\sthat\sdo\snot\smodify\sall\sUNINDEXED\scolumns\sof\sa\scontentless_delete=1,\scontentless_unindexed=1\stable. -D 2024-09-27T18:32:52.251 +C Fix\sa\sproblem\swith\sUPDATE\sstatements\sthat\smodify\sthe\srowid\sof\scontentless_delete=1\stables. +D 2024-09-27T19:10:54.658 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 @@ -100,7 +100,7 @@ F ext/fts5/fts5_config.c a6633d88596758941c625b526075b85d3d9fd1089d8d9eab5db6e8a F ext/fts5/fts5_expr.c 9a56f53700d1860f0ee2f373c2b9074eaf2a7aa0637d0e27a6476de26a3fee33 F ext/fts5/fts5_hash.c adda4272be401566a6e0ba1acbe70ee5cb97fce944bc2e04dc707152a0ec91b1 F ext/fts5/fts5_index.c 571483823193f09439356741669aa8c81da838ae6f5e1bfa7517f7ee2fb3addd -F ext/fts5/fts5_main.c 4e4a23b76b7ec8d93c6bcad0468d0871cf2d6d270369bfa80d2e1d3a1fc33d92 +F ext/fts5/fts5_main.c 50eb059e51d730e8e0c77df4e568b018079e112a755c094488b0d5b1aa06afbb F ext/fts5/fts5_storage.c 337b05e4c66fc822d031e264d65bde807ec2fab08665ca2cc8aaf9c5fa06792c F ext/fts5/fts5_tcl.c 4db9258a7882c5eac0da4433042132aaf15b87dd1e1636c7a6ca203abd2c8bfe F ext/fts5/fts5_test_mi.c 08c11ec968148d4cb4119d96d819f8c1f329812c568bac3684f5464be177d3ee @@ -248,7 +248,7 @@ F ext/fts5/test/fts5unicode4.test 728c8f0caafb05567f524ad313d9f8b780fa45987b8a8d F ext/fts5/test/fts5unindexed.test 168838d2c385e131120bbf5b516d2432a5fabc4caa2259c932e1d49ae209a4ae F ext/fts5/test/fts5unindexed2.test 516236eceaac05ace322290a0d3705b4c4ffe4760d8eb9d014d9d27d56dfcc02 F ext/fts5/test/fts5update.test b8affd796e45c94a4d19ad5c26606ea06065a0f162a9562d9f005b5a80ccf0bc -F ext/fts5/test/fts5update2.test 1564d67b209a7d9358c450ecc53b12fcfbf176e865a3d340a31fc603cf3c0c2b +F ext/fts5/test/fts5update2.test 8d201489b3f3fa253bea592ba6c943d49d80d6bdd7ca8002e70005ec89df3f44 F ext/fts5/test/fts5version.test c22d163c17e60a99f022cbc52de5a48bb7f84deaa00fe15e9bc4c3aa1996204e F ext/fts5/test/fts5vocab.test 2a2bdb60d0998fa3124d541b6d30b019504918dc43a6584645b63a24be72f992 F ext/fts5/test/fts5vocab2.test bbba149c254375d00055930c1a501c9a51e80b0d20bf7b98f3e9fa3b03786373 @@ -2217,8 +2217,8 @@ F vsixtest/vsixtest.tcl 6195aba1f12a5e10efc2b8c0009532167be5e301abe5b31385638080 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P 4a26a4e0015bc42b1d007def3750caf7baefe429270a295cc2f4499c98c07247 -R 95c3ae17f3cd6ac697952fa425e027b2 +P b6b1db8d343d3e55c3a5589af3ec629762e06c6b689b77defd445347198cb2e7 +R acb0bb065c957a3db625bc75e5d80840 U dan -Z 35986965a22be180ac5ad4eb973f5b34 +Z c447109d9b6c39331039c8ac2d02cdb0 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 7207c2799c..cce3bd5450 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -b6b1db8d343d3e55c3a5589af3ec629762e06c6b689b77defd445347198cb2e7 +d69abca82145465c85241a12322986f22bf12ffe42f86c2c8e8e2f2a77d53bf8 From 58b4a8f6e741b31790ce0a4cd7ad6a2b5dfe0b82 Mon Sep 17 00:00:00 2001 From: dan Date: Fri, 27 Sep 2024 19:21:09 +0000 Subject: [PATCH 08/34] Extra test cases for UPDATEs of contentless tables. FossilOrigin-Name: 4d11d844de3edd82f022c36381ca7f14a546a608293c329b91e7f041cec82ff5 --- ext/fts5/test/fts5update2.test | 34 +++++++++++++++++++++++++++++++++- manifest | 12 ++++++------ manifest.uuid | 2 +- 3 files changed, 40 insertions(+), 8 deletions(-) diff --git a/ext/fts5/test/fts5update2.test b/ext/fts5/test/fts5update2.test index 64bc856452..9e5e6c81db 100644 --- a/ext/fts5/test/fts5update2.test +++ b/ext/fts5/test/fts5update2.test @@ -120,7 +120,6 @@ foreach {tn cu} { # It should be possible to update the rowid if contentless_delete=1 is # set and all indexed columns are updated. - if {$tn==2} breakpoint do_execsql_test 1.$tn.15 { UPDATE ft2 SET a='a_one', d='d_one', rowid=11 WHERE rowid=1 } @@ -138,6 +137,39 @@ foreach {tn cu} { do_execsql_test 1.$tn.16 { SELECT rowid, * FROM ft2 } $res($cu) + + # Should not be possible to update the rowid of a contentless_delete=1 + # table if no indexed columns are updated. + do_catchsql_test 1.$tn.17 { + UPDATE ft2 SET rowid=12 WHERE rowid=11 + } {1 {cannot UPDATE a subset of columns on fts5 contentless-delete table: ft2}} + do_catchsql_test 1.$tn.18 { + UPDATE ft1 SET rowid=12 WHERE rowid=1 + } {1 {cannot UPDATE contentless fts5 table: ft1}} + + do_execsql_test 1.$tn.19 { + UPDATE ft2 SET a='a_two', d='d_two', c='newval', rowid=12 WHERE rowid=2 + } {} + + set res(0) { + 3 {} {} {} {} + 11 {} {} {} {} + 12 {} {} {} {} + } + set res(1) { + 3 {} b3 c3.2 {} + 11 {} b1.1.2 c1.2 {} + 12 {} b2.1.2 newval {} + } + do_execsql_test 1.$tn.20 { + SELECT rowid, * FROM ft2 + } $res($cu) + + do_execsql_test 1.$tn.21 { + SELECT rowid, * FROM ft2('a_two AND d_two') + } [lrange $res($cu) 10 end] + + } finish_test diff --git a/manifest b/manifest index fbcaee7341..11bbbe30ca 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Fix\sa\sproblem\swith\sUPDATE\sstatements\sthat\smodify\sthe\srowid\sof\scontentless_delete=1\stables. -D 2024-09-27T19:10:54.658 +C Extra\stest\scases\sfor\sUPDATEs\sof\scontentless\stables. +D 2024-09-27T19:21:09.689 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 @@ -248,7 +248,7 @@ F ext/fts5/test/fts5unicode4.test 728c8f0caafb05567f524ad313d9f8b780fa45987b8a8d F ext/fts5/test/fts5unindexed.test 168838d2c385e131120bbf5b516d2432a5fabc4caa2259c932e1d49ae209a4ae F ext/fts5/test/fts5unindexed2.test 516236eceaac05ace322290a0d3705b4c4ffe4760d8eb9d014d9d27d56dfcc02 F ext/fts5/test/fts5update.test b8affd796e45c94a4d19ad5c26606ea06065a0f162a9562d9f005b5a80ccf0bc -F ext/fts5/test/fts5update2.test 8d201489b3f3fa253bea592ba6c943d49d80d6bdd7ca8002e70005ec89df3f44 +F ext/fts5/test/fts5update2.test 1757efae987e6a5a8ac75e3d487fe7be0b8de6006c12f3789fa5d86ee1012706 F ext/fts5/test/fts5version.test c22d163c17e60a99f022cbc52de5a48bb7f84deaa00fe15e9bc4c3aa1996204e F ext/fts5/test/fts5vocab.test 2a2bdb60d0998fa3124d541b6d30b019504918dc43a6584645b63a24be72f992 F ext/fts5/test/fts5vocab2.test bbba149c254375d00055930c1a501c9a51e80b0d20bf7b98f3e9fa3b03786373 @@ -2217,8 +2217,8 @@ F vsixtest/vsixtest.tcl 6195aba1f12a5e10efc2b8c0009532167be5e301abe5b31385638080 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P b6b1db8d343d3e55c3a5589af3ec629762e06c6b689b77defd445347198cb2e7 -R acb0bb065c957a3db625bc75e5d80840 +P d69abca82145465c85241a12322986f22bf12ffe42f86c2c8e8e2f2a77d53bf8 +R 817da49217632f1ab83203ed5615b513 U dan -Z c447109d9b6c39331039c8ac2d02cdb0 +Z b50e3f13244bcc732f70d03504469c39 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index cce3bd5450..fb8124c66b 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -d69abca82145465c85241a12322986f22bf12ffe42f86c2c8e8e2f2a77d53bf8 +4d11d844de3edd82f022c36381ca7f14a546a608293c329b91e7f041cec82ff5 From fabae7a134c0adb462aa75d33574f9ebdf924eda Mon Sep 17 00:00:00 2001 From: stephan Date: Sat, 28 Sep 2024 00:39:19 +0000 Subject: [PATCH 09/34] Minor makefile doc fixes. No functional changes. FossilOrigin-Name: b3ad58e1fc73941f2d32bab0e0fac0b95849ae69f84788a431e65bb072e42db5 --- ext/wasm/GNUmakefile | 4 ++-- ext/wasm/wasmfs.make | 2 +- manifest | 17 ++++++++--------- manifest.uuid | 2 +- 4 files changed, 12 insertions(+), 13 deletions(-) diff --git a/ext/wasm/GNUmakefile b/ext/wasm/GNUmakefile index d98a0cb8ed..ae989040ee 100644 --- a/ext/wasm/GNUmakefile +++ b/ext/wasm/GNUmakefile @@ -367,12 +367,12 @@ DISTCLEAN_FILES += $(bin.stripccomments) ######################################################################## # bin.mkwb is used for generating some of the makefile code for the -# various build builds. It used to be generated in this makefile via a +# various wasm builds. It used to be generated in this makefile via a # difficult-to-read/maintain block of $(eval)'d code. Attempts were # made to generate it from tcl and bash (shell) but having to escape # the $ references in those languages made it just as illegible as the # native makefile code. Somewhat surprisingly, moving that code generation -# to C makes it slightly less illegible than the previousq 3 options. +# to C makes it slightly less illegible than the previous 3 options. bin.mkwb := ./mkwasmbuilds $(bin.mkwb): $(bin.mkwb).c $(MAKEFILE) $(CC) -o $@ $< diff --git a/ext/wasm/wasmfs.make b/ext/wasm/wasmfs.make index 4d34c42140..9de5574f26 100644 --- a/ext/wasm/wasmfs.make +++ b/ext/wasm/wasmfs.make @@ -7,7 +7,7 @@ ######################################################################## MAKEFILE.wasmfs := $(lastword $(MAKEFILE_LIST)) # ensure that the following message starts on line 10 or higher for proper -# alignment! +# $(warning) alignment! ifneq (1,$(MAKING_CLEAN)) $(warning !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!) $(warning !! The WASMFS build is not well-supported. WASMFS is a proverbial) diff --git a/manifest b/manifest index ff89df3542..b16eb9e49b 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Merge\swasm-build-rework\sbranch\sinto\strunk.\sSummary:\s1)\sadd\soptional\sbare-bones\sbuild,\sstripped\sof\smany\soptional\slibrary\sfeatures,\s2)\sreplace\smuch\sof\sthe\shyper-spaghetti\swasm-specific\smakefile\scode\swith\sa\smore\slegible\sstatic\scode\sgenerator. -D 2024-09-28T00:02:52.169 +C Minor\smakefile\sdoc\sfixes.\sNo\sfunctional\schanges. +D 2024-09-28T00:39:19.799 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 @@ -603,7 +603,7 @@ F ext/userauth/sqlite3userauth.h 7f3ea8c4686db8e40b0a0e7a8e0b00fac13aa7a3 F ext/userauth/user-auth.txt ca7e9ee82ca4e1c1744295f8184dd70edfae1992865d26c64303f539eb6c084c F ext/userauth/userauth.c 7f00cded7dcaa5d47f54539b290a43d2e59f4b1eb5f447545fa865f002fc80cb F ext/wasm/EXPORTED_FUNCTIONS.fiddle.in 27450c8b8c70875a260aca55435ec927068b34cef801a96205adb81bdcefc65c -F ext/wasm/GNUmakefile 34a4590ae3f7ce5a70bf1c6f0384a7935e6c9809281e40165381ba04df34ceae +F ext/wasm/GNUmakefile a35f8f9cd8fca7a8ea5c76492c3b72f8656ff6e62dd770f755d9b024dbdb2a4b F ext/wasm/README-dist.txt 6382cb9548076fca472fb3330bbdba3a55c1ea0b180ff9253f084f07ff383576 F ext/wasm/README.md a8a2962c3aebdf8d2104a9102e336c5554e78fc6072746e5daf9c61514e7d193 F ext/wasm/SQLTester/GNUmakefile e0794f676d55819951bbfae45cc5e8d7818dc460492dc317ce7f0d2eca15caff @@ -612,7 +612,7 @@ F ext/wasm/SQLTester/SQLTester.run.mjs c72b7fe2072d05992f7a3d8c6a1d34e95712513ce F ext/wasm/SQLTester/index.html 3f8a016df0776be76605abf20e815ecaafbe055abac0e1fe5ea080e7846b760d F ext/wasm/SQLTester/touint8array.c 2d5ece04ec1393a6a60c4bf96385bda5e1a10ad49f3038b96460fc5e5aa7e536 F ext/wasm/api/EXPORTED_FUNCTIONS.sqlite3-core 2bcbbfe3b95c043ed6037e2708a2ee078d212dd1612c364f93588d8dc97300fe -F ext/wasm/api/EXPORTED_FUNCTIONS.sqlite3-extras fe40d6d758646e38f8b15f709044951e10884214f5453d35502100179c388c13 w ext/wasm/api/EXPORTED_FUNCTIONS.sqlite3-session +F ext/wasm/api/EXPORTED_FUNCTIONS.sqlite3-extras fe40d6d758646e38f8b15f709044951e10884214f5453d35502100179c388c13 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 @@ -683,7 +683,7 @@ F ext/wasm/tester1.c-pp.js bb8c41a56ca0eabb945ca2e8f06324a7b63ad91630959d714b071 F ext/wasm/tests/opfs/concurrency/index.html 657578a6e9ce1e9b8be951549ed93a6a471f4520a99e5b545928668f4285fb5e F ext/wasm/tests/opfs/concurrency/test.js d08889a5bb6e61937d0b8cbb78c9efbefbf65ad09f510589c779b7cc6a803a88 F ext/wasm/tests/opfs/concurrency/worker.js 0a8c1a3e6ebb38aabbee24f122693f1fb29d599948915c76906681bb7da1d3d2 -F ext/wasm/wasmfs.make 8067daf346482cdb91414c3f6b8f6ff110bfa874294f73e13479c755af67ec20 +F ext/wasm/wasmfs.make bc8bb227f35d5bd3863a7bd2233437c37472a0d81585979f058f9b9b503bef35 F install-sh 9d4de14ab9fb0facae2f48780b874848cbf2f895 x F ltmain.sh 3ff0879076df340d2e23ae905484d8c15d5fdea8 F magic.txt 5ade0bc977aa135e79e3faaea894d5671b26107cc91e70783aa7dc83f22f3ba0 @@ -2213,9 +2213,8 @@ F vsixtest/vsixtest.tcl 6195aba1f12a5e10efc2b8c0009532167be5e301abe5b31385638080 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P e74fce93c518296bdb0a4273cd5fd3f785d37d27750ca456b61a3502135775f9 f904b3b7842da036c3e8423bae02cdf207573c92dc379a601eae289eb3c5f547 -R 00aae997005fe8baf8a0564b28d0f4b3 -T +closed f904b3b7842da036c3e8423bae02cdf207573c92dc379a601eae289eb3c5f547 Closed\sby\sintegrate-merge. +P 208c27714646c9bc26eef11266086a71da04bc24e87078de0955e7beb68a821e +R 2a15755da1c3e9e619c193a945de5bc6 U stephan -Z 285fd3333f337a65629db5a9e7f33975 +Z 991ac6d8780a391427387df58194645e # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 424b2a3a6c..c3fe76067a 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -208c27714646c9bc26eef11266086a71da04bc24e87078de0955e7beb68a821e +b3ad58e1fc73941f2d32bab0e0fac0b95849ae69f84788a431e65bb072e42db5 From 51fb37db61f4602a074dd56bf3f688c5a57ac2cd Mon Sep 17 00:00:00 2001 From: stephan Date: Sat, 28 Sep 2024 11:03:00 +0000 Subject: [PATCH 10/34] For wasm builds: automatically use higher optimization (but slower build) levels when a target related to deliverables (as opposed to dev mode) is explicitly invoked. FossilOrigin-Name: 45361ab9744ccac3419d97fe8951838f14bd28220e3f7f747b39e46cfc3b5a1d --- ext/wasm/GNUmakefile | 29 ++++++++++++++++++++++------- ext/wasm/fiddle.make | 2 ++ manifest | 14 +++++++------- manifest.uuid | 2 +- 4 files changed, 32 insertions(+), 15 deletions(-) diff --git a/ext/wasm/GNUmakefile b/ext/wasm/GNUmakefile index ae989040ee..9c0322ea8b 100644 --- a/ext/wasm/GNUmakefile +++ b/ext/wasm/GNUmakefile @@ -145,11 +145,19 @@ $(sqlite3.h): $(MAKE) -C $(dir.top) sqlite3.c $(sqlite3.c): $(sqlite3.h) +######################################################################## +# Special-case builds for which we require certain pre-conditions +# which, if not met, may cause warnings or fatal errors in the build. +# This also affects the default optimization level flags. Note that +# the fiddle targets are in this list because they are used for +# generating sqlite.org/fiddle. +OPTIMIZED_TARGETS := dist snapshot fiddle fiddle.debug + ifneq (1,$(MAKING_CLEAN)) - ifeq (,$(filter release snapshot,$(MAKECMDGOALS))) + ifeq (,$(filter $(OPTIMIZED_TARGETS),$(MAKECMDGOALS))) $(info ==============================================================) - $(info == Development build. Use 'release' or 'snapshot' target) - $(info == for a smaller release build.) + $(info == Development build. Make one of (dist, snapshot) for a) + $(info == smaller release build.) $(info ==============================================================) endif endif @@ -193,11 +201,11 @@ else $(info WARNING: on Ubuntu-like systems it can be installed with:) $(info WARNING: sudo apt install wabt) $(info WARNING: *******************************************************************) + ifneq (,$(filter $(OPTIMIZED_TARGETS),$(MAKECMDGOALS))) + $(error Cannot make release-quality binary because wasm-strip is not available.) + endif wasm-strip.bin := echo "not wasm-stripping" endif - ifneq (,$(filter release snapshot,$(MAKECMDGOALS))) - $(error Cannot make release-quality binary because wasm-strip is not available.) - endif endif maybe-wasm-strip := $(wasm-strip.bin) @@ -443,7 +451,14 @@ emcc.WASM_BIGINT ?= 1 # emcc_opt = optimization-related flags. These are primarily used by # the various oX targets. build times for -O levels higher than 0 are # painful at dev-time. -emcc_opt ?= -O0 +# +# When running any of the $(OPTIMIZED_TARGETS) explicitly, e.g. for +# a release distribution +ifeq (,$(filter $(OPTIMIZED_TARGETS),$(MAKECMDGOALS))) + emcc_opt ?= -O0 +else + emcc_opt ?= -Oz +endif # When passing emcc_opt from the CLI, += and re-assignment have no # effect, so emcc_opt+=-g3 doesn't work. So... diff --git a/ext/wasm/fiddle.make b/ext/wasm/fiddle.make index 5c97209122..d0e811cac8 100644 --- a/ext/wasm/fiddle.make +++ b/ext/wasm/fiddle.make @@ -68,6 +68,8 @@ fiddle.cses := $(dir.top)/shell.c $(sqlite3-wasm.c) # emit rules for one of the two fiddle builds. $1 must be # either $(dir.fiddle) or $(dir.fiddle-debug). $2 must be empty # in the former case and .debug in the latter. +# +# TODO: move this into mkwasmbuilds.c. define make-fiddle-rules fiddle-module.js$(2) := $(1)/fiddle-module.js fiddle-module.wasm$(2) := $$(subst .js,.wasm,$$(fiddle-module.js$(2))) diff --git a/manifest b/manifest index b16eb9e49b..ccedf55294 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Minor\smakefile\sdoc\sfixes.\sNo\sfunctional\schanges. -D 2024-09-28T00:39:19.799 +C For\swasm\sbuilds:\sautomatically\suse\shigher\soptimization\s(but\sslower\sbuild)\slevels\swhen\sa\starget\srelated\sto\sdeliverables\s(as\sopposed\sto\sdev\smode)\sis\sexplicitly\sinvoked. +D 2024-09-28T11:03:00.874 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 @@ -603,7 +603,7 @@ F ext/userauth/sqlite3userauth.h 7f3ea8c4686db8e40b0a0e7a8e0b00fac13aa7a3 F ext/userauth/user-auth.txt ca7e9ee82ca4e1c1744295f8184dd70edfae1992865d26c64303f539eb6c084c F ext/userauth/userauth.c 7f00cded7dcaa5d47f54539b290a43d2e59f4b1eb5f447545fa865f002fc80cb F ext/wasm/EXPORTED_FUNCTIONS.fiddle.in 27450c8b8c70875a260aca55435ec927068b34cef801a96205adb81bdcefc65c -F ext/wasm/GNUmakefile a35f8f9cd8fca7a8ea5c76492c3b72f8656ff6e62dd770f755d9b024dbdb2a4b +F ext/wasm/GNUmakefile e9ec8800b8f403e43c905e931beb1c4f921eaf7008932aaab749047fb5f0f14f F ext/wasm/README-dist.txt 6382cb9548076fca472fb3330bbdba3a55c1ea0b180ff9253f084f07ff383576 F ext/wasm/README.md a8a2962c3aebdf8d2104a9102e336c5554e78fc6072746e5daf9c61514e7d193 F ext/wasm/SQLTester/GNUmakefile e0794f676d55819951bbfae45cc5e8d7818dc460492dc317ce7f0d2eca15caff @@ -655,7 +655,7 @@ F ext/wasm/demo-worker1.html 2c178c1890a2beb5a5fecb1453e796d067a4b8d3d2a04d65ca2 F ext/wasm/demo-worker1.js 836bece8615b17b1b572584f7b15912236a5947fe8c68b98d2737d7e287447ef F ext/wasm/dist.make 653e212c1e84aa3be168d62a10616ccea45ee9585b0192745d2706707a5248ce F ext/wasm/example_extra_init.c 2347cd69d19d839ef4e5e77b7855103a7fe3ef2af86f2e8c95839afd8b05862f -F ext/wasm/fiddle.make 8ccee74606582336ba885df75fbd6b40c0bb0d0a686f6472d4b6dacec1393145 +F ext/wasm/fiddle.make fecd12fc78f5ae3fba5387fee59f83a2bfb012c073e2d956151a8957bfff4731 F ext/wasm/fiddle/fiddle-worker.js 850e66fce39b89d59e161d1abac43a181a4caa89ddeea162765d660277cd84ce F ext/wasm/fiddle/fiddle.js b444a5646a9aac9f3fc06c53d78af5e1912eb235d69a8e6010723e4eb0e9d4a1 F ext/wasm/fiddle/index.html c79b1741cbeba78f88af0a84cf5ec7de87a909a6a8d10a369b1f4824c66c2088 @@ -2213,8 +2213,8 @@ F vsixtest/vsixtest.tcl 6195aba1f12a5e10efc2b8c0009532167be5e301abe5b31385638080 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P 208c27714646c9bc26eef11266086a71da04bc24e87078de0955e7beb68a821e -R 2a15755da1c3e9e619c193a945de5bc6 +P b3ad58e1fc73941f2d32bab0e0fac0b95849ae69f84788a431e65bb072e42db5 +R 31eec55429d58e8299eead65de81d192 U stephan -Z 991ac6d8780a391427387df58194645e +Z baebfcdbf257af1c75327d449926f47d # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index c3fe76067a..81251ec111 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -b3ad58e1fc73941f2d32bab0e0fac0b95849ae69f84788a431e65bb072e42db5 +45361ab9744ccac3419d97fe8951838f14bd28220e3f7f747b39e46cfc3b5a1d From d4c735d491bc934696449c13f6ca700622eddbbd Mon Sep 17 00:00:00 2001 From: stephan Date: Sat, 28 Sep 2024 11:23:09 +0000 Subject: [PATCH 11/34] Ensure that the temporary build dir is mkdir'd by wasm deps which depend on it. FossilOrigin-Name: cabdf9797281090ab3f95c9f4c2a79878d1c64d1f2a09e433e2309abe5e19e59 --- ext/wasm/GNUmakefile | 16 ++++++++++------ ext/wasm/fiddle.make | 3 ++- manifest | 14 +++++++------- manifest.uuid | 2 +- 4 files changed, 20 insertions(+), 15 deletions(-) diff --git a/ext/wasm/GNUmakefile b/ext/wasm/GNUmakefile index 9c0322ea8b..4219d4317f 100644 --- a/ext/wasm/GNUmakefile +++ b/ext/wasm/GNUmakefile @@ -105,6 +105,10 @@ dir.dout := $(dir.wasm)/jswasm dir.tmp := $(dir.wasm)/bld dir.wasmfs := $(dir.dout) +MKDIR.bld := $(dir.tmp) +$(MKDIR.bld): + -mkdir $@ + CLEAN_FILES += *~ $(dir.jacc)/*~ $(dir.api)/*~ $(dir.common)/*~ $(dir.fiddle)/*~ \ $(dir.fiddle-debug)/* $(dir.dout)/* $(dir.tmp)/* @@ -502,7 +506,7 @@ ifeq (0,$(wasm-bare-bones)) EXPORTED_FUNCTIONS.api.in += $(dir.api)/EXPORTED_FUNCTIONS.sqlite3-extras endif EXPORTED_FUNCTIONS.api := $(dir.tmp)/EXPORTED_FUNCTIONS.api -$(EXPORTED_FUNCTIONS.api): $(EXPORTED_FUNCTIONS.api.in) $(sqlite3.c) $(MAKEFILE) +$(EXPORTED_FUNCTIONS.api): $(MKDIR.bld) $(EXPORTED_FUNCTIONS.api.in) $(sqlite3.c) $(MAKEFILE) cat $(EXPORTED_FUNCTIONS.api.in) > $@ ######################################################################## @@ -586,7 +590,7 @@ $(SOAP.js.bld): $(SOAP.js) # preprocessed. It contains all of $(sqlite3-api.jses) but none of the # Emscripten-specific headers and footers. sqlite3-api.js.in := $(dir.tmp)/sqlite3-api.c-pp.js -$(sqlite3-api.js.in): $(sqlite3-api.jses) $(MAKEFILE) +$(sqlite3-api.js.in): $(MKDIR.bld) $(sqlite3-api.jses) $(MAKEFILE) @echo "Making $@..." @for i in $(sqlite3-api.jses); do \ echo "/* BEGIN FILE: $$i */"; \ @@ -753,7 +757,7 @@ emcc.jsflags += -sLLD_REPORT_UNDEFINED ######################################################################## # $(sqlite3-api-build-version.js) injects the build version info into # the bundle in JSON form. -$(sqlite3-api-build-version.js): $(bin.version-info) $(MAKEFILE) +$(sqlite3-api-build-version.js): $(MKDIR.bld) $(bin.version-info) $(MAKEFILE) @echo "Making $@..." @{ \ echo 'globalThis.sqlite3ApiBootstrap.initializers.push(function(sqlite3){'; \ @@ -769,7 +773,7 @@ $(sqlite3-api-build-version.js): $(bin.version-info) $(MAKEFILE) # # Maintenance reminder: there are awk binaries out there which do not # support -e SCRIPT. -$(sqlite3-license-version.js): $(sqlite3.h) $(sqlite3-license-version-header.js) \ +$(sqlite3-license-version.js): $(MKDIR.bld) $(sqlite3.h) $(sqlite3-license-version-header.js) \ $(MAKEFILE) @echo "Making $@..."; { \ cat $(sqlite3-license-version-header.js); \ @@ -797,7 +801,7 @@ post-jses.js := \ $(dir.api)/post-js-header.js \ $(sqlite3-api.js.in) \ $(dir.api)/post-js-footer.js -$(post-js.js.in): $(post-jses.js) $(MAKEFILE) +$(post-js.js.in): $(MKDIR.bld) $(post-jses.js) $(MAKEFILE) @echo "Making $@..." @for i in $(post-jses.js); do \ echo "/* BEGIN FILE: $$i */"; \ @@ -1025,7 +1029,7 @@ speedtest1.exit-runtime1 := -sEXIT_RUNTIME=1 # -sEXIT_RUNTIME=1 but we need EXIT_RUNTIME=0 for the worker-based app # which runs speedtest1 multiple times. -$(EXPORTED_FUNCTIONS.speedtest1): $(EXPORTED_FUNCTIONS.api.core) +$(EXPORTED_FUNCTIONS.speedtest1): $(MKDIR.bld) $(EXPORTED_FUNCTIONS.api.core) @echo "Making $@ ..." @{ echo _wasm_main; cat $(EXPORTED_FUNCTIONS.api.core); } > $@ speedtest1.js := $(dir.dout)/speedtest1.js diff --git a/ext/wasm/fiddle.make b/ext/wasm/fiddle.make index d0e811cac8..a7e9be68cc 100644 --- a/ext/wasm/fiddle.make +++ b/ext/wasm/fiddle.make @@ -59,7 +59,8 @@ fiddle.EXPORTED_FUNCTIONS.in := \ $(dir.api)/EXPORTED_FUNCTIONS.sqlite3-core \ $(dir.api)/EXPORTED_FUNCTIONS.sqlite3-extras -$(EXPORTED_FUNCTIONS.fiddle): $(fiddle.EXPORTED_FUNCTIONS.in) $(MAKEFILE.fiddle) +$(EXPORTED_FUNCTIONS.fiddle): $(MKDIR.bld) $(fiddle.EXPORTED_FUNCTIONS.in) \ + $(MAKEFILE.fiddle) sort -u $(fiddle.EXPORTED_FUNCTIONS.in) > $@ fiddle.cses := $(dir.top)/shell.c $(sqlite3-wasm.c) diff --git a/manifest b/manifest index ccedf55294..6f19450d0e 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C For\swasm\sbuilds:\sautomatically\suse\shigher\soptimization\s(but\sslower\sbuild)\slevels\swhen\sa\starget\srelated\sto\sdeliverables\s(as\sopposed\sto\sdev\smode)\sis\sexplicitly\sinvoked. -D 2024-09-28T11:03:00.874 +C Ensure\sthat\sthe\stemporary\sbuild\sdir\sis\smkdir'd\sby\swasm\sdeps\swhich\sdepend\son\sit. +D 2024-09-28T11:23:09.335 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 @@ -603,7 +603,7 @@ F ext/userauth/sqlite3userauth.h 7f3ea8c4686db8e40b0a0e7a8e0b00fac13aa7a3 F ext/userauth/user-auth.txt ca7e9ee82ca4e1c1744295f8184dd70edfae1992865d26c64303f539eb6c084c F ext/userauth/userauth.c 7f00cded7dcaa5d47f54539b290a43d2e59f4b1eb5f447545fa865f002fc80cb F ext/wasm/EXPORTED_FUNCTIONS.fiddle.in 27450c8b8c70875a260aca55435ec927068b34cef801a96205adb81bdcefc65c -F ext/wasm/GNUmakefile e9ec8800b8f403e43c905e931beb1c4f921eaf7008932aaab749047fb5f0f14f +F ext/wasm/GNUmakefile abd9c2a5a05dec3a39eea86bee1c05b95c418ac6d92acdd740c1297419148b0b F ext/wasm/README-dist.txt 6382cb9548076fca472fb3330bbdba3a55c1ea0b180ff9253f084f07ff383576 F ext/wasm/README.md a8a2962c3aebdf8d2104a9102e336c5554e78fc6072746e5daf9c61514e7d193 F ext/wasm/SQLTester/GNUmakefile e0794f676d55819951bbfae45cc5e8d7818dc460492dc317ce7f0d2eca15caff @@ -655,7 +655,7 @@ F ext/wasm/demo-worker1.html 2c178c1890a2beb5a5fecb1453e796d067a4b8d3d2a04d65ca2 F ext/wasm/demo-worker1.js 836bece8615b17b1b572584f7b15912236a5947fe8c68b98d2737d7e287447ef F ext/wasm/dist.make 653e212c1e84aa3be168d62a10616ccea45ee9585b0192745d2706707a5248ce F ext/wasm/example_extra_init.c 2347cd69d19d839ef4e5e77b7855103a7fe3ef2af86f2e8c95839afd8b05862f -F ext/wasm/fiddle.make fecd12fc78f5ae3fba5387fee59f83a2bfb012c073e2d956151a8957bfff4731 +F ext/wasm/fiddle.make 4a350d7e79875c03b8326ee0fc198443555e79fa1dbf56ccd75d6cd871b44c42 F ext/wasm/fiddle/fiddle-worker.js 850e66fce39b89d59e161d1abac43a181a4caa89ddeea162765d660277cd84ce F ext/wasm/fiddle/fiddle.js b444a5646a9aac9f3fc06c53d78af5e1912eb235d69a8e6010723e4eb0e9d4a1 F ext/wasm/fiddle/index.html c79b1741cbeba78f88af0a84cf5ec7de87a909a6a8d10a369b1f4824c66c2088 @@ -2213,8 +2213,8 @@ F vsixtest/vsixtest.tcl 6195aba1f12a5e10efc2b8c0009532167be5e301abe5b31385638080 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P b3ad58e1fc73941f2d32bab0e0fac0b95849ae69f84788a431e65bb072e42db5 -R 31eec55429d58e8299eead65de81d192 +P 45361ab9744ccac3419d97fe8951838f14bd28220e3f7f747b39e46cfc3b5a1d +R 3ace6beda7c5f348d7740cd089b772f4 U stephan -Z baebfcdbf257af1c75327d449926f47d +Z 1e4b46fc68a5c48e2ab34715ed6387ce # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 81251ec111..1c6eacf9c6 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -45361ab9744ccac3419d97fe8951838f14bd28220e3f7f747b39e46cfc3b5a1d +cabdf9797281090ab3f95c9f4c2a79878d1c64d1f2a09e433e2309abe5e19e59 From 6a8336987a5b8be924ee174f472d1fe1f6b67de2 Mon Sep 17 00:00:00 2001 From: stephan Date: Sat, 28 Sep 2024 12:01:10 +0000 Subject: [PATCH 12/34] wasm: move the makefile-eval-generated fiddle rules into mkwasmbuilds.c. Squelch some warnings from grep when running 'make clean' on a clean tree. FossilOrigin-Name: 0485d1360b0dbf9987d16ab1df47b6b7a25595881581799f87889f6d4eeb60f4 --- ext/wasm/GNUmakefile | 3 ++ ext/wasm/fiddle.make | 65 +++++++++++------------------------------ ext/wasm/mkwasmbuilds.c | 50 ++++++++++++++++++++++++++++++- manifest | 16 +++++----- manifest.uuid | 2 +- 5 files changed, 78 insertions(+), 58 deletions(-) diff --git a/ext/wasm/GNUmakefile b/ext/wasm/GNUmakefile index 4219d4317f..3fd83e9724 100644 --- a/ext/wasm/GNUmakefile +++ b/ext/wasm/GNUmakefile @@ -133,12 +133,14 @@ sqlite3.canonical.c := $(dir.top)/sqlite3.c sqlite3.c ?= $(firstword $(wildcard $(dir.top)/sqlite3-see.c) $(sqlite3.canonical.c)) sqlite3.h := $(dir.top)/sqlite3.h +ifneq (1,$(MAKING_CLEAN)) ifeq (,$(shell grep sqlite3_activate_see $(sqlite3.c))) SQLITE_C_IS_SEE := 0 else SQLITE_C_IS_SEE := 1 $(info This is an SEE build) endif +endif ########################################################################@ # It's important that sqlite3.h be built to completion before any @@ -871,6 +873,7 @@ sqlite3-api-node.mjs := $(dir.dout)/sqlite3-api-node.mjs sqlite3-node.mjs := $(dir.dout)/sqlite3-node.mjs sqlite3-api-wasmfs.mjs := $(dir.tmp)/sqlite3-api-wasmfs.mjs sqlite3-wasmfs.mjs := $(dir.wasmfs)/sqlite3-wasmfs.mjs +EXPORTED_FUNCTIONS.fiddle := $(dir.tmp)/EXPORTED_FUNCTIONS.fiddle ifneq (1,$(MAKING_CLEAN)) .wasmbuilds.make: $(bin.mkwb) @rm -f $@ diff --git a/ext/wasm/fiddle.make b/ext/wasm/fiddle.make index a7e9be68cc..df5c7ab7b7 100644 --- a/ext/wasm/fiddle.make +++ b/ext/wasm/fiddle.make @@ -7,21 +7,23 @@ MAKEFILE.fiddle := $(lastword $(MAKEFILE_LIST)) ######################################################################## # shell.c and its build flags... -make-np-0 := make -C $(dir.top) -n -p -make-np-1 := sed -e 's/(TOP)/(dir.top)/g' -# Extract SHELL_OPT and SHELL_DEP from the top-most makefile and import -# them as vars here... -$(eval $(shell $(make-np-0) | grep -e '^SHELL_OPT ' | $(make-np-1))) -$(eval $(shell $(make-np-0) | grep -e '^SHELL_DEP ' | $(make-np-1))) -# ^^^ can't do that in 1 invocation b/c newlines get stripped -ifeq (,$(SHELL_OPT)) -$(error Could not parse SHELL_OPT from $(dir.top)/Makefile.) -endif -ifeq (,$(SHELL_DEP)) -$(error Could not parse SHELL_DEP from $(dir.top)/Makefile.) -endif +ifneq (1,$(MAKING_CLEAN)) + make-np-0 := make -C $(dir.top) -n -p + make-np-1 := sed -e 's/(TOP)/(dir.top)/g' + # Extract SHELL_OPT and SHELL_DEP from the top-most makefile and import + # them as vars here... + $(eval $(shell $(make-np-0) | grep -e '^SHELL_OPT ' | $(make-np-1))) + $(eval $(shell $(make-np-0) | grep -e '^SHELL_DEP ' | $(make-np-1))) + # ^^^ can't do that in 1 invocation b/c newlines get stripped + ifeq (,$(SHELL_OPT)) + $(error Could not parse SHELL_OPT from $(dir.top)/Makefile.) + endif + ifeq (,$(SHELL_DEP)) + $(error Could not parse SHELL_DEP from $(dir.top)/Makefile.) + endif $(dir.top)/shell.c: $(SHELL_DEP) $(dir.tool)/mkshellc.tcl $(sqlite3.c) $(MAKE) -C $(dir.top) shell.c +endif # /shell.c ######################################################################## @@ -65,46 +67,13 @@ $(EXPORTED_FUNCTIONS.fiddle): $(MKDIR.bld) $(fiddle.EXPORTED_FUNCTIONS.in) \ fiddle.cses := $(dir.top)/shell.c $(sqlite3-wasm.c) -######################################################################## -# emit rules for one of the two fiddle builds. $1 must be -# either $(dir.fiddle) or $(dir.fiddle-debug). $2 must be empty -# in the former case and .debug in the latter. -# -# TODO: move this into mkwasmbuilds.c. -define make-fiddle-rules -fiddle-module.js$(2) := $(1)/fiddle-module.js -fiddle-module.wasm$(2) := $$(subst .js,.wasm,$$(fiddle-module.js$(2))) -$$(fiddle-module.js$(2)): $$(MAKEFILE) $$(MAKEFILE.fiddle) \ - $$(EXPORTED_FUNCTIONS.fiddle) \ - $$(fiddle.cses) $$(pre-post-fiddle-module-vanilla.deps) $$(SOAP.js) - @test -d "$$(dir $$@)" || mkdir -p "$$(dir $$@)" - $$(emcc.bin) -o $$@ $$(fiddle.emcc-flags$(2)) \ - $$(pre-post-fiddle-module-vanilla.flags) \ - $$(fiddle.cses) - $$(maybe-wasm-strip) $$(fiddle-module.wasm$(2)) - @cp -p $$(SOAP.js) $$(dir $$@) - @if [[ x.debug = x$(2) ]]; then \ - cp -p $$(dir.fiddle)/index.html \ - $$(dir.fiddle)/fiddle.js \ - $$(dir.fiddle)/fiddle-worker.js \ - $$(dir $$@)/.; \ - fi - @for i in $(1)/*.*js $(1)/*.html $(1)/*.wasm; do \ - test -f $$$${i} || continue; \ - gzip < $$$${i} > $$$${i}.gz; \ - done -fiddle$(2): $$(fiddle-module.js$(2)) $(1)/fiddle.js.gz -endef - -$(eval $(call make-fiddle-rules,$(dir.fiddle))) -$(eval $(call make-fiddle-rules,$(dir.fiddle-debug),.debug)) fiddle: $(fiddle-module.js) $(fiddle-module.js.debug) fiddle.debug: $(fiddle-module.js.debug) clean: clean-fiddle clean-fiddle: - rm -f $(fiddle-module.js) \ - $(fiddle-module.wasm) \ + rm -f $(dir.fiddle)/fiddle-module.js \ + $(dir.fiddle)/*.wasm \ $(dir.fiddle)/sqlite3-opfs-*.js \ $(dir.fiddle)/*.gz \ EXPORTED_FUNCTIONS.fiddle diff --git a/ext/wasm/mkwasmbuilds.c b/ext/wasm/mkwasmbuilds.c index a455f3945a..29b6cafae9 100644 --- a/ext/wasm/mkwasmbuilds.c +++ b/ext/wasm/mkwasmbuilds.c @@ -133,6 +133,54 @@ static void mk_pre_post(const char *zName /* build name */, pf("# End --pre/--post flags for %s-%s%s", zName, zMode, zBanner); } +/* +** Emits rules for the fiddle builds. +** +*/ +static void mk_fiddle(){ + int i = 0; + + mk_pre_post("fiddle-module","vanilla", 0); + for( ; i < 2; ++i ){ + const char *zTail = i ? ".debug" : ""; + const char *zDir = i ? "$(dir.fiddle-debug)" : "$(dir.fiddle)"; + + pf("%s# Begin fiddle%s\n", zBanner, zTail); + pf("fiddle-module.js%s := %s/fiddle-module.js\n", zTail, zDir); + pf("fiddle-module.wasm%s := " + "$(subst .js,.wasm,$(fiddle-module.js%s))\n", zTail, zTail); + pf("$(fiddle-module.js%s):%s $(MAKEFILE) $(MAKEFILE.fiddle) " + "$(EXPORTED_FUNCTIONS.fiddle) " + "$(fiddle.cses) $(pre-post-fiddle-module-vanilla.deps) " + "$(SOAP.js)\n", + zTail, (i ? " $(fiddle-module.js)" : "")); + if( 1==i ){/*fiddle.debug*/ + pf(" @test -d \"$(dir $@)\" || mkdir -p \"$(dir $@)\"\n"); + } + pf(" $(emcc.bin) -o $@ $(fiddle.emcc-flags%s) " + "$(pre-post-fiddle-module-vanilla.flags) $(fiddle.cses)\n", + zTail); + pf(" $(maybe-wasm-strip) $(fiddle-module.wasm%s)\n", zTail); + pf(" @cp -p $(SOAP.js) $(dir $@)\n"); + if( 1==i ){/*fiddle.debug*/ + pf(" cp -p $(dir.fiddle)/index.html " + "$(dir.fiddle)/fiddle.js " + "$(dir.fiddle)/fiddle-worker.js " + "$(dir $@)\n"); + } + pf(" @for i in %s/*.*js %s/*.html %s/*.wasm; do \\\n" + " test -f $${i} || continue; \\\n" + " gzip < $${i} > $${i}.gz; \\\n" + " done\n", zDir, zDir, zDir); + if( 0==i ){ + ps("fiddle: $(fiddle-module.js)"); + }else{ + ps("fiddle-debug: $(fiddle-module-debug.js)"); + } + pf("# End fiddle%s%s", zTail, zBanner); + } +} + /* ** Emits makefile code for one build of the library, primarily defined ** by the combination of zName and zMode, each of which must be values @@ -229,7 +277,7 @@ int main(void){ "$(c-pp.D.sqlite3-bundler-friendly) -Dwasmfs", "-sEXPORT_ES6 -sUSE_ES6_IMPORT_META"); - mk_pre_post("fiddle-module","vanilla", 0); + mk_fiddle(); mk_pre_post("speedtest1","vanilla", 0); mk_pre_post("speedtest1-wasmfs","esm", "$(c-pp.D.sqlite3-bundler-friendly) -Dwasmfs"); return rc; diff --git a/manifest b/manifest index 6f19450d0e..1cbfd1fb3b 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Ensure\sthat\sthe\stemporary\sbuild\sdir\sis\smkdir'd\sby\swasm\sdeps\swhich\sdepend\son\sit. -D 2024-09-28T11:23:09.335 +C wasm:\smove\sthe\smakefile-eval-generated\sfiddle\srules\sinto\smkwasmbuilds.c.\sSquelch\ssome\swarnings\sfrom\sgrep\swhen\srunning\s'make\sclean'\son\sa\sclean\stree. +D 2024-09-28T12:01:10.696 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 @@ -603,7 +603,7 @@ F ext/userauth/sqlite3userauth.h 7f3ea8c4686db8e40b0a0e7a8e0b00fac13aa7a3 F ext/userauth/user-auth.txt ca7e9ee82ca4e1c1744295f8184dd70edfae1992865d26c64303f539eb6c084c F ext/userauth/userauth.c 7f00cded7dcaa5d47f54539b290a43d2e59f4b1eb5f447545fa865f002fc80cb F ext/wasm/EXPORTED_FUNCTIONS.fiddle.in 27450c8b8c70875a260aca55435ec927068b34cef801a96205adb81bdcefc65c -F ext/wasm/GNUmakefile abd9c2a5a05dec3a39eea86bee1c05b95c418ac6d92acdd740c1297419148b0b +F ext/wasm/GNUmakefile e87c055bb0aa12bf4540b5d12e533608cb70cb2da1b8659d10b1fce03e08240c F ext/wasm/README-dist.txt 6382cb9548076fca472fb3330bbdba3a55c1ea0b180ff9253f084f07ff383576 F ext/wasm/README.md a8a2962c3aebdf8d2104a9102e336c5554e78fc6072746e5daf9c61514e7d193 F ext/wasm/SQLTester/GNUmakefile e0794f676d55819951bbfae45cc5e8d7818dc460492dc317ce7f0d2eca15caff @@ -655,7 +655,7 @@ F ext/wasm/demo-worker1.html 2c178c1890a2beb5a5fecb1453e796d067a4b8d3d2a04d65ca2 F ext/wasm/demo-worker1.js 836bece8615b17b1b572584f7b15912236a5947fe8c68b98d2737d7e287447ef F ext/wasm/dist.make 653e212c1e84aa3be168d62a10616ccea45ee9585b0192745d2706707a5248ce F ext/wasm/example_extra_init.c 2347cd69d19d839ef4e5e77b7855103a7fe3ef2af86f2e8c95839afd8b05862f -F ext/wasm/fiddle.make 4a350d7e79875c03b8326ee0fc198443555e79fa1dbf56ccd75d6cd871b44c42 +F ext/wasm/fiddle.make ec2353f0eddade864f67b993376a0949e27b72465c24b1970940e48b70bc2df1 F ext/wasm/fiddle/fiddle-worker.js 850e66fce39b89d59e161d1abac43a181a4caa89ddeea162765d660277cd84ce F ext/wasm/fiddle/fiddle.js b444a5646a9aac9f3fc06c53d78af5e1912eb235d69a8e6010723e4eb0e9d4a1 F ext/wasm/fiddle/index.html c79b1741cbeba78f88af0a84cf5ec7de87a909a6a8d10a369b1f4824c66c2088 @@ -663,7 +663,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 e58bad0558f6b8359e6ebb9262a0bf30dfd1db9715ec8a0de9f1e74433944b57 +F ext/wasm/mkwasmbuilds.c e3580b26bc393e4e4beb25f6349b999878782f3319b740469f64c2e772632e03 F ext/wasm/module-symbols.html dc476b403369b26a1a23773e13b80f41b9a49f0825e81435fe3600a7cfbbe337 F ext/wasm/scratchpad-wasmfs.html a3d7388f3c4b263676b58b526846e9d02dfcb4014ff29d3a5040935286af5b96 F ext/wasm/scratchpad-wasmfs.mjs 66034b9256b218de59248aad796760a1584c1dd842231505895eff00dbd57c63 @@ -2213,8 +2213,8 @@ F vsixtest/vsixtest.tcl 6195aba1f12a5e10efc2b8c0009532167be5e301abe5b31385638080 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P 45361ab9744ccac3419d97fe8951838f14bd28220e3f7f747b39e46cfc3b5a1d -R 3ace6beda7c5f348d7740cd089b772f4 +P cabdf9797281090ab3f95c9f4c2a79878d1c64d1f2a09e433e2309abe5e19e59 +R 0187fe6fd0750839e1c4d66882bc06e3 U stephan -Z 1e4b46fc68a5c48e2ab34715ed6387ce +Z 5f0ec8eab9d280a80b50e2d7a52a98d8 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 1c6eacf9c6..698c46feb2 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -cabdf9797281090ab3f95c9f4c2a79878d1c64d1f2a09e433e2309abe5e19e59 +0485d1360b0dbf9987d16ab1df47b6b7a25595881581799f87889f6d4eeb60f4 From 5ec9ed7fe954b4ffa63588fd6d0386832a10fb16 Mon Sep 17 00:00:00 2001 From: stephan Date: Sat, 28 Sep 2024 13:51:47 +0000 Subject: [PATCH 13/34] Complete a line of documentation which was interrupted mid-sentence. FossilOrigin-Name: c9cbbeda3d1ec4215396aaaf94428b829c4f53329431fa61251914c195f8a9a1 --- ext/wasm/GNUmakefile | 7 +++++-- manifest | 12 ++++++------ manifest.uuid | 2 +- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/ext/wasm/GNUmakefile b/ext/wasm/GNUmakefile index 3fd83e9724..e761408e34 100644 --- a/ext/wasm/GNUmakefile +++ b/ext/wasm/GNUmakefile @@ -458,8 +458,11 @@ emcc.WASM_BIGINT ?= 1 # the various oX targets. build times for -O levels higher than 0 are # painful at dev-time. # -# When running any of the $(OPTIMIZED_TARGETS) explicitly, e.g. for -# a release distribution +# When running any of the $(OPTIMIZED_TARGETS) explicitly, e.g. for a +# release distribution, use a higher optimization level. Experience +# has shown -Oz to produce the smallest deliverables with only a +# roughly 10% performance hit in the resulting WASM file compared to +# -O2 (which consistently creates the fastest-running deliverables). ifeq (,$(filter $(OPTIMIZED_TARGETS),$(MAKECMDGOALS))) emcc_opt ?= -O0 else diff --git a/manifest b/manifest index 1cbfd1fb3b..d71c7d09df 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C wasm:\smove\sthe\smakefile-eval-generated\sfiddle\srules\sinto\smkwasmbuilds.c.\sSquelch\ssome\swarnings\sfrom\sgrep\swhen\srunning\s'make\sclean'\son\sa\sclean\stree. -D 2024-09-28T12:01:10.696 +C Complete\sa\sline\sof\sdocumentation\swhich\swas\sinterrupted\smid-sentence. +D 2024-09-28T13:51:47.537 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 @@ -603,7 +603,7 @@ F ext/userauth/sqlite3userauth.h 7f3ea8c4686db8e40b0a0e7a8e0b00fac13aa7a3 F ext/userauth/user-auth.txt ca7e9ee82ca4e1c1744295f8184dd70edfae1992865d26c64303f539eb6c084c F ext/userauth/userauth.c 7f00cded7dcaa5d47f54539b290a43d2e59f4b1eb5f447545fa865f002fc80cb F ext/wasm/EXPORTED_FUNCTIONS.fiddle.in 27450c8b8c70875a260aca55435ec927068b34cef801a96205adb81bdcefc65c -F ext/wasm/GNUmakefile e87c055bb0aa12bf4540b5d12e533608cb70cb2da1b8659d10b1fce03e08240c +F ext/wasm/GNUmakefile fbafd2e9514bdf579d2549603e62fab202037315f16402f7e3b9ad227af86ff5 F ext/wasm/README-dist.txt 6382cb9548076fca472fb3330bbdba3a55c1ea0b180ff9253f084f07ff383576 F ext/wasm/README.md a8a2962c3aebdf8d2104a9102e336c5554e78fc6072746e5daf9c61514e7d193 F ext/wasm/SQLTester/GNUmakefile e0794f676d55819951bbfae45cc5e8d7818dc460492dc317ce7f0d2eca15caff @@ -2213,8 +2213,8 @@ F vsixtest/vsixtest.tcl 6195aba1f12a5e10efc2b8c0009532167be5e301abe5b31385638080 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P cabdf9797281090ab3f95c9f4c2a79878d1c64d1f2a09e433e2309abe5e19e59 -R 0187fe6fd0750839e1c4d66882bc06e3 +P 0485d1360b0dbf9987d16ab1df47b6b7a25595881581799f87889f6d4eeb60f4 +R 4fb55576459952034688327ee6ecebbe U stephan -Z 5f0ec8eab9d280a80b50e2d7a52a98d8 +Z 99f2ab951b6d8ffe813ecc8ee717f06d # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 698c46feb2..3526ac9557 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -0485d1360b0dbf9987d16ab1df47b6b7a25595881581799f87889f6d4eeb60f4 +c9cbbeda3d1ec4215396aaaf94428b829c4f53329431fa61251914c195f8a9a1 From 54e35b543df1c19be47e868e27e46bb312d706c2 Mon Sep 17 00:00:00 2001 From: dan Date: Sat, 28 Sep 2024 15:09:43 +0000 Subject: [PATCH 14/34] Add tests for DELETE on contentless, contentless-delete and contentless-unindexed fts5 tables. FossilOrigin-Name: 74832fffb61d5e09ff256622cc9aa1fd2c40d30324c410bd6a8c688f0506a536 --- ext/fts5/test/fts5delete.test | 52 ++++++++++++++++++++++++++++++++++ ext/fts5/test/fts5update2.test | 16 ++++++----- manifest | 14 ++++----- manifest.uuid | 2 +- 4 files changed, 69 insertions(+), 15 deletions(-) diff --git a/ext/fts5/test/fts5delete.test b/ext/fts5/test/fts5delete.test index 1214fec4f4..c9c55e8a4f 100644 --- a/ext/fts5/test/fts5delete.test +++ b/ext/fts5/test/fts5delete.test @@ -113,5 +113,57 @@ do_execsql_test 3.4 { INSERT INTO tx(tx) VALUES('integrity-check'); } +#------------------------------------------------------------------------- +reset_db +do_execsql_test 4.0 { + CREATE VIRTUAL TABLE ft1 USING fts5(a, b UNINDEXED, + content='', contentless_unindexed=1 + ); + CREATE VIRTUAL TABLE ft2 USING fts5(a, b UNINDEXED, + content='', contentless_unindexed=1, contentless_delete=1 + ); + + INSERT INTO ft1(rowid, a, b) VALUES(1, 'one', 'i'); + INSERT INTO ft1(rowid, a, b) VALUES(2, 'two', 'ii'); + INSERT INTO ft1(rowid, a, b) VALUES(3, 'three', 'iii'); + INSERT INTO ft2(rowid, a, b) VALUES(1, 'one', 'i'); + INSERT INTO ft2(rowid, a, b) VALUES(2, 'two', 'ii'); + INSERT INTO ft2(rowid, a, b) VALUES(3, 'three', 'iii'); +} + +do_catchsql_test 4.1 { + DELETE FROM ft1 WHERE rowid=2 +} {1 {cannot DELETE from contentless fts5 table: ft1}} +do_catchsql_test 4.2 { + DELETE FROM ft2 WHERE rowid=2 +} {0 {}} + +do_catchsql_test 4.3 { + INSERT INTO ft1(ft1, rowid, a) VALUES('delete', 2, 'two'); +} {0 {}} +do_catchsql_test 4.2 { + INSERT INTO ft2(ft2, rowid, a) VALUES('delete', 2, 'two'); +} {1 {'delete' may not be used with a contentless_delete=1 table}} + +do_execsql_test 4.3 { + SELECT rowid, * FROM ft1; +} { + 1 {} i + 3 {} iii +} +do_execsql_test 4.4 { + SELECT rowid, * FROM ft2; +} { + 1 {} i + 3 {} iii +} + +do_execsql_test 4.5 { + SELECT * FROM ft1_content +} {1 i 3 iii} +do_execsql_test 4.6 { + SELECT * FROM ft1_content +} {1 i 3 iii} + finish_test diff --git a/ext/fts5/test/fts5update2.test b/ext/fts5/test/fts5update2.test index 9e5e6c81db..d04af4800d 100644 --- a/ext/fts5/test/fts5update2.test +++ b/ext/fts5/test/fts5update2.test @@ -26,6 +26,7 @@ ifcapable !fts5 { # Test that the various types of UPDATE statement are handled correctly # by different table types. # +foreach_detail_mode $testprefix { foreach {tn cu} { 1 0 2 1 @@ -34,11 +35,13 @@ foreach {tn cu} { do_execsql_test 1.$tn.1 " CREATE VIRTUAL TABLE ft1 USING fts5(a, b UNINDEXED, c UNINDEXED, d, content='', - contentless_unindexed=$cu + contentless_unindexed=$cu, + detail=%DETAIL% ); CREATE VIRTUAL TABLE ft2 USING fts5(a, b UNINDEXED, c UNINDEXED, d, content='', - contentless_unindexed=$cu, contentless_delete=1 + contentless_unindexed=$cu, contentless_delete=1, + detail=%DETAIL% ); " @@ -121,7 +124,7 @@ foreach {tn cu} { # It should be possible to update the rowid if contentless_delete=1 is # set and all indexed columns are updated. do_execsql_test 1.$tn.15 { - UPDATE ft2 SET a='a_one', d='d_one', rowid=11 WHERE rowid=1 + UPDATE ft2 SET a='aXone', d='dXone', rowid=11 WHERE rowid=1 } set res(0) { @@ -148,7 +151,7 @@ foreach {tn cu} { } {1 {cannot UPDATE contentless fts5 table: ft1}} do_execsql_test 1.$tn.19 { - UPDATE ft2 SET a='a_two', d='d_two', c='newval', rowid=12 WHERE rowid=2 + UPDATE ft2 SET a='aXtwo', d='dXtwo', c='newval', rowid=12 WHERE rowid=2 } {} set res(0) { @@ -166,10 +169,9 @@ foreach {tn cu} { } $res($cu) do_execsql_test 1.$tn.21 { - SELECT rowid, * FROM ft2('a_two AND d_two') + SELECT rowid, * FROM ft2('aXtwo AND dXtwo') } [lrange $res($cu) 10 end] - -} +}} ;# end of [foreach_detail_mode] loop finish_test diff --git a/manifest b/manifest index 11bbbe30ca..015a187a8e 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Extra\stest\scases\sfor\sUPDATEs\sof\scontentless\stables. -D 2024-09-27T19:21:09.689 +C Add\stests\sfor\sDELETE\son\scontentless,\scontentless-delete\sand\scontentless-unindexed\sfts5\stables. +D 2024-09-28T15:09:43.754 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 @@ -154,7 +154,7 @@ F ext/fts5/test/fts5corrupt5.test 11b47126f5772cc37b67e3e8b2ed05895c4d07c05338bc F ext/fts5/test/fts5corrupt6.test 2d72db743db7b5d9c9a6d0cfef24d799ed1aa5e8192b66c40e871a37ed9eed06 F ext/fts5/test/fts5corrupt7.test 4e830875c33b9ea3c4cf1ba71e692b63893cbb4faae8c69b1071889dc26e211c F ext/fts5/test/fts5corrupt8.test b81d802e41631e98100f49a1aadeeffef860e30a62d6ed7d743c2797c477239e -F ext/fts5/test/fts5delete.test 619295b20dbc1d840b403ee07c878f52378849c3c02e44f2ee143b3e978a0aa7 +F ext/fts5/test/fts5delete.test e5ad73ce7cda1201b15ead1170f0bc6a2402107b4c2b4e8c8d38c3c7a5140739 F ext/fts5/test/fts5detail.test 54015e9c43ec4ba542cfb93268abdf280e0300f350efd08ee411284b03595cc4 F ext/fts5/test/fts5determin.test 1b77879b2ae818b5b71c859e534ee334dac088b7cf3ff3bf76a2c82b1c788d11 F ext/fts5/test/fts5dlidx.test a7c42b0a74dc7c8aa1a46d586e0aadda4b6cc42c24450f8d3774b21166e93159 @@ -248,7 +248,7 @@ F ext/fts5/test/fts5unicode4.test 728c8f0caafb05567f524ad313d9f8b780fa45987b8a8d F ext/fts5/test/fts5unindexed.test 168838d2c385e131120bbf5b516d2432a5fabc4caa2259c932e1d49ae209a4ae F ext/fts5/test/fts5unindexed2.test 516236eceaac05ace322290a0d3705b4c4ffe4760d8eb9d014d9d27d56dfcc02 F ext/fts5/test/fts5update.test b8affd796e45c94a4d19ad5c26606ea06065a0f162a9562d9f005b5a80ccf0bc -F ext/fts5/test/fts5update2.test 1757efae987e6a5a8ac75e3d487fe7be0b8de6006c12f3789fa5d86ee1012706 +F ext/fts5/test/fts5update2.test c5baa76799ac605ebb8e5e21035db2014b396cef25c903eb96ba39b1d6f9f046 F ext/fts5/test/fts5version.test c22d163c17e60a99f022cbc52de5a48bb7f84deaa00fe15e9bc4c3aa1996204e F ext/fts5/test/fts5vocab.test 2a2bdb60d0998fa3124d541b6d30b019504918dc43a6584645b63a24be72f992 F ext/fts5/test/fts5vocab2.test bbba149c254375d00055930c1a501c9a51e80b0d20bf7b98f3e9fa3b03786373 @@ -2217,8 +2217,8 @@ F vsixtest/vsixtest.tcl 6195aba1f12a5e10efc2b8c0009532167be5e301abe5b31385638080 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P d69abca82145465c85241a12322986f22bf12ffe42f86c2c8e8e2f2a77d53bf8 -R 817da49217632f1ab83203ed5615b513 +P 4d11d844de3edd82f022c36381ca7f14a546a608293c329b91e7f041cec82ff5 +R 252b3e37ef138d75d16ca0a09145d26b U dan -Z b50e3f13244bcc732f70d03504469c39 +Z 1c5135e581d8308e18c2303d6757adc4 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index fb8124c66b..ca318965b4 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -4d11d844de3edd82f022c36381ca7f14a546a608293c329b91e7f041cec82ff5 +74832fffb61d5e09ff256622cc9aa1fd2c40d30324c410bd6a8c688f0506a536 From 33669ef289bfc69aac80b3fc58edbd62006de41f Mon Sep 17 00:00:00 2001 From: stephan Date: Sat, 28 Sep 2024 15:13:49 +0000 Subject: [PATCH 15/34] Add another missing mkdir to the wasm build process. FossilOrigin-Name: e815055b321085deda8607ac3279ef1a1c890fe3bf9d9b9c0a74028e87857a7d --- ext/wasm/GNUmakefile | 2 +- manifest | 12 ++++++------ manifest.uuid | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/ext/wasm/GNUmakefile b/ext/wasm/GNUmakefile index e761408e34..2602e6b792 100644 --- a/ext/wasm/GNUmakefile +++ b/ext/wasm/GNUmakefile @@ -107,7 +107,7 @@ dir.wasmfs := $(dir.dout) MKDIR.bld := $(dir.tmp) $(MKDIR.bld): - -mkdir $@ + -mkdir -p $@ $(dir.dout) CLEAN_FILES += *~ $(dir.jacc)/*~ $(dir.api)/*~ $(dir.common)/*~ $(dir.fiddle)/*~ \ $(dir.fiddle-debug)/* $(dir.dout)/* $(dir.tmp)/* diff --git a/manifest b/manifest index d71c7d09df..203e87db27 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Complete\sa\sline\sof\sdocumentation\swhich\swas\sinterrupted\smid-sentence. -D 2024-09-28T13:51:47.537 +C Add\sanother\smissing\smkdir\sto\sthe\swasm\sbuild\sprocess. +D 2024-09-28T15:13:49.994 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 @@ -603,7 +603,7 @@ F ext/userauth/sqlite3userauth.h 7f3ea8c4686db8e40b0a0e7a8e0b00fac13aa7a3 F ext/userauth/user-auth.txt ca7e9ee82ca4e1c1744295f8184dd70edfae1992865d26c64303f539eb6c084c F ext/userauth/userauth.c 7f00cded7dcaa5d47f54539b290a43d2e59f4b1eb5f447545fa865f002fc80cb F ext/wasm/EXPORTED_FUNCTIONS.fiddle.in 27450c8b8c70875a260aca55435ec927068b34cef801a96205adb81bdcefc65c -F ext/wasm/GNUmakefile fbafd2e9514bdf579d2549603e62fab202037315f16402f7e3b9ad227af86ff5 +F ext/wasm/GNUmakefile 6b94c3125c40932e71bbe46e582d24ed4c829b9fa2ff34dd842b0ed8a948ac6a F ext/wasm/README-dist.txt 6382cb9548076fca472fb3330bbdba3a55c1ea0b180ff9253f084f07ff383576 F ext/wasm/README.md a8a2962c3aebdf8d2104a9102e336c5554e78fc6072746e5daf9c61514e7d193 F ext/wasm/SQLTester/GNUmakefile e0794f676d55819951bbfae45cc5e8d7818dc460492dc317ce7f0d2eca15caff @@ -2213,8 +2213,8 @@ F vsixtest/vsixtest.tcl 6195aba1f12a5e10efc2b8c0009532167be5e301abe5b31385638080 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P 0485d1360b0dbf9987d16ab1df47b6b7a25595881581799f87889f6d4eeb60f4 -R 4fb55576459952034688327ee6ecebbe +P c9cbbeda3d1ec4215396aaaf94428b829c4f53329431fa61251914c195f8a9a1 +R 6a112f9240ce847c284940c2c71c0d81 U stephan -Z 99f2ab951b6d8ffe813ecc8ee717f06d +Z be8aef5e16db8f3b229b77cf96144050 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 3526ac9557..34bc5bb12b 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -c9cbbeda3d1ec4215396aaaf94428b829c4f53329431fa61251914c195f8a9a1 +e815055b321085deda8607ac3279ef1a1c890fe3bf9d9b9c0a74028e87857a7d From 54fd01c4ab06c511c55235de039a7955117fddf0 Mon Sep 17 00:00:00 2001 From: drh <> Date: Sat, 28 Sep 2024 19:52:38 +0000 Subject: [PATCH 16/34] Fix the CLI so that the --bom option only outputs a single BOM, not two. FossilOrigin-Name: 76b6331e6a705a420a64820a18214f07cf4c1d5151e7158d6fff09964e63f352 --- manifest | 14 +++++++------- manifest.uuid | 2 +- src/shell.c.in | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/manifest b/manifest index 203e87db27..7566dedc21 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Add\sanother\smissing\smkdir\sto\sthe\swasm\sbuild\sprocess. -D 2024-09-28T15:13:49.994 +C Fix\sthe\sCLI\sso\sthat\sthe\s--bom\soption\sonly\soutputs\sa\ssingle\sBOM,\snot\stwo. +D 2024-09-28T19:52:38.443 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 @@ -768,7 +768,7 @@ F src/random.c 606b00941a1d7dd09c381d3279a058d771f406c5213c9932bbd93d5587be4b9c F src/resolve.c 9750a281f7ba073b4e6da2be1a6c4071f5d841a7746c5fb3f70d6d793b6675ea F src/rowset.c 8432130e6c344b3401a8874c3cb49fefe6873fec593294de077afea2dce5ec97 F src/select.c 4b14337a2742f0c0beeba490e9a05507e9b4b12184b9cd12773501d08d48e3fe -F src/shell.c.in 857c60ed21ae2c58d7740d790e8b22e167136ad1930af50527ec0e584a8cc8aa +F src/shell.c.in 345173187067363374187176a8bbe779e359849e635d8288202000ee87f4405a F src/sqlite.h.in b20547021d20ba016c2fd0500f14f08a21ff23e64a0ed93e72ca0fecb9e1d0a0 F src/sqlite3.rc 5121c9e10c3964d5755191c80dd1180c122fc3a8 F src/sqlite3ext.h 3f046c04ea3595d6bfda99b781926b17e672fd6d27da2ba6d8d8fc39981dcb54 @@ -2213,8 +2213,8 @@ F vsixtest/vsixtest.tcl 6195aba1f12a5e10efc2b8c0009532167be5e301abe5b31385638080 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P c9cbbeda3d1ec4215396aaaf94428b829c4f53329431fa61251914c195f8a9a1 -R 6a112f9240ce847c284940c2c71c0d81 -U stephan -Z be8aef5e16db8f3b229b77cf96144050 +P e815055b321085deda8607ac3279ef1a1c890fe3bf9d9b9c0a74028e87857a7d +R c0b23dfcab02e83590bbedcac610fa7b +U drh +Z 5a1528ca859870969ffba6e26496a443 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 34bc5bb12b..f56b36fa0b 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -e815055b321085deda8607ac3279ef1a1c890fe3bf9d9b9c0a74028e87857a7d +76b6331e6a705a420a64820a18214f07cf4c1d5151e7158d6fff09964e63f352 diff --git a/src/shell.c.in b/src/shell.c.in index 56f63fb190..d1fc6aa748 100644 --- a/src/shell.c.in +++ b/src/shell.c.in @@ -9913,7 +9913,7 @@ static int do_meta_command(char *zLine, ShellState *p){ int eMode = 0; int bOnce = 0; /* 0: .output, 1: .once, 2: .excel/.www */ int bPlain = 0; /* --plain option */ - static const char *zBomUtf8 = "\xef\xbb\xbf"; + static const char *zBomUtf8 = "\357\273\277"; const char *zBom = 0; failIfSafeMode(p, "cannot run .%s in safe mode", azArg[0]); From d5838eaa42c103649fde3ee1806ff03f7ddece9d Mon Sep 17 00:00:00 2001 From: dan Date: Mon, 30 Sep 2024 17:28:45 +0000 Subject: [PATCH 17/34] In fts5, avoid starting a new merge of level L if there exists already an ongoing merge of a level less than L. FossilOrigin-Name: 350c6e75ce3c1e81458d1baa73045df489284206e8b279ab3c2f5e3d011c262a --- ext/fts5/fts5_index.c | 7 +++- ext/fts5/test/fts5contentless5.test | 56 +++++++++++++++++++++++++++-- manifest | 16 ++++----- manifest.uuid | 2 +- 4 files changed, 69 insertions(+), 12 deletions(-) diff --git a/ext/fts5/fts5_index.c b/ext/fts5/fts5_index.c index 4363305a56..a51ae19e72 100644 --- a/ext/fts5/fts5_index.c +++ b/ext/fts5/fts5_index.c @@ -4889,6 +4889,11 @@ static int fts5IndexFindDeleteMerge(Fts5Index *p, Fts5Structure *pStruct){ nBest = nPercent; } } + + /* If pLvl is already the input level to an ongoing merge, look no + ** further for a merge candidate. The caller should be allowed to + ** continue merging from pLvl first. */ + if( pLvl->nMerge ) break; } } return iRet; @@ -8813,7 +8818,7 @@ static int fts5structConnectMethod( /* ** We must have a single struct=? constraint that will be passed through -** into the xFilter method. If there is no valid stmt=? constraint, +** into the xFilter method. If there is no valid struct=? constraint, ** then return an SQLITE_CONSTRAINT error. */ static int fts5structBestIndexMethod( diff --git a/ext/fts5/test/fts5contentless5.test b/ext/fts5/test/fts5contentless5.test index 3563678868..86d0753286 100644 --- a/ext/fts5/test/fts5contentless5.test +++ b/ext/fts5/test/fts5contentless5.test @@ -35,8 +35,8 @@ do_execsql_test 1.01 { } # explain_i "UPDATE t1 SET a='a' WHERE t1.rowid=1" -breakpoint -explain_i "UPDATE t1 SET a='a' FROM t2 WHERE t1.rowid=1 AND b IS NULL" +#breakpoint +#explain_i "UPDATE t1 SET a='a' FROM t2 WHERE t1.rowid=1 AND b IS NULL" #breakpoint #explain_i "UPDATE t1 SET a='a' WHERE b IS NULL AND rowid=?" @@ -56,4 +56,56 @@ foreach {tn up err} { do_catchsql_test 1.$tn $up $res($err) } +#------------------------------------------------------------------------- +reset_db + +proc random {n} { expr {abs(int(rand()*$n))} } +proc select_one {list} { + set n [llength $list] + lindex $list [random $n] +} +proc vocab {} { + list abc def ghi jkl mno pqr stu vwx yza +} +proc term {} { + select_one [vocab] +} +proc document {} { + set nTerm [expr [random 3] + 7] + set doc "" + for {set ii 0} {$ii < $nTerm} {incr ii} { + lappend doc [term] + } + set doc +} +db func document document + +do_execsql_test 2.0 { + CREATE VIRTUAL TABLE ft USING fts5(a, contentless_delete=1, content=''); + INSERT INTO ft(ft, rank) VALUES('pgsz', 64); +} + +do_test 2.1 { + for {set ii 1} {$ii < 12} {incr ii} { + db transaction { + for {set jj 0} {$jj < 10} {incr jj} { + set doc [document] + execsql { INSERT INTO ft VALUES($doc); } + } + } + } +} {} + +do_test 2.2 { + foreach r [db eval {SELECT rowid FROM ft}] { + execsql { DELETE FROM ft WHERE rowid=$r } + } +} {} + +set doc [document] +do_execsql_test 2.3 { + INSERT INTO ft VALUES($doc) +} + + finish_test diff --git a/manifest b/manifest index 7566dedc21..77ea93c261 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Fix\sthe\sCLI\sso\sthat\sthe\s--bom\soption\sonly\soutputs\sa\ssingle\sBOM,\snot\stwo. -D 2024-09-28T19:52:38.443 +C In\sfts5,\savoid\sstarting\sa\snew\smerge\sof\slevel\sL\sif\sthere\sexists\salready\san\songoing\smerge\sof\sa\slevel\sless\sthan\sL. +D 2024-09-30T17:28:45.511 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 @@ -99,7 +99,7 @@ F ext/fts5/fts5_buffer.c 0eec58bff585f1a44ea9147eae5da2447292080ea435957f7488c70 F ext/fts5/fts5_config.c da21548ddbc1a457cb42545f527065221ede8ada6a734891b8c34317a7a9506b F ext/fts5/fts5_expr.c 9a56f53700d1860f0ee2f373c2b9074eaf2a7aa0637d0e27a6476de26a3fee33 F ext/fts5/fts5_hash.c adda4272be401566a6e0ba1acbe70ee5cb97fce944bc2e04dc707152a0ec91b1 -F ext/fts5/fts5_index.c 571483823193f09439356741669aa8c81da838ae6f5e1bfa7517f7ee2fb3addd +F ext/fts5/fts5_index.c 368a968570ce12ba40223e284a588d9f93ee23a0133727f0df1fcd64086b1fb6 F ext/fts5/fts5_main.c 4503498d3453e29a3cd89dacaba029011e89cb8c481a6241611d106e7a369bd4 F ext/fts5/fts5_storage.c 3332497823c3d171cf56379f2bd8c971ce15a19aadacff961106462022c92470 F ext/fts5/fts5_tcl.c 4db9258a7882c5eac0da4433042132aaf15b87dd1e1636c7a6ca203abd2c8bfe @@ -145,7 +145,7 @@ F ext/fts5/test/fts5contentless.test 606f063b29ba0f46d4b79aa36cdd1ef4dab5de53eae F ext/fts5/test/fts5contentless2.test 70ffe6c611d8f278240da56734df8a77948f04e2739b358439e9bdcf56ced35f F ext/fts5/test/fts5contentless3.test 75eaae5ad6b284ee447788943974d323228f27cc35a1681da997135cff95bc6a F ext/fts5/test/fts5contentless4.test ec34dc69ef474ca9997dae6d91e072906e0e9a5a4b05ea89964c863833b6eff8 -F ext/fts5/test/fts5contentless5.test 40cdcb4fe751672450829c5a96bd32c25fc2f6076279dd2ce5c58ac9a390132a +F ext/fts5/test/fts5contentless5.test 38cd0392c730dc7090c550321ce3c24ba4c392bc97308b51a4180e9959dca7b5 F ext/fts5/test/fts5corrupt.test 6485f721b88ba355ca5d701e7ee87a4efa3ea578d8e6adb26f51ef956c8328bd F ext/fts5/test/fts5corrupt2.test 335911e3f68b9625d850325f9e29a128db3f4276a8c9d4e32134580da8f924c4 F ext/fts5/test/fts5corrupt3.test 4fc3bf129f1616bea00884a23fd9d7b0e46d01791d2b57fe8d68ac36e8d3ff7c @@ -2213,8 +2213,8 @@ F vsixtest/vsixtest.tcl 6195aba1f12a5e10efc2b8c0009532167be5e301abe5b31385638080 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P e815055b321085deda8607ac3279ef1a1c890fe3bf9d9b9c0a74028e87857a7d -R c0b23dfcab02e83590bbedcac610fa7b -U drh -Z 5a1528ca859870969ffba6e26496a443 +P 76b6331e6a705a420a64820a18214f07cf4c1d5151e7158d6fff09964e63f352 +R af602edd5730d15273eb424f12f293da +U dan +Z 7c2ca47bd5a0ad794a2bc7691bf0167e # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index f56b36fa0b..35fff3b926 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -76b6331e6a705a420a64820a18214f07cf4c1d5151e7158d6fff09964e63f352 +350c6e75ce3c1e81458d1baa73045df489284206e8b279ab3c2f5e3d011c262a From cacef23082b8c60a7c211821a1d679bd25348a1e Mon Sep 17 00:00:00 2001 From: drh <> Date: Mon, 30 Sep 2024 18:19:38 +0000 Subject: [PATCH 18/34] Fix the character width tables for the CLI such that all unicode code-points less than 0x300 have a width of 1. This is in fact the case for Mac, Ubuntu, and Windows. FossilOrigin-Name: f0c5a86fefecded07e098e1326dd54c72504b0bb480f710e395d4041a322dfcb --- manifest | 14 +++++++------- manifest.uuid | 2 +- src/shell.c.in | 5 +---- 3 files changed, 9 insertions(+), 12 deletions(-) diff --git a/manifest b/manifest index 77ea93c261..cd4363196a 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C In\sfts5,\savoid\sstarting\sa\snew\smerge\sof\slevel\sL\sif\sthere\sexists\salready\san\songoing\smerge\sof\sa\slevel\sless\sthan\sL. -D 2024-09-30T17:28:45.511 +C Fix\sthe\scharacter\swidth\stables\sfor\sthe\sCLI\ssuch\sthat\sall\sunicode\scode-points\nless\sthan\s0x300\shave\sa\swidth\sof\s1.\s\sThis\sis\sin\sfact\sthe\scase\sfor\sMac,\sUbuntu,\nand\sWindows. +D 2024-09-30T18:19:38.492 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 @@ -768,7 +768,7 @@ F src/random.c 606b00941a1d7dd09c381d3279a058d771f406c5213c9932bbd93d5587be4b9c F src/resolve.c 9750a281f7ba073b4e6da2be1a6c4071f5d841a7746c5fb3f70d6d793b6675ea F src/rowset.c 8432130e6c344b3401a8874c3cb49fefe6873fec593294de077afea2dce5ec97 F src/select.c 4b14337a2742f0c0beeba490e9a05507e9b4b12184b9cd12773501d08d48e3fe -F src/shell.c.in 345173187067363374187176a8bbe779e359849e635d8288202000ee87f4405a +F src/shell.c.in d71d2463459e6cd9c2f2d702545aed5113ffbcea963c19c1e6d3a6d762ef959c F src/sqlite.h.in b20547021d20ba016c2fd0500f14f08a21ff23e64a0ed93e72ca0fecb9e1d0a0 F src/sqlite3.rc 5121c9e10c3964d5755191c80dd1180c122fc3a8 F src/sqlite3ext.h 3f046c04ea3595d6bfda99b781926b17e672fd6d27da2ba6d8d8fc39981dcb54 @@ -2213,8 +2213,8 @@ F vsixtest/vsixtest.tcl 6195aba1f12a5e10efc2b8c0009532167be5e301abe5b31385638080 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P 76b6331e6a705a420a64820a18214f07cf4c1d5151e7158d6fff09964e63f352 -R af602edd5730d15273eb424f12f293da -U dan -Z 7c2ca47bd5a0ad794a2bc7691bf0167e +P 350c6e75ce3c1e81458d1baa73045df489284206e8b279ab3c2f5e3d011c262a +R 196058ccce20b5d040ef28c3115701ff +U drh +Z c9a58ad028df05647dcb5802e9848199 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 35fff3b926..4742ec1d1d 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -350c6e75ce3c1e81458d1baa73045df489284206e8b279ab3c2f5e3d011c262a +f0c5a86fefecded07e098e1326dd54c72504b0bb480f710e395d4041a322dfcb diff --git a/src/shell.c.in b/src/shell.c.in index d1fc6aa748..35b9b089fa 100644 --- a/src/shell.c.in +++ b/src/shell.c.in @@ -631,7 +631,7 @@ static const struct { unsigned char w; /* Width of the character in columns */ int iFirst; /* First character in a span having this width */ } aUWidth[] = { - /* {0, 0x00000}, {1, 0x00020}, {0, 0x0007f}, {1, 0x000a0}, */ + /* {1, 0x00000}, */ {0, 0x00300}, {1, 0x00370}, {0, 0x00483}, {1, 0x00487}, {0, 0x00488}, {1, 0x0048a}, {0, 0x00591}, {1, 0x005be}, {0, 0x005bf}, {1, 0x005c0}, {0, 0x005c1}, {1, 0x005c3}, {0, 0x005c4}, {1, 0x005c6}, {0, 0x005c7}, @@ -709,9 +709,6 @@ int cli_wcwidth(int c){ int iFirst, iLast; /* Fast path for common characters */ - if( c<0x20 ) return 0; - if( c<0x7f ) return 1; - if( c<0xa0 ) return 0; if( c<=0x300 ) return 1; /* The general case */ From ed94e0e6778ca00db96690fe93820436cf2676d2 Mon Sep 17 00:00:00 2001 From: stephan Date: Tue, 1 Oct 2024 10:49:30 +0000 Subject: [PATCH 19/34] Add an #if'd-out block to sqlite3-wasm.c mentioning the LONGDOUBLE_TYPE, as brought up in [forum:cbfb0d0ac0a4e349 | forum post cbfb0d0ac]. No functional changes. FossilOrigin-Name: 0b83e8f1ef53b35a9dda0740b4922b8691428f7484f3058833a961f3f8d0b178 --- ext/wasm/api/sqlite3-wasm.c | 15 +++++++++++++++ manifest | 14 +++++++------- manifest.uuid | 2 +- 3 files changed, 23 insertions(+), 8 deletions(-) diff --git a/ext/wasm/api/sqlite3-wasm.c b/ext/wasm/api/sqlite3-wasm.c index c5dd495e54..1c46b0ec05 100644 --- a/ext/wasm/api/sqlite3-wasm.c +++ b/ext/wasm/api/sqlite3-wasm.c @@ -221,6 +221,21 @@ // See also: //__attribute__((export_name("theExportedName"), used, visibility("default"))) +#if 0 +/* Details at https://sqlite.org/forum/forumpost/cbfb0d0ac0a4e349 +** +** Summary: changing to `double` reduces the wasm file size by a mere +** 2k. It is hypothetically not possible that any clients rely on +** doubles larger than 64-bit because there is no mapping between C +** and JS for them. i.e. we "could" switch LONGDOUBLE_TYPE to double +** for wasm builds with very little risk of problems. Clang 18.1 maps +** `long double` to float128 but Emscripten doesn't (cannot) expose +** that to JS. +*/ +#undef LONGDOUBLE_TYPE +#define LONGDOUBLE_TYPE double +#endif + /* ** Which sqlite3.c we're using needs to be configurable to enable ** building against a custom copy, e.g. the SEE variant. Note that we diff --git a/manifest b/manifest index cd4363196a..77242f8aca 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Fix\sthe\scharacter\swidth\stables\sfor\sthe\sCLI\ssuch\sthat\sall\sunicode\scode-points\nless\sthan\s0x300\shave\sa\swidth\sof\s1.\s\sThis\sis\sin\sfact\sthe\scase\sfor\sMac,\sUbuntu,\nand\sWindows. -D 2024-09-30T18:19:38.492 +C Add\san\s#if'd-out\sblock\sto\ssqlite3-wasm.c\smentioning\sthe\sLONGDOUBLE_TYPE,\sas\sbrought\sup\sin\s[forum:cbfb0d0ac0a4e349\s|\sforum\spost\scbfb0d0ac].\sNo\sfunctional\schanges. +D 2024-10-01T10:49:30.088 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 @@ -632,7 +632,7 @@ F ext/wasm/api/sqlite3-vfs-helper.c-pp.js 3f828cc66758acb40e9c5b4dcfd87fd478a14c F ext/wasm/api/sqlite3-vfs-opfs-sahpool.c-pp.js e529a99b7d5a088284821e2902b20d3404b561126969876997d5a73a656c9199 F ext/wasm/api/sqlite3-vfs-opfs.c-pp.js e99e3d99f736937914527070f00ab13e9391d3f1cef884ab99a64cbcbee8d675 F ext/wasm/api/sqlite3-vtab-helper.c-pp.js e809739d71e8b35dfe1b55d24d91f02d04239e6aef7ca1ea92a15a29e704f616 -F ext/wasm/api/sqlite3-wasm.c 83f5e9f998e9fa4261eb84e9f092210e3ffe03895119f5ded0429eb34ab9d2be +F ext/wasm/api/sqlite3-wasm.c e94665e6625c8b35113cf0eb7dec7acc2d9ed76eed78b3a1abf6cae5ad8097d3 F ext/wasm/api/sqlite3-worker1-promiser.c-pp.js 46f303ba8ddd1b2f0a391798837beddfa72e8c897038c8047eda49ce7d5ed46b F ext/wasm/api/sqlite3-worker1.c-pp.js 5e8706c2c4af2a57fbcdc02f4e7ef79869971bc21bb8ede777687786ce1c92d5 F ext/wasm/batch-runner-sahpool.html e9a38fdeb36a13eac7b50241dfe7ae066fe3f51f5c0b0151e7baee5fce0d07a7 @@ -2213,8 +2213,8 @@ F vsixtest/vsixtest.tcl 6195aba1f12a5e10efc2b8c0009532167be5e301abe5b31385638080 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P 350c6e75ce3c1e81458d1baa73045df489284206e8b279ab3c2f5e3d011c262a -R 196058ccce20b5d040ef28c3115701ff -U drh -Z c9a58ad028df05647dcb5802e9848199 +P f0c5a86fefecded07e098e1326dd54c72504b0bb480f710e395d4041a322dfcb +R 95713aa430bd45b55e204d70dfdb0e42 +U stephan +Z 75aa095723616959401f433a579dd985 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 4742ec1d1d..f0f46579dc 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -f0c5a86fefecded07e098e1326dd54c72504b0bb480f710e395d4041a322dfcb +0b83e8f1ef53b35a9dda0740b4922b8691428f7484f3058833a961f3f8d0b178 From dac22f656646db9b9429d13c7fcd0a20d6b8a9d6 Mon Sep 17 00:00:00 2001 From: drh <> Date: Tue, 1 Oct 2024 16:55:30 +0000 Subject: [PATCH 20/34] Add compile-time option -DSQLITE_USE_LONG_DOUBLE=0 to omit all attempts to use "long double". Or =1 to omit attempts to use the Dekker algorithms to achieve high-resolution floating point. FossilOrigin-Name: ca5964ef70efad3332e0bf9c158eb5fd5006d3022051d1ac506c097c427735a1 --- manifest | 20 ++++++++++---------- manifest.uuid | 2 +- src/main.c | 15 ++++++++++----- src/sqliteInt.h | 35 +++++++++++++++++++++++++++++++++++ src/util.c | 4 ++-- src/vdbeaux.c | 2 +- 6 files changed, 59 insertions(+), 19 deletions(-) diff --git a/manifest b/manifest index 77242f8aca..38a8eea1a6 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Add\san\s#if'd-out\sblock\sto\ssqlite3-wasm.c\smentioning\sthe\sLONGDOUBLE_TYPE,\sas\sbrought\sup\sin\s[forum:cbfb0d0ac0a4e349\s|\sforum\spost\scbfb0d0ac].\sNo\sfunctional\schanges. -D 2024-10-01T10:49:30.088 +C Add\scompile-time\soption\s-DSQLITE_USE_LONG_DOUBLE=0\sto\somit\sall\sattempts\sto\suse\n"long\sdouble".\s\sOr\s=1\sto\somit\sattempts\sto\suse\sthe\sDekker\salgorithms\sto\sachieve\nhigh-resolution\sfloating\spoint. +D 2024-10-01T16:55:30.223 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 @@ -730,7 +730,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 4db6e3bde55ba0b24ccc83600c2b6ea11429f61ce7b3a2e7e3b42e1b45366c3e +F src/main.c 651be111d1fc05dae62d31cc41335748c27c67455cf777a2d7f48ce1fef585f6 F src/malloc.c 410e570b30c26cc36e3372577df50f7a96ee3eed5b2b161c6b6b48773c650c5e F src/mem0.c 6a55ebe57c46ca1a7d98da93aaa07f99f1059645 F src/mem1.c 3bb59158c38e05f6270e761a9f435bf19827a264c13d1631c58b84bdc96d73b2 @@ -772,7 +772,7 @@ F src/shell.c.in d71d2463459e6cd9c2f2d702545aed5113ffbcea963c19c1e6d3a6d762ef959 F src/sqlite.h.in b20547021d20ba016c2fd0500f14f08a21ff23e64a0ed93e72ca0fecb9e1d0a0 F src/sqlite3.rc 5121c9e10c3964d5755191c80dd1180c122fc3a8 F src/sqlite3ext.h 3f046c04ea3595d6bfda99b781926b17e672fd6d27da2ba6d8d8fc39981dcb54 -F src/sqliteInt.h 5978cbb11becc3ce6471015d770d95f694ece06336c496f691df1b02460e9cd5 +F src/sqliteInt.h e4940181e20f67b23b7e1b43807ceb3a9cdb38860225de3d5df7eea37bbe6651 F src/sqliteLimit.h 6878ab64bdeb8c24a1d762d45635e34b96da21132179023338c93f820eee6728 F src/status.c cb11f8589a6912af2da3bb1ec509a94dd8ef27df4d4c1a97e0bcf2309ece972b F src/table.c 0f141b58a16de7e2fbe81c308379e7279f4c6b50eb08efeec5892794a0ba30d1 @@ -835,13 +835,13 @@ F src/trigger.c 0bb986a5b96047fd597c6aac28588853df56064e576e6b81ba777ef2ccaac461 F src/update.c 0e01aa6a3edf9ec112b33eb714b9016a81241497b1fb7c3e74332f4f71756508 F src/upsert.c 215328c3f91623c520ec8672c44323553f12caeb4f01b1090ebdca99fdf7b4f1 F src/utf.c 7bc550af6f3ddd5f5dc82d092c41f728acb760c92e0b47f391963b01ae52569b -F src/util.c 5d1a0134cf4240648d1c6bb5cc8efaca0ea2b5d5c840985aec7e947271f04375 +F src/util.c ae41aadb960cb15d17e8bb9ec0ebb514e1f7ead773ae9fba281ed67c4d240c48 F src/vacuum.c b763b6457bd058d2072ef9364832351fd8d11e8abf70cbb349657360f7d55c40 F src/vdbe.c be5f58bc29f60252e041a618eae59e8d57d460ba136c5403cf0abf955560c457 F src/vdbe.h c2549a215898a390de6669cfa32adba56f0d7e17ba5a7f7b14506d6fd5f0c36a F src/vdbeInt.h af7d7e8291edd0b19f2cd698e60e4d4031078f9a2f2328ac8f0b7efb134f8a1d F src/vdbeapi.c 53c7e26a2c0821a892b20eee2cde4656e31998212f3d515576c780dfaa45fd17 -F src/vdbeaux.c 676dbee99b4febdd94bc9658667a2e3bc413c4c0e356242d90f98a1155d513e5 +F src/vdbeaux.c aa1bd97dc53406c26619b847f4c7f4f0137ee8c7ba9b266f93351e06aefb522e F src/vdbeblob.c 255be187436da38b01f276c02e6a08103489bbe2a7c6c21537b7aecbe0e1f797 F src/vdbemem.c df568ef0187e4be2788c35174f6d9b8566ab9475f9aff2d73907ed05aa5684b2 F src/vdbesort.c d0a3c7056c081703c8b6d91ad60f17da5e062a5c64bf568ed0fa1b5f4cae311f @@ -2213,8 +2213,8 @@ F vsixtest/vsixtest.tcl 6195aba1f12a5e10efc2b8c0009532167be5e301abe5b31385638080 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P f0c5a86fefecded07e098e1326dd54c72504b0bb480f710e395d4041a322dfcb -R 95713aa430bd45b55e204d70dfdb0e42 -U stephan -Z 75aa095723616959401f433a579dd985 +P 0b83e8f1ef53b35a9dda0740b4922b8691428f7484f3058833a961f3f8d0b178 +R 1afae59e0efb08982f93adc40d14c2a9 +U drh +Z 56bb71650eaf744de022c729aea7d991 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index f0f46579dc..72b7e4100f 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -0b83e8f1ef53b35a9dda0740b4922b8691428f7484f3058833a961f3f8d0b178 +ca5964ef70efad3332e0bf9c158eb5fd5006d3022051d1ac506c097c427735a1 diff --git a/src/main.c b/src/main.c index 6ab09c5560..bd0cbc731a 100644 --- a/src/main.c +++ b/src/main.c @@ -159,6 +159,7 @@ char *sqlite3_temp_directory = 0; */ char *sqlite3_data_directory = 0; +#if !defined(SQLITE_OMIT_WSD) && !defined(SQLITE_USE_LONG_DOUBLE) /* ** Determine whether or not high-precision (long double) floating point ** math works correctly on CPU currently running. @@ -183,7 +184,7 @@ static SQLITE_NOINLINE int hasHighPrecisionDouble(int rc){ return b!=c; } } - +#endif /* !SQLITE_OMIT_WSD && !SQLITE_USE_LONG_DOUBLE */ /* ** Initialize SQLite. @@ -380,9 +381,7 @@ int sqlite3_initialize(void){ } #endif - /* Experimentally determine if high-precision floating point is - ** available. */ -#ifndef SQLITE_OMIT_WSD +#if !defined(SQLITE_OMIT_WSD) && !defined(SQLITE_USE_LONG_DOUBLE) sqlite3Config.bUseLongDouble = hasHighPrecisionDouble(rc); #endif @@ -4645,12 +4644,18 @@ int sqlite3_test_control(int op, ...){ ** X==0 Disable bUseLongDouble ** X==1 Enable bUseLongDouble ** X>=2 Set bUseLongDouble to its default value for this platform + ** + ** If the SQLITE_USE_LONG_DOUBLE compile-time option has been used, then + ** the bUseLongDouble setting is fixed. This test-control becomes a + ** no-op, except that it still reports the fixed setting. */ case SQLITE_TESTCTRL_USELONGDOUBLE: { +#if !defined(SQLITE_USE_LONG_DOUBLE) int b = va_arg(ap, int); if( b>=2 ) b = hasHighPrecisionDouble(b); if( b>=0 ) sqlite3Config.bUseLongDouble = b>0; - rc = sqlite3Config.bUseLongDouble!=0; +#endif + rc = SqliteUseLongDouble!=0; break; } #endif diff --git a/src/sqliteInt.h b/src/sqliteInt.h index 604f7e975e..5b166d9a36 100644 --- a/src/sqliteInt.h +++ b/src/sqliteInt.h @@ -4249,6 +4249,41 @@ typedef struct { # define Tuning(X) 0 #endif +/* By default, SQLite will use long double if the long double type +** actually provides higher resolution than double. This use or non-use +** of long double is switchable at run-time by a test-control. Dekker +** algorithms are used for high-precision floating point when long double +** is not available. +** +** Having the run-time option to enable/disable long double support +** causes problems for some compiler tool chains. So the following +** compile-time option is available to permanently enable/disable the use +** of long double. +** +** -DSQLITE_USE_LONG_DOUBLE=0 Omit all use of "long double" from +** the code. Instead, the Dekker algorithm +** is always used when high-precision +** floating point is required. +** +** -DSQLITE_USE_LONG_DOUBLE=1 Always use long double when high +** precision is needed. Never fall back +** to using Dekker algorithms. +** +** If the SQLITE_USE_LONG_DOUBLE macro is not defined, then the determination +** of whether or not to use long double is made at run-time. +*/ +#ifndef SQLITE_USE_LONG_DOUBLE +# define SqliteUseLongDouble sqlite3Config.bUseLongDouble +#elif SQLITE_USE_LONG_DOUBLE+0==1 +# define SqliteUseLongDouble 1 +#elif SQLITE_USE_LONG_DOUBLE+0==0 +# undef LONGDOUBLE_TYPE +# define LONGDOUBLE_TYPE double +# define SqliteUseLongDouble 0 +#else +# error "SQLITE_USE_LONG_DOUBLE should be set to either 0 or 1" +#endif + /* ** Structure containing global configuration data for the SQLite library. ** diff --git a/src/util.c b/src/util.c index 0cebb474a2..7a82ce81bf 100644 --- a/src/util.c +++ b/src/util.c @@ -652,7 +652,7 @@ do_atof_calc: if( e==0 ){ *pResult = s; - }else if( sqlite3Config.bUseLongDouble ){ + }else if( SqliteUseLongDouble ){ LONGDOUBLE_TYPE r = (LONGDOUBLE_TYPE)s; if( e>0 ){ while( e>=100 ){ e-=100; r *= 1.0e+100L; } @@ -1063,7 +1063,7 @@ void sqlite3FpDecode(FpDecode *p, double r, int iRound, int mxRound){ /* Multiply r by powers of ten until it lands somewhere in between ** 1.0e+19 and 1.0e+17. */ - if( sqlite3Config.bUseLongDouble ){ + if( SqliteUseLongDouble ){ LONGDOUBLE_TYPE rr = r; if( rr>=1.0e+19 ){ while( rr>=1.0e+119L ){ exp+=100; rr *= 1.0e-100L; } diff --git a/src/vdbeaux.c b/src/vdbeaux.c index a66bdecffb..929190b3af 100644 --- a/src/vdbeaux.c +++ b/src/vdbeaux.c @@ -4528,7 +4528,7 @@ int sqlite3IntFloatCompare(i64 i, double r){ ** than NULL */ return 1; } - if( sqlite3Config.bUseLongDouble ){ + if( SqliteUseLongDouble ){ LONGDOUBLE_TYPE x = (LONGDOUBLE_TYPE)i; testcase( xr ); From c9c1b65698ed3fa83985c92e02dd872b56948f79 Mon Sep 17 00:00:00 2001 From: stephan Date: Tue, 1 Oct 2024 17:08:23 +0000 Subject: [PATCH 21/34] Use the new SQLITE_USE_LONG_DOUBLE to disable long-double support in WASM builds, as they cannot be represented in JS and this saves approximately 5.5kb in the resulting wasm file. FossilOrigin-Name: fa7b56f776b715d061581fad6f04b871504ff5d808e7364419d1d6cdef82c5ee --- ext/wasm/GNUmakefile | 2 ++ ext/wasm/api/sqlite3-wasm.c | 6 ++++++ manifest | 16 ++++++++-------- manifest.uuid | 2 +- 4 files changed, 17 insertions(+), 9 deletions(-) diff --git a/ext/wasm/GNUmakefile b/ext/wasm/GNUmakefile index 2602e6b792..a68f813d6b 100644 --- a/ext/wasm/GNUmakefile +++ b/ext/wasm/GNUmakefile @@ -239,6 +239,7 @@ SQLITE_OPT.common := \ '-DSQLITE_DEFAULT_UNIX_VFS="unix-none"' \ -DSQLITE_USE_URI=1 \ -DSQLITE_C=$(sqlite3.c) \ + -DSQLITE_USE_LONG_DOUBLE=0 \ -DSQLITE_OMIT_DEPRECATED \ -DSQLITE_OMIT_UTF16 \ -DSQLITE_OMIT_LOAD_EXTENSION \ @@ -251,6 +252,7 @@ SQLITE_OPT.common := \ # to be able to run without this: SQLITE_OPT.common += -DSQLITE_WASM_ENABLE_C_TESTS +# Extra flags for full-featured builds... SQLITE_OPT.full-featured := \ -DSQLITE_ENABLE_BYTECODE_VTAB \ -DSQLITE_ENABLE_DBPAGE_VTAB \ diff --git a/ext/wasm/api/sqlite3-wasm.c b/ext/wasm/api/sqlite3-wasm.c index 1c46b0ec05..945acd23dd 100644 --- a/ext/wasm/api/sqlite3-wasm.c +++ b/ext/wasm/api/sqlite3-wasm.c @@ -127,6 +127,10 @@ # define SQLITE_USE_URI 1 #endif +#ifndef SQLITE_USE_LONG_DOUBLE +# define SQLITE_USE_LONG_DOUBLE 0 +#endif + #ifdef SQLITE_WASM_EXTRA_INIT # define SQLITE_EXTRA_INIT sqlite3_wasm_extra_init #endif @@ -159,6 +163,8 @@ # define SQLITE_OMIT_PROGRESS_CALLBACK # undef SQLITE_OMIT_WAL # define SQLITE_OMIT_WAL +# undef SQLITE_USE_LONG_DOUBLE +# define SQLITE_USE_LONG_DOUBLE 0 /* The following OMITs do not work with the standard amalgamation, so require a custom build: diff --git a/manifest b/manifest index 38a8eea1a6..037e9a4724 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Add\scompile-time\soption\s-DSQLITE_USE_LONG_DOUBLE=0\sto\somit\sall\sattempts\sto\suse\n"long\sdouble".\s\sOr\s=1\sto\somit\sattempts\sto\suse\sthe\sDekker\salgorithms\sto\sachieve\nhigh-resolution\sfloating\spoint. -D 2024-10-01T16:55:30.223 +C Use\sthe\snew\sSQLITE_USE_LONG_DOUBLE\sto\sdisable\slong-double\ssupport\sin\sWASM\sbuilds,\sas\sthey\scannot\sbe\srepresented\sin\sJS\sand\sthis\ssaves\sapproximately\s5.5kb\sin\sthe\sresulting\swasm\sfile. +D 2024-10-01T17:08:23.912 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 @@ -603,7 +603,7 @@ F ext/userauth/sqlite3userauth.h 7f3ea8c4686db8e40b0a0e7a8e0b00fac13aa7a3 F ext/userauth/user-auth.txt ca7e9ee82ca4e1c1744295f8184dd70edfae1992865d26c64303f539eb6c084c F ext/userauth/userauth.c 7f00cded7dcaa5d47f54539b290a43d2e59f4b1eb5f447545fa865f002fc80cb F ext/wasm/EXPORTED_FUNCTIONS.fiddle.in 27450c8b8c70875a260aca55435ec927068b34cef801a96205adb81bdcefc65c -F ext/wasm/GNUmakefile 6b94c3125c40932e71bbe46e582d24ed4c829b9fa2ff34dd842b0ed8a948ac6a +F ext/wasm/GNUmakefile c2ee5993e727dd2c1f0f784f47843fb7af45cebd23626b537bae2d2d8f4a3abd F ext/wasm/README-dist.txt 6382cb9548076fca472fb3330bbdba3a55c1ea0b180ff9253f084f07ff383576 F ext/wasm/README.md a8a2962c3aebdf8d2104a9102e336c5554e78fc6072746e5daf9c61514e7d193 F ext/wasm/SQLTester/GNUmakefile e0794f676d55819951bbfae45cc5e8d7818dc460492dc317ce7f0d2eca15caff @@ -632,7 +632,7 @@ F ext/wasm/api/sqlite3-vfs-helper.c-pp.js 3f828cc66758acb40e9c5b4dcfd87fd478a14c F ext/wasm/api/sqlite3-vfs-opfs-sahpool.c-pp.js e529a99b7d5a088284821e2902b20d3404b561126969876997d5a73a656c9199 F ext/wasm/api/sqlite3-vfs-opfs.c-pp.js e99e3d99f736937914527070f00ab13e9391d3f1cef884ab99a64cbcbee8d675 F ext/wasm/api/sqlite3-vtab-helper.c-pp.js e809739d71e8b35dfe1b55d24d91f02d04239e6aef7ca1ea92a15a29e704f616 -F ext/wasm/api/sqlite3-wasm.c e94665e6625c8b35113cf0eb7dec7acc2d9ed76eed78b3a1abf6cae5ad8097d3 +F ext/wasm/api/sqlite3-wasm.c 2ac6cff59668eed42a87b8b21ff66f0edf82b25c04bbb8adda0c4eff28ed11ce F ext/wasm/api/sqlite3-worker1-promiser.c-pp.js 46f303ba8ddd1b2f0a391798837beddfa72e8c897038c8047eda49ce7d5ed46b F ext/wasm/api/sqlite3-worker1.c-pp.js 5e8706c2c4af2a57fbcdc02f4e7ef79869971bc21bb8ede777687786ce1c92d5 F ext/wasm/batch-runner-sahpool.html e9a38fdeb36a13eac7b50241dfe7ae066fe3f51f5c0b0151e7baee5fce0d07a7 @@ -2213,8 +2213,8 @@ F vsixtest/vsixtest.tcl 6195aba1f12a5e10efc2b8c0009532167be5e301abe5b31385638080 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P 0b83e8f1ef53b35a9dda0740b4922b8691428f7484f3058833a961f3f8d0b178 -R 1afae59e0efb08982f93adc40d14c2a9 -U drh -Z 56bb71650eaf744de022c729aea7d991 +P ca5964ef70efad3332e0bf9c158eb5fd5006d3022051d1ac506c097c427735a1 +R 7b5589656a320d55088e87a9d21d3695 +U stephan +Z b3281d7ec085a9e7d4c5e83e25b26b8b # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 72b7e4100f..7113b4ff6a 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -ca5964ef70efad3332e0bf9c158eb5fd5006d3022051d1ac506c097c427735a1 +fa7b56f776b715d061581fad6f04b871504ff5d808e7364419d1d6cdef82c5ee From 1f2faa647f32b4182c43156f5107a59574647104 Mon Sep 17 00:00:00 2001 From: stephan Date: Tue, 1 Oct 2024 17:57:55 +0000 Subject: [PATCH 22/34] Another comment about the LONGDOUBLE wasm topic. No code changes. FossilOrigin-Name: 1755831cb1ac58241e0b11d8d003b5eca39b65aa3cb84229b215662028b1b3c0 --- ext/wasm/api/sqlite3-wasm.c | 2 ++ manifest | 12 ++++++------ manifest.uuid | 2 +- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/ext/wasm/api/sqlite3-wasm.c b/ext/wasm/api/sqlite3-wasm.c index 945acd23dd..b689b426fb 100644 --- a/ext/wasm/api/sqlite3-wasm.c +++ b/ext/wasm/api/sqlite3-wasm.c @@ -237,6 +237,8 @@ ** for wasm builds with very little risk of problems. Clang 18.1 maps ** `long double` to float128 but Emscripten doesn't (cannot) expose ** that to JS. +** +** See also: SQLITE_USE_LONG_DOUBLE */ #undef LONGDOUBLE_TYPE #define LONGDOUBLE_TYPE double diff --git a/manifest b/manifest index 037e9a4724..65c7f28e25 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Use\sthe\snew\sSQLITE_USE_LONG_DOUBLE\sto\sdisable\slong-double\ssupport\sin\sWASM\sbuilds,\sas\sthey\scannot\sbe\srepresented\sin\sJS\sand\sthis\ssaves\sapproximately\s5.5kb\sin\sthe\sresulting\swasm\sfile. -D 2024-10-01T17:08:23.912 +C Another\scomment\sabout\sthe\sLONGDOUBLE\swasm\stopic.\sNo\scode\schanges. +D 2024-10-01T17:57:55.467 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 @@ -632,7 +632,7 @@ F ext/wasm/api/sqlite3-vfs-helper.c-pp.js 3f828cc66758acb40e9c5b4dcfd87fd478a14c F ext/wasm/api/sqlite3-vfs-opfs-sahpool.c-pp.js e529a99b7d5a088284821e2902b20d3404b561126969876997d5a73a656c9199 F ext/wasm/api/sqlite3-vfs-opfs.c-pp.js e99e3d99f736937914527070f00ab13e9391d3f1cef884ab99a64cbcbee8d675 F ext/wasm/api/sqlite3-vtab-helper.c-pp.js e809739d71e8b35dfe1b55d24d91f02d04239e6aef7ca1ea92a15a29e704f616 -F ext/wasm/api/sqlite3-wasm.c 2ac6cff59668eed42a87b8b21ff66f0edf82b25c04bbb8adda0c4eff28ed11ce +F ext/wasm/api/sqlite3-wasm.c 2d4340f2dacd9119e95c470d9c4f392e399feffc292962b855f0a67ffb0fc418 F ext/wasm/api/sqlite3-worker1-promiser.c-pp.js 46f303ba8ddd1b2f0a391798837beddfa72e8c897038c8047eda49ce7d5ed46b F ext/wasm/api/sqlite3-worker1.c-pp.js 5e8706c2c4af2a57fbcdc02f4e7ef79869971bc21bb8ede777687786ce1c92d5 F ext/wasm/batch-runner-sahpool.html e9a38fdeb36a13eac7b50241dfe7ae066fe3f51f5c0b0151e7baee5fce0d07a7 @@ -2213,8 +2213,8 @@ F vsixtest/vsixtest.tcl 6195aba1f12a5e10efc2b8c0009532167be5e301abe5b31385638080 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P ca5964ef70efad3332e0bf9c158eb5fd5006d3022051d1ac506c097c427735a1 -R 7b5589656a320d55088e87a9d21d3695 +P fa7b56f776b715d061581fad6f04b871504ff5d808e7364419d1d6cdef82c5ee +R f9afa03cdf9385554f9061800ab5a24b U stephan -Z b3281d7ec085a9e7d4c5e83e25b26b8b +Z 7a6ac00554cffba6a7d224734b670d11 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 7113b4ff6a..d4c262a19a 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -fa7b56f776b715d061581fad6f04b871504ff5d808e7364419d1d6cdef82c5ee +1755831cb1ac58241e0b11d8d003b5eca39b65aa3cb84229b215662028b1b3c0 From 7151010919cff7ab5134173f5d22fdf534104c34 Mon Sep 17 00:00:00 2001 From: drh <> Date: Tue, 1 Oct 2024 19:10:47 +0000 Subject: [PATCH 23/34] New #ifdefs to omit code that is unused when SQLITE_USE_LONG DOUBLE is defined. FossilOrigin-Name: 98066e2d226e7d2eceec1931a1432baea956f49bf3c708d8a6d511fa4e864ca3 --- manifest | 18 +++++++++--------- manifest.uuid | 2 +- src/util.c | 4 ++++ src/vdbeaux.c | 6 +++++- test/speedtest1.c | 12 +++++++++--- 5 files changed, 28 insertions(+), 14 deletions(-) diff --git a/manifest b/manifest index 65c7f28e25..ac49e358bf 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Another\scomment\sabout\sthe\sLONGDOUBLE\swasm\stopic.\sNo\scode\schanges. -D 2024-10-01T17:57:55.467 +C New\s#ifdefs\sto\somit\scode\sthat\sis\sunused\swhen\sSQLITE_USE_LONG\sDOUBLE\sis\sdefined. +D 2024-10-01T19:10:47.855 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 @@ -835,13 +835,13 @@ F src/trigger.c 0bb986a5b96047fd597c6aac28588853df56064e576e6b81ba777ef2ccaac461 F src/update.c 0e01aa6a3edf9ec112b33eb714b9016a81241497b1fb7c3e74332f4f71756508 F src/upsert.c 215328c3f91623c520ec8672c44323553f12caeb4f01b1090ebdca99fdf7b4f1 F src/utf.c 7bc550af6f3ddd5f5dc82d092c41f728acb760c92e0b47f391963b01ae52569b -F src/util.c ae41aadb960cb15d17e8bb9ec0ebb514e1f7ead773ae9fba281ed67c4d240c48 +F src/util.c aea7987484ec05764eabdd63b55eb63ea85cfb5b95dde70a667711c1d326f1a7 F src/vacuum.c b763b6457bd058d2072ef9364832351fd8d11e8abf70cbb349657360f7d55c40 F src/vdbe.c be5f58bc29f60252e041a618eae59e8d57d460ba136c5403cf0abf955560c457 F src/vdbe.h c2549a215898a390de6669cfa32adba56f0d7e17ba5a7f7b14506d6fd5f0c36a F src/vdbeInt.h af7d7e8291edd0b19f2cd698e60e4d4031078f9a2f2328ac8f0b7efb134f8a1d F src/vdbeapi.c 53c7e26a2c0821a892b20eee2cde4656e31998212f3d515576c780dfaa45fd17 -F src/vdbeaux.c aa1bd97dc53406c26619b847f4c7f4f0137ee8c7ba9b266f93351e06aefb522e +F src/vdbeaux.c a30204ae8820ee5165736c2e67fe9b62ad47690c72248b4adba0435b0b3f8bfe F src/vdbeblob.c 255be187436da38b01f276c02e6a08103489bbe2a7c6c21537b7aecbe0e1f797 F src/vdbemem.c df568ef0187e4be2788c35174f6d9b8566ab9475f9aff2d73907ed05aa5684b2 F src/vdbesort.c d0a3c7056c081703c8b6d91ad60f17da5e062a5c64bf568ed0fa1b5f4cae311f @@ -1668,7 +1668,7 @@ F test/speed3.test 694affeb9100526007436334cf7d08f3d74b85ef F test/speed4.test abc0ad3399dcf9703abed2fff8705e4f8e416715 F test/speed4p.explain 6b5f104ebeb34a038b2f714150f51d01143e59aa F test/speed4p.test 377a0c48e5a92e0b11c1c5ebb1bc9d83a7312c922bc0cb05970ef5d6a96d1f0c -F test/speedtest1.c 19c9b60908d25502d2831f97efee8b81006c356ab8c08327e25d24a4144f2131 +F test/speedtest1.c 82f273f6df420bb1563d5202277e4a907e4e032a96a86fa7cf8c7aed34b32724 F test/spellfix.test 951a6405d49d1a23d6b78027d3877b4a33eeb8221dcab5704b499755bb4f552e F test/spellfix2.test dfc8f519a3fc204cb2dfa8b4f29821ae90f6f8c3 F test/spellfix3.test 0f9efaaa502a0e0a09848028518a6fb096c8ad33 @@ -2213,8 +2213,8 @@ F vsixtest/vsixtest.tcl 6195aba1f12a5e10efc2b8c0009532167be5e301abe5b31385638080 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P fa7b56f776b715d061581fad6f04b871504ff5d808e7364419d1d6cdef82c5ee -R f9afa03cdf9385554f9061800ab5a24b -U stephan -Z 7a6ac00554cffba6a7d224734b670d11 +P 1755831cb1ac58241e0b11d8d003b5eca39b65aa3cb84229b215662028b1b3c0 +R aec30d14f5d302123caffa8ac548b88e +U drh +Z 3d8c02a9a1123f16b58018bc4d458ba9 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index d4c262a19a..19cf9165e2 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -1755831cb1ac58241e0b11d8d003b5eca39b65aa3cb84229b215662028b1b3c0 +98066e2d226e7d2eceec1931a1432baea956f49bf3c708d8a6d511fa4e864ca3 diff --git a/src/util.c b/src/util.c index 7a82ce81bf..6725306eda 100644 --- a/src/util.c +++ b/src/util.c @@ -458,6 +458,7 @@ u8 sqlite3StrIHash(const char *z){ return h; } +#if !defined(SQLITE_USE_LONG_DOUBLE) || SQLITE_USE_LONG_DOUBLE+0==0 /* Double-Double multiplication. (x[0],x[1]) *= (y,yy) ** ** Reference: @@ -493,6 +494,9 @@ static void dekkerMul2(volatile double *x, double y, double yy){ x[1] = c - x[0]; x[1] += cc; } +#else +# define dekkerMul2(A,B,C) /* No-op if SqliteUseLongDouble is always true */ +#endif /* ** The string z[] is an text representation of a real number. diff --git a/src/vdbeaux.c b/src/vdbeaux.c index 929190b3af..5ff4ca928c 100644 --- a/src/vdbeaux.c +++ b/src/vdbeaux.c @@ -4512,9 +4512,13 @@ SQLITE_NOINLINE int sqlite3BlobCompare(const Mem *pB1, const Mem *pB2){ ** We must use separate SQLITE_NOINLINE functions here, since otherwise ** optimizer code movement causes gcov to become very confused. */ -#if defined(SQLITE_COVERAGE_TEST) || defined(SQLITE_DEBUG) +#if (defined(SQLITE_COVERAGE_TEST) || defined(SQLITE_DEBUG)) \ + && (!defined(SQLITE_USE_LONG_DOUBLE) || SQLITE_USE_LONG_DOUBLE+0==0) static int SQLITE_NOINLINE doubleLt(double a, double b){ return a=0 ){ + sqlite3_test_control(SQLITE_TESTCTRL_USELONGDOUBLE, useLongDouble); + } +#endif if( g.nReserve>0 ){ sqlite3_file_control(g.db, 0, SQLITE_FCNTL_RESERVE_BYTES, &g.nReserve); } From e8b2c92240388cad4d41e83a7383b179b7a78acd Mon Sep 17 00:00:00 2001 From: drh <> Date: Tue, 1 Oct 2024 20:29:43 +0000 Subject: [PATCH 24/34] Remove all code that makes use of the C-language "long double" datatype. FossilOrigin-Name: f622b52024c8bec1d241b1dc480fbbd839fc1af50b6220f012812503de2c656e --- manifest | 45 +++++----- manifest.uuid | 2 +- src/global.c | 1 - src/main.c | 56 ------------ src/shell.c.in | 16 ---- src/sqlite.h.in | 2 +- src/sqliteInt.h | 40 --------- src/test1.c | 35 -------- src/test_config.c | 4 - src/util.c | 181 +++++++++++++++------------------------ src/vdbeaux.c | 13 +-- test/atof1.test | 2 +- test/cast.test | 30 +++---- test/fp-speed-1.c | 10 --- test/func4.test | 2 +- test/speedtest1.c | 11 --- test/testrunner_data.tcl | 2 - tool/speed-check.sh | 3 - 18 files changed, 109 insertions(+), 346 deletions(-) diff --git a/manifest b/manifest index ac49e358bf..6f37d1934e 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C New\s#ifdefs\sto\somit\scode\sthat\sis\sunused\swhen\sSQLITE_USE_LONG\sDOUBLE\sis\sdefined. -D 2024-10-01T19:10:47.855 +C Remove\sall\scode\sthat\smakes\suse\sof\sthe\sC-language\s"long\sdouble"\sdatatype. +D 2024-10-01T20:29:43.065 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 @@ -721,7 +721,7 @@ F src/expr.c 6d5f2c38fe3ec06a7eac599dac822788b36064124e20112a844e9cd5156cb239 F src/fault.c 460f3e55994363812d9d60844b2a6de88826e007 F src/fkey.c 928ed2517e8732113d2b9821aa37af639688d752f4ea9ac6e0e393d713eeb76f F src/func.c df400a1d3f4625997d4dd8a81951c303e066277c29b861d37e03cd152d7858dd -F src/global.c 61a419dd9e993b9be0f91de4c4ccf322b053eb829868e089f0321dd669be3b90 +F src/global.c a19e4b1ca1335f560e9560e590fc13081e21f670643367f99cb9e8f9dc7d615b F src/hash.c 9ee4269fb1d6632a6fecfb9479c93a1f29271bddbbaf215dd60420bcb80c7220 F src/hash.h 3340ab6e1d13e725571d7cee6d3e3135f0779a7d8e76a9ce0a85971fa3953c51 F src/hwtime.h f9c2dfb84dce7acf95ce6d289e46f5f9d3d1afd328e53da8f8e9008e3b3caae6 @@ -730,7 +730,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 651be111d1fc05dae62d31cc41335748c27c67455cf777a2d7f48ce1fef585f6 +F src/main.c e42b9134800a577060e4cd325ddf88c289a99ed57519553ad3465c1080a4d6d6 F src/malloc.c 410e570b30c26cc36e3372577df50f7a96ee3eed5b2b161c6b6b48773c650c5e F src/mem0.c 6a55ebe57c46ca1a7d98da93aaa07f99f1059645 F src/mem1.c 3bb59158c38e05f6270e761a9f435bf19827a264c13d1631c58b84bdc96d73b2 @@ -768,17 +768,17 @@ F src/random.c 606b00941a1d7dd09c381d3279a058d771f406c5213c9932bbd93d5587be4b9c F src/resolve.c 9750a281f7ba073b4e6da2be1a6c4071f5d841a7746c5fb3f70d6d793b6675ea F src/rowset.c 8432130e6c344b3401a8874c3cb49fefe6873fec593294de077afea2dce5ec97 F src/select.c 4b14337a2742f0c0beeba490e9a05507e9b4b12184b9cd12773501d08d48e3fe -F src/shell.c.in d71d2463459e6cd9c2f2d702545aed5113ffbcea963c19c1e6d3a6d762ef959c -F src/sqlite.h.in b20547021d20ba016c2fd0500f14f08a21ff23e64a0ed93e72ca0fecb9e1d0a0 +F src/shell.c.in 981efe98f98a983c1d0193d18528eb2d765207c0c82b67b610be60f17995a43e +F src/sqlite.h.in 29bd29520f8dad4754f8d9a195edd5ec2598d2d3b1e9085a25d01697f70545c0 F src/sqlite3.rc 5121c9e10c3964d5755191c80dd1180c122fc3a8 F src/sqlite3ext.h 3f046c04ea3595d6bfda99b781926b17e672fd6d27da2ba6d8d8fc39981dcb54 -F src/sqliteInt.h e4940181e20f67b23b7e1b43807ceb3a9cdb38860225de3d5df7eea37bbe6651 +F src/sqliteInt.h 6ffd984ac04b5cfbe03f985a79d4664fe40be1198482add1c3de1137a8d9b86f F src/sqliteLimit.h 6878ab64bdeb8c24a1d762d45635e34b96da21132179023338c93f820eee6728 F src/status.c cb11f8589a6912af2da3bb1ec509a94dd8ef27df4d4c1a97e0bcf2309ece972b F src/table.c 0f141b58a16de7e2fbe81c308379e7279f4c6b50eb08efeec5892794a0ba30d1 F src/tclsqlite.c c6888598f08dee3d9112a38ef42c8f5c89ca7f3190f4694744d0b84250f4bf8c F src/tclsqlite.h c6af51f31a2b2172d674608763a4b98fdf5cd587e4025053e546fb8077757262 -F src/test1.c 8d7cd219c004cd2ced60659ebf045025cc5c16ce19d12459589dacd4310f7f07 +F src/test1.c 8bf8b74145b768f42386787f93f6d6dad7bc400a4ee2d50e4ad5a06a20a97ef1 F src/test2.c 7ebc518e6735939d8979273a6f7b1d9b5702babf059f6ad62499f7f60a9eb9a3 F src/test3.c e7573aa0f78ee4e070a4bc8c3493941c1aa64d5c66d4825c74c0f055451f432b F src/test4.c 13e57ae7ec7a959ee180970aef09deed141252fe9bb07c61054f0dfa4f1dfd5d @@ -792,7 +792,7 @@ F src/test_backup.c bd901e3c116c7f3b3bbbd4aae4ce87d99b400c9cbb0a9e7b4610af451d97 F src/test_bestindex.c 3401bee51665cbf7f9ed2552b5795452a8b86365e4c9ece745b54155a55670c6 F src/test_blob.c bcdf6a6c22d0bcc13c41479d63692ef413add2a4d30e1e26b9f74ab85b9fb4d5 F src/test_btree.c 28283787d32b8fa953eb77412ad0de2c9895260e4e5bd5a94b3c7411664f90d5 -F src/test_config.c 345b8e383f71cecc36d0fa05f2f06639c254b188f98101c3c97749df43037086 +F src/test_config.c e8d041a84151cbaee4dd82eb32e4153abe06856bcfab4771968a8cf930a86332 F src/test_delete.c e2fe07646dff6300b48d49b2fee2fe192ed389e834dd635e3b3bac0ce0bf9f8f F src/test_demovfs.c 3efa2adf4f21e10d95521721687d5ca047aea91fa62dd8cc22ac9e5a9c942383 F src/test_devsym.c 649434ed34d0b03fbd5a6b42df80f0f9a7e53f94dd1710aad5dd8831e91c4e86 @@ -835,13 +835,13 @@ F src/trigger.c 0bb986a5b96047fd597c6aac28588853df56064e576e6b81ba777ef2ccaac461 F src/update.c 0e01aa6a3edf9ec112b33eb714b9016a81241497b1fb7c3e74332f4f71756508 F src/upsert.c 215328c3f91623c520ec8672c44323553f12caeb4f01b1090ebdca99fdf7b4f1 F src/utf.c 7bc550af6f3ddd5f5dc82d092c41f728acb760c92e0b47f391963b01ae52569b -F src/util.c aea7987484ec05764eabdd63b55eb63ea85cfb5b95dde70a667711c1d326f1a7 +F src/util.c 4d57ae861d0e234019be9596818228d7715e44e6efaccb612cf4498bedc2e023 F src/vacuum.c b763b6457bd058d2072ef9364832351fd8d11e8abf70cbb349657360f7d55c40 F src/vdbe.c be5f58bc29f60252e041a618eae59e8d57d460ba136c5403cf0abf955560c457 F src/vdbe.h c2549a215898a390de6669cfa32adba56f0d7e17ba5a7f7b14506d6fd5f0c36a F src/vdbeInt.h af7d7e8291edd0b19f2cd698e60e4d4031078f9a2f2328ac8f0b7efb134f8a1d F src/vdbeapi.c 53c7e26a2c0821a892b20eee2cde4656e31998212f3d515576c780dfaa45fd17 -F src/vdbeaux.c a30204ae8820ee5165736c2e67fe9b62ad47690c72248b4adba0435b0b3f8bfe +F src/vdbeaux.c f06f011e4fac948941ea821ac365a9f1c163ef473e63756d6e499a37c6bda9ef F src/vdbeblob.c 255be187436da38b01f276c02e6a08103489bbe2a7c6c21537b7aecbe0e1f797 F src/vdbemem.c df568ef0187e4be2788c35174f6d9b8566ab9475f9aff2d73907ed05aa5684b2 F src/vdbesort.c d0a3c7056c081703c8b6d91ad60f17da5e062a5c64bf568ed0fa1b5f4cae311f @@ -906,7 +906,7 @@ F test/async2.test c0a9bd20816d7d6a2ceca7b8c03d3d69c28ffb8b F test/async3.test d73a062002376d7edc1fe3edff493edbec1fc2f7 F test/async4.test 1787e3952128aa10238bf39945126de7ca23685a F test/async5.test 383ab533fdb9f7ad228cc99ee66e1acb34cc0dc0 -F test/atof1.test f2765d7fdc1348ae58b279d096d301a208e46da623213877b2ba580dc2768975 +F test/atof1.test 7ec56debc04b32e8f9dc87239f4bbb07d84550fb83dd7475b0ead9e83beb35da F test/atomic.test 065a453dde33c77ff586d91ccaa6ed419829d492dbb1a5694b8a09f3f9d7d061 F test/atomic2.test b6863b4aa552543874f80b42fb3063f1c8c2e3d8e56b6562f00a3cc347b5c1da F test/atrc.c c388fac43dbba05c804432a7135ae688b32e8f25818e9994ffba4b64cf60c27c @@ -989,7 +989,7 @@ F test/capi3c.test 31d3a6778f2d06f2d9222bd7660c41a516d1518a059b069e96ebbeadb5a49 F test/capi3d.test 8b778794af891b0dca3d900bd345fbc8ebd2aa2aae425a9dccdd10d5233dfbde F test/capi3e.test 3d49c01ef2a1a55f41d73cba2b23b5059ec460fe F test/carray01.test 23ed7074307c4a829ba5ff2970993a9d87db7c5cdbbe1a2cbef672d0df6d6e31 -F test/cast.test 42f7d79d88ab5e8080e96c650c52fcf72eef3e6476aaaee2c9f6e074396cfdfc +F test/cast.test 6d095303492432a973e6dfc0071cb94cac2969ffbe2e6a68432be0c7b3b0a2d3 F test/cffault.test 9d6b20606afe712374952eec4f8fd74b1a8097ef F test/changes.test 4377d202a487f66fc2822c1bf57c46798c8b2caf7446f4f701723b1dbb6b86f6 F test/changes2.test 07949edcc732af28cb54276bfb7d99723bccc1e905a423648bf57ac5cb0dc792 @@ -1153,7 +1153,7 @@ F test/fkey8.test 51deda7f1a1448bca95875e4a6e1a3a75b4bd7215e924e845bd60de60e4d84 F test/fkey_malloc.test 594a7ea1fbab553c036c70813cd8bd9407d63749 F test/fordelete.test ba98f14446b310f9c9d935b97ec748753d0144a28b356ba30d1f4f6958fdde5c F test/format4.test eeae341953db8b6bda7f549044797c3278a6cc345d11ada81471671b654f8ef4 -F test/fp-speed-1.c ca95152d579530c967240ead1387dc1208052d310dfa22bc9ebded56d4e6c026 +F test/fp-speed-1.c b37de94eba034e1703668816225f54510ec60fb0685406608cc707afe6b8234d F test/fpconv1.test d5d8aa0c427533006c112fb1957cdd1ea68c1d0709470dabb9ca02c2e4c06ad8 F test/fts-9fd058691.test 78b887e30ae6816df0e1fed6259de4b5a64ad33c F test/fts3.test 672a040ea57036fb4b6fdc09027c18d7d24ab654 @@ -1254,7 +1254,7 @@ F test/full.test 6b3c8fb43c6beab6b95438c1675374b95fab245d F test/func.test b56905748ce0567c01d60005f3e6ad1af19453d224ba4730ee687d048fd09ef9 F test/func2.test 69f6ae3751b4ec765bdc3b803c0a255aa0f693f28f44805bef03e6b4a3fd242f F test/func3.test 600a632c305a88f3946d38f9a51efe145c989b2e13bd2b2a488db47fe76bab6a -F test/func4.test a3f9062487dbd826776f54f4e0e9517fe8c3cf689af92735308965774d51fac5 +F test/func4.test a02e695f62beb31cb092dccf6873ff97543407fff97a5f3ec4da70b5b337bc84 F test/func5.test 863e6d1bd0013d09c17236f8a13ea34008dd857d87d85a13a673960e4c25d82a F test/func6.test 3bc89ec0f2605736d3a118f43d25ef58115a7db4dba8ae939a363917d815c0bb F test/func7.test 7e009275f52c52954c8c028fdb62f8bc16cc47276fcc8753c1d2b22c6e074598 @@ -1668,7 +1668,7 @@ F test/speed3.test 694affeb9100526007436334cf7d08f3d74b85ef F test/speed4.test abc0ad3399dcf9703abed2fff8705e4f8e416715 F test/speed4p.explain 6b5f104ebeb34a038b2f714150f51d01143e59aa F test/speed4p.test 377a0c48e5a92e0b11c1c5ebb1bc9d83a7312c922bc0cb05970ef5d6a96d1f0c -F test/speedtest1.c 82f273f6df420bb1563d5202277e4a907e4e032a96a86fa7cf8c7aed34b32724 +F test/speedtest1.c cc503febbb8559d541a67d7a33d3d7bb8a2c8cbbfc89eb336e2e2bd6ad6a63ee F test/spellfix.test 951a6405d49d1a23d6b78027d3877b4a33eeb8221dcab5704b499755bb4f552e F test/spellfix2.test dfc8f519a3fc204cb2dfa8b4f29821ae90f6f8c3 F test/spellfix3.test 0f9efaaa502a0e0a09848028518a6fb096c8ad33 @@ -1716,7 +1716,7 @@ F test/temptable3.test d11a0974e52b347e45ee54ef1923c91ed91e4637 F test/temptrigger.test 38f0ca479b1822d3117069e014daabcaacefffcc F test/tester.tcl 7b44f1a9b9a2de8112695b908afc21dd9a68cd2d44e84b73f1b27b53492c0d59 F test/testrunner.tcl 3dd75b45593d2afa2e3bca76121297a9f163bebb98474b13536f326829a71db1 x -F test/testrunner_data.tcl dbc0bb1c5b912dfd1e32b25d544318e412edd6085bd5fc9e6619cb93a739b786 +F test/testrunner_data.tcl c7b3b911e44f7e8c01cc6bc7571e16115cdc2e4db46630bd2acd7a931a46380e F test/thread001.test a0985c117eab62c0c65526e9fa5d1360dd1cac5b03bde223902763274ce21899 F test/thread002.test c24c83408e35ba5a952a3638b7ac03ccdf1ce4409289c54a050ac4c5f1de7502 F test/thread003.test ee4c9efc3b86a6a2767516a37bd64251272560a7 @@ -2165,7 +2165,7 @@ F tool/showstat4.c 0682ebea7abf4d3657f53c4a243f2e7eab48eab344ed36a94bb75dcd19a5c F tool/showwal.c 11eca547980a066b081f512636151233350ac679f29ecf4ebfce7f4530230b3d F tool/soak1.tcl 8d407956e1a45b485a8e072470a3e629a27037fe F tool/spaceanal.tcl 1f83962090a6b60e1d7bf92495d643e622bef9fe82ea3f2d22350dcbce9a12d0 -F tool/speed-check.sh e8d20cc2eb9c85ec1ba562226de144435456dcdff4ee618de49603c6958f6116 +F tool/speed-check.sh e566ab3934d7d78631743a984ad3f67c331c911bb18ff5d0a6c616a2afee7f91 F tool/speedtest.tcl 06c76698485ccf597b9e7dbb1ac70706eb873355 F tool/speedtest16.c ecb6542862151c3e6509bbc00509b234562ae81e F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff @@ -2213,8 +2213,11 @@ F vsixtest/vsixtest.tcl 6195aba1f12a5e10efc2b8c0009532167be5e301abe5b31385638080 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P 1755831cb1ac58241e0b11d8d003b5eca39b65aa3cb84229b215662028b1b3c0 -R aec30d14f5d302123caffa8ac548b88e +P 98066e2d226e7d2eceec1931a1432baea956f49bf3c708d8a6d511fa4e864ca3 +R e46e6a9a210c9b73f42cca2feacde577 +T *branch * omit-long-double +T *sym-omit-long-double * +T -sym-trunk * U drh -Z 3d8c02a9a1123f16b58018bc4d458ba9 +Z a2f14f0f092d0810a1e1643e01967575 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 19cf9165e2..85854fe7bb 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -98066e2d226e7d2eceec1931a1432baea956f49bf3c708d8a6d511fa4e864ca3 +f622b52024c8bec1d241b1dc480fbbd839fc1af50b6220f012812503de2c656e diff --git a/src/global.c b/src/global.c index 121b3f6d6b..b4864a446c 100644 --- a/src/global.c +++ b/src/global.c @@ -243,7 +243,6 @@ SQLITE_WSD struct Sqlite3Config sqlite3Config = { SQLITE_ALLOW_COVERING_INDEX_SCAN, /* bUseCis */ 0, /* bSmallMalloc */ 1, /* bExtraSchemaChecks */ - sizeof(LONGDOUBLE_TYPE)>8, /* bUseLongDouble */ #ifdef SQLITE_DEBUG 0, /* bJsonSelfcheck */ #endif diff --git a/src/main.c b/src/main.c index bd0cbc731a..4ed7e08cbd 100644 --- a/src/main.c +++ b/src/main.c @@ -159,33 +159,6 @@ char *sqlite3_temp_directory = 0; */ char *sqlite3_data_directory = 0; -#if !defined(SQLITE_OMIT_WSD) && !defined(SQLITE_USE_LONG_DOUBLE) -/* -** Determine whether or not high-precision (long double) floating point -** math works correctly on CPU currently running. -*/ -static SQLITE_NOINLINE int hasHighPrecisionDouble(int rc){ - if( sizeof(LONGDOUBLE_TYPE)<=8 ){ - /* If the size of "long double" is not more than 8, then - ** high-precision math is not possible. */ - return 0; - }else{ - /* Just because sizeof(long double)>8 does not mean that the underlying - ** hardware actually supports high-precision floating point. For example, - ** clearing the 0x100 bit in the floating-point control word on Intel - ** processors will make long double work like double, even though long - ** double takes up more space. The only way to determine if long double - ** actually works is to run an experiment. */ - LONGDOUBLE_TYPE a, b, c; - rc++; - a = 1.0+rc*0.1; - b = 1.0e+18+rc*25.0; - c = a+b; - return b!=c; - } -} -#endif /* !SQLITE_OMIT_WSD && !SQLITE_USE_LONG_DOUBLE */ - /* ** Initialize SQLite. ** @@ -380,11 +353,6 @@ int sqlite3_initialize(void){ rc = SQLITE_EXTRA_INIT(0); } #endif - -#if !defined(SQLITE_OMIT_WSD) && !defined(SQLITE_USE_LONG_DOUBLE) - sqlite3Config.bUseLongDouble = hasHighPrecisionDouble(rc); -#endif - return rc; } @@ -4637,30 +4605,6 @@ int sqlite3_test_control(int op, ...){ break; } -#if !defined(SQLITE_OMIT_WSD) - /* sqlite3_test_control(SQLITE_TESTCTRL_USELONGDOUBLE, int X); - ** - ** X<0 Make no changes to the bUseLongDouble. Just report value. - ** X==0 Disable bUseLongDouble - ** X==1 Enable bUseLongDouble - ** X>=2 Set bUseLongDouble to its default value for this platform - ** - ** If the SQLITE_USE_LONG_DOUBLE compile-time option has been used, then - ** the bUseLongDouble setting is fixed. This test-control becomes a - ** no-op, except that it still reports the fixed setting. - */ - case SQLITE_TESTCTRL_USELONGDOUBLE: { -#if !defined(SQLITE_USE_LONG_DOUBLE) - int b = va_arg(ap, int); - if( b>=2 ) b = hasHighPrecisionDouble(b); - if( b>=0 ) sqlite3Config.bUseLongDouble = b>0; -#endif - rc = SqliteUseLongDouble!=0; - break; - } -#endif - - #if defined(SQLITE_DEBUG) && !defined(SQLITE_OMIT_WSD) /* sqlite3_test_control(SQLITE_TESTCTRL_TUNE, id, *piValue) ** diff --git a/src/shell.c.in b/src/shell.c.in index 35b9b089fa..140fd0d9de 100644 --- a/src/shell.c.in +++ b/src/shell.c.in @@ -11257,7 +11257,6 @@ static int do_meta_command(char *zLine, ShellState *p){ {"seek_count", SQLITE_TESTCTRL_SEEK_COUNT, 0, "" }, {"sorter_mmap", SQLITE_TESTCTRL_SORTER_MMAP, 0, "NMAX" }, {"tune", SQLITE_TESTCTRL_TUNE, 1, "ID VALUE" }, - {"uselongdouble", SQLITE_TESTCTRL_USELONGDOUBLE,0,"?BOOLEAN|\"default\"?"}, }; int testctrl = -1; int iCtrl = -1; @@ -11491,21 +11490,6 @@ static int do_meta_command(char *zLine, ShellState *p){ } break; - /* sqlite3_test_control(int, int) */ - case SQLITE_TESTCTRL_USELONGDOUBLE: { - int opt = -1; - if( nArg==3 ){ - if( cli_strcmp(azArg[2],"default")==0 ){ - opt = 2; - }else{ - opt = booleanValue(azArg[2]); - } - } - rc2 = sqlite3_test_control(testctrl, opt); - isOk = 1; - break; - } - /* sqlite3_test_control(sqlite3*) */ case SQLITE_TESTCTRL_INTERNAL_FUNCTIONS: rc2 = sqlite3_test_control(testctrl, p->db); diff --git a/src/sqlite.h.in b/src/sqlite.h.in index 72190beec5..4fff4b7508 100644 --- a/src/sqlite.h.in +++ b/src/sqlite.h.in @@ -8368,7 +8368,7 @@ int sqlite3_test_control(int op, ...); #define SQLITE_TESTCTRL_TRACEFLAGS 31 #define SQLITE_TESTCTRL_TUNE 32 #define SQLITE_TESTCTRL_LOGEST 33 -#define SQLITE_TESTCTRL_USELONGDOUBLE 34 +#define SQLITE_TESTCTRL_USELONGDOUBLE 34 /* NOT USED */ #define SQLITE_TESTCTRL_LAST 34 /* Largest TESTCTRL */ /* diff --git a/src/sqliteInt.h b/src/sqliteInt.h index 5b166d9a36..2b800abd95 100644 --- a/src/sqliteInt.h +++ b/src/sqliteInt.h @@ -660,7 +660,6 @@ # define float sqlite_int64 # define fabs(X) ((X)<0?-(X):(X)) # define sqlite3IsOverflow(X) 0 -# define LONGDOUBLE_TYPE sqlite_int64 # ifndef SQLITE_BIG_DBL # define SQLITE_BIG_DBL (((sqlite3_int64)1)<<50) # endif @@ -835,9 +834,6 @@ # define INT8_TYPE signed char # endif #endif -#ifndef LONGDOUBLE_TYPE -# define LONGDOUBLE_TYPE long double -#endif typedef sqlite_int64 i64; /* 8-byte signed integer */ typedef sqlite_uint64 u64; /* 8-byte unsigned integer */ typedef UINT32_TYPE u32; /* 4-byte unsigned integer */ @@ -4249,41 +4245,6 @@ typedef struct { # define Tuning(X) 0 #endif -/* By default, SQLite will use long double if the long double type -** actually provides higher resolution than double. This use or non-use -** of long double is switchable at run-time by a test-control. Dekker -** algorithms are used for high-precision floating point when long double -** is not available. -** -** Having the run-time option to enable/disable long double support -** causes problems for some compiler tool chains. So the following -** compile-time option is available to permanently enable/disable the use -** of long double. -** -** -DSQLITE_USE_LONG_DOUBLE=0 Omit all use of "long double" from -** the code. Instead, the Dekker algorithm -** is always used when high-precision -** floating point is required. -** -** -DSQLITE_USE_LONG_DOUBLE=1 Always use long double when high -** precision is needed. Never fall back -** to using Dekker algorithms. -** -** If the SQLITE_USE_LONG_DOUBLE macro is not defined, then the determination -** of whether or not to use long double is made at run-time. -*/ -#ifndef SQLITE_USE_LONG_DOUBLE -# define SqliteUseLongDouble sqlite3Config.bUseLongDouble -#elif SQLITE_USE_LONG_DOUBLE+0==1 -# define SqliteUseLongDouble 1 -#elif SQLITE_USE_LONG_DOUBLE+0==0 -# undef LONGDOUBLE_TYPE -# define LONGDOUBLE_TYPE double -# define SqliteUseLongDouble 0 -#else -# error "SQLITE_USE_LONG_DOUBLE should be set to either 0 or 1" -#endif - /* ** Structure containing global configuration data for the SQLite library. ** @@ -4297,7 +4258,6 @@ struct Sqlite3Config { u8 bUseCis; /* Use covering indices for full-scans */ u8 bSmallMalloc; /* Avoid large memory allocations if true */ u8 bExtraSchemaChecks; /* Verify type,name,tbl_name in schema */ - u8 bUseLongDouble; /* Make use of long double */ #ifdef SQLITE_DEBUG u8 bJsonSelfcheck; /* Double-check JSON parsing */ #endif diff --git a/src/test1.c b/src/test1.c index 38ea6229ee..5af066c6b2 100644 --- a/src/test1.c +++ b/src/test1.c @@ -7313,37 +7313,6 @@ static int SQLITE_TCLAPI extra_schema_checks( return TCL_OK; } -/* -** tclcmd: use_long_double BOOLEAN|"default" -** -** If no argument, report the current value of the use-long-double flag. -** -** If argument is "default", set the use-long-double flag to the default -** value for this build, based on the size of LONGDOUBLE_TYPE. -** -** If argument is a boolean, set the use-long-double flag accordingly. -** -** Return the new setting. -*/ -static int SQLITE_TCLAPI use_long_double( - ClientData clientData, /* Pointer to sqlite3_enable_XXX function */ - Tcl_Interp *interp, /* The TCL interpreter that invoked this command */ - int objc, /* Number of arguments */ - Tcl_Obj *CONST objv[] /* Command arguments */ -){ - int i = -1; - if( objc==2 ){ - if( strcmp(Tcl_GetString(objv[1]),"default")==0 ){ - i = 2; - }else{ - if( Tcl_GetBooleanFromObj(interp,objv[1],&i) ) return TCL_ERROR; - } - } - i = sqlite3_test_control(SQLITE_TESTCTRL_USELONGDOUBLE, i); - Tcl_SetObjResult(interp, Tcl_NewIntObj(i)); - return TCL_OK; -} - /* ** tclcmd: database_may_be_corrupt ** @@ -9150,7 +9119,6 @@ int Sqlitetest1_Init(Tcl_Interp *interp){ { "reset_prng_state", reset_prng_state, 0 }, { "prng_seed", prng_seed, 0 }, { "extra_schema_checks", extra_schema_checks, 0}, - { "use_long_double", use_long_double, 0}, { "database_never_corrupt", database_never_corrupt, 0}, { "database_may_be_corrupt", database_may_be_corrupt, 0}, { "optimization_control", optimization_control,0}, @@ -9299,7 +9267,6 @@ int Sqlitetest1_Init(Tcl_Interp *interp){ #endif }; static int bitmask_size = sizeof(Bitmask)*8; - static int longdouble_size = sizeof(LONGDOUBLE_TYPE); int i; extern int sqlite3_sync_count, sqlite3_fullsync_count; extern int sqlite3_opentemp_count; @@ -9400,8 +9367,6 @@ int Sqlitetest1_Init(Tcl_Interp *interp){ (char*)&sqlite3_data_directory, TCL_LINK_STRING); Tcl_LinkVar(interp, "bitmask_size", (char*)&bitmask_size, TCL_LINK_INT|TCL_LINK_READ_ONLY); - Tcl_LinkVar(interp, "longdouble_size", - (char*)&longdouble_size, TCL_LINK_INT|TCL_LINK_READ_ONLY); Tcl_LinkVar(interp, "sqlite_sync_count", (char*)&sqlite3_sync_count, TCL_LINK_INT); Tcl_LinkVar(interp, "sqlite_fullsync_count", diff --git a/src/test_config.c b/src/test_config.c index 49527861a4..ad315c723c 100644 --- a/src/test_config.c +++ b/src/test_config.c @@ -512,10 +512,6 @@ static void set_options(Tcl_Interp *interp){ Tcl_SetVar2(interp, "sqlite_options", "lookaside", "1", TCL_GLOBAL_ONLY); #endif -Tcl_SetVar2(interp, "sqlite_options", "long_double", - sizeof(LONGDOUBLE_TYPE)>sizeof(double) ? "1" : "0", - TCL_GLOBAL_ONLY); - #ifdef SQLITE_OMIT_MEMORYDB Tcl_SetVar2(interp, "sqlite_options", "memorydb", "0", TCL_GLOBAL_ONLY); #else diff --git a/src/util.c b/src/util.c index 6725306eda..9ad294016a 100644 --- a/src/util.c +++ b/src/util.c @@ -458,7 +458,6 @@ u8 sqlite3StrIHash(const char *z){ return h; } -#if !defined(SQLITE_USE_LONG_DOUBLE) || SQLITE_USE_LONG_DOUBLE+0==0 /* Double-Double multiplication. (x[0],x[1]) *= (y,yy) ** ** Reference: @@ -494,9 +493,6 @@ static void dekkerMul2(volatile double *x, double y, double yy){ x[1] = c - x[0]; x[1] += cc; } -#else -# define dekkerMul2(A,B,C) /* No-op if SqliteUseLongDouble is always true */ -#endif /* ** The string z[] is an text representation of a real number. @@ -543,6 +539,8 @@ int sqlite3AtoF(const char *z, double *pResult, int length, u8 enc){ int eValid = 1; /* True exponent is either not used or is well-formed */ int nDigit = 0; /* Number of digits processed */ int eType = 1; /* 1: pure integer, 2+: fractional -1 or less: bad UTF16 */ + double rr[2]; + u64 s2; assert( enc==SQLITE_UTF8 || enc==SQLITE_UTF16LE || enc==SQLITE_UTF16BE ); *pResult = 0.0; /* Default return value, in case of an error */ @@ -654,68 +652,41 @@ do_atof_calc: e++; } - if( e==0 ){ - *pResult = s; - }else if( SqliteUseLongDouble ){ - LONGDOUBLE_TYPE r = (LONGDOUBLE_TYPE)s; - if( e>0 ){ - while( e>=100 ){ e-=100; r *= 1.0e+100L; } - while( e>=10 ){ e-=10; r *= 1.0e+10L; } - while( e>=1 ){ e-=1; r *= 1.0e+01L; } - }else{ - while( e<=-100 ){ e+=100; r *= 1.0e-100L; } - while( e<=-10 ){ e+=10; r *= 1.0e-10L; } - while( e<=-1 ){ e+=1; r *= 1.0e-01L; } - } - assert( r>=0.0 ); - if( r>+1.7976931348623157081452742373e+308L ){ -#ifdef INFINITY - *pResult = +INFINITY; -#else - *pResult = 1.0e308*10.0; + rr[0] = (double)s; + s2 = (u64)rr[0]; +#if defined(_MSC_VER) && _MSC_VER<1700 + if( s2==0x8000000000000000LL ){ s2 = 2*(u64)(0.5*rr[0]); } #endif - }else{ - *pResult = (double)r; + rr[1] = s>=s2 ? (double)(s - s2) : -(double)(s2 - s); + if( e>0 ){ + while( e>=100 ){ + e -= 100; + dekkerMul2(rr, 1.0e+100, -1.5902891109759918046e+83); + } + while( e>=10 ){ + e -= 10; + dekkerMul2(rr, 1.0e+10, 0.0); + } + while( e>=1 ){ + e -= 1; + dekkerMul2(rr, 1.0e+01, 0.0); } }else{ - double rr[2]; - u64 s2; - rr[0] = (double)s; - s2 = (u64)rr[0]; -#if defined(_MSC_VER) && _MSC_VER<1700 - if( s2==0x8000000000000000LL ){ s2 = 2*(u64)(0.5*rr[0]); } -#endif - rr[1] = s>=s2 ? (double)(s - s2) : -(double)(s2 - s); - if( e>0 ){ - while( e>=100 ){ - e -= 100; - dekkerMul2(rr, 1.0e+100, -1.5902891109759918046e+83); - } - while( e>=10 ){ - e -= 10; - dekkerMul2(rr, 1.0e+10, 0.0); - } - while( e>=1 ){ - e -= 1; - dekkerMul2(rr, 1.0e+01, 0.0); - } - }else{ - while( e<=-100 ){ - e += 100; - dekkerMul2(rr, 1.0e-100, -1.99918998026028836196e-117); - } - while( e<=-10 ){ - e += 10; - dekkerMul2(rr, 1.0e-10, -3.6432197315497741579e-27); - } - while( e<=-1 ){ - e += 1; - dekkerMul2(rr, 1.0e-01, -5.5511151231257827021e-18); - } + while( e<=-100 ){ + e += 100; + dekkerMul2(rr, 1.0e-100, -1.99918998026028836196e-117); + } + while( e<=-10 ){ + e += 10; + dekkerMul2(rr, 1.0e-10, -3.6432197315497741579e-27); + } + while( e<=-1 ){ + e += 1; + dekkerMul2(rr, 1.0e-01, -5.5511151231257827021e-18); } - *pResult = rr[0]+rr[1]; - if( sqlite3IsNaN(*pResult) ) *pResult = 1e300*1e300; } + *pResult = rr[0]+rr[1]; + if( sqlite3IsNaN(*pResult) ) *pResult = 1e300*1e300; if( sign<0 ) *pResult = -*pResult; assert( !sqlite3IsNaN(*pResult) ); @@ -1036,9 +1007,10 @@ void sqlite3FpDecode(FpDecode *p, double r, int iRound, int mxRound){ int i; u64 v; int e, exp = 0; + double rr[2]; + p->isSpecial = 0; p->z = p->zBuf; - assert( mxRound>0 ); /* Convert negative numbers to positive. Deal with Infinity, 0.0, and @@ -1066,62 +1038,45 @@ void sqlite3FpDecode(FpDecode *p, double r, int iRound, int mxRound){ /* Multiply r by powers of ten until it lands somewhere in between ** 1.0e+19 and 1.0e+17. + ** + ** Use Dekker-style double-double computation to increase the + ** precision. + ** + ** The error terms on constants like 1.0e+100 computed using the + ** decimal extension, for example as follows: + ** + ** SELECT decimal_exp(decimal_sub('1.0e+100',decimal(1.0e+100))); */ - if( SqliteUseLongDouble ){ - LONGDOUBLE_TYPE rr = r; - if( rr>=1.0e+19 ){ - while( rr>=1.0e+119L ){ exp+=100; rr *= 1.0e-100L; } - while( rr>=1.0e+29L ){ exp+=10; rr *= 1.0e-10L; } - while( rr>=1.0e+19L ){ exp++; rr *= 1.0e-1L; } - }else{ - while( rr<1.0e-97L ){ exp-=100; rr *= 1.0e+100L; } - while( rr<1.0e+07L ){ exp-=10; rr *= 1.0e+10L; } - while( rr<1.0e+17L ){ exp--; rr *= 1.0e+1L; } + rr[0] = r; + rr[1] = 0.0; + if( rr[0]>9.223372036854774784e+18 ){ + while( rr[0]>9.223372036854774784e+118 ){ + exp += 100; + dekkerMul2(rr, 1.0e-100, -1.99918998026028836196e-117); + } + while( rr[0]>9.223372036854774784e+28 ){ + exp += 10; + dekkerMul2(rr, 1.0e-10, -3.6432197315497741579e-27); + } + while( rr[0]>9.223372036854774784e+18 ){ + exp += 1; + dekkerMul2(rr, 1.0e-01, -5.5511151231257827021e-18); } - v = (u64)rr; }else{ - /* If high-precision floating point is not available using "long double", - ** then use Dekker-style double-double computation to increase the - ** precision. - ** - ** The error terms on constants like 1.0e+100 computed using the - ** decimal extension, for example as follows: - ** - ** SELECT decimal_exp(decimal_sub('1.0e+100',decimal(1.0e+100))); - */ - double rr[2]; - rr[0] = r; - rr[1] = 0.0; - if( rr[0]>9.223372036854774784e+18 ){ - while( rr[0]>9.223372036854774784e+118 ){ - exp += 100; - dekkerMul2(rr, 1.0e-100, -1.99918998026028836196e-117); - } - while( rr[0]>9.223372036854774784e+28 ){ - exp += 10; - dekkerMul2(rr, 1.0e-10, -3.6432197315497741579e-27); - } - while( rr[0]>9.223372036854774784e+18 ){ - exp += 1; - dekkerMul2(rr, 1.0e-01, -5.5511151231257827021e-18); - } - }else{ - while( rr[0]<9.223372036854774784e-83 ){ - exp -= 100; - dekkerMul2(rr, 1.0e+100, -1.5902891109759918046e+83); - } - while( rr[0]<9.223372036854774784e+07 ){ - exp -= 10; - dekkerMul2(rr, 1.0e+10, 0.0); - } - while( rr[0]<9.22337203685477478e+17 ){ - exp -= 1; - dekkerMul2(rr, 1.0e+01, 0.0); - } + while( rr[0]<9.223372036854774784e-83 ){ + exp -= 100; + dekkerMul2(rr, 1.0e+100, -1.5902891109759918046e+83); + } + while( rr[0]<9.223372036854774784e+07 ){ + exp -= 10; + dekkerMul2(rr, 1.0e+10, 0.0); + } + while( rr[0]<9.22337203685477478e+17 ){ + exp -= 1; + dekkerMul2(rr, 1.0e+01, 0.0); } - v = rr[1]<0.0 ? (u64)rr[0]-(u64)(-rr[1]) : (u64)rr[0]+(u64)rr[1]; } - + v = rr[1]<0.0 ? (u64)rr[0]-(u64)(-rr[1]) : (u64)rr[0]+(u64)rr[1]; /* Extract significant digits. */ i = sizeof(p->zBuf)-1; diff --git a/src/vdbeaux.c b/src/vdbeaux.c index 5ff4ca928c..8120536b98 100644 --- a/src/vdbeaux.c +++ b/src/vdbeaux.c @@ -4512,13 +4512,9 @@ SQLITE_NOINLINE int sqlite3BlobCompare(const Mem *pB1, const Mem *pB2){ ** We must use separate SQLITE_NOINLINE functions here, since otherwise ** optimizer code movement causes gcov to become very confused. */ -#if (defined(SQLITE_COVERAGE_TEST) || defined(SQLITE_DEBUG)) \ - && (!defined(SQLITE_USE_LONG_DOUBLE) || SQLITE_USE_LONG_DOUBLE+0==0) +#if defined(SQLITE_COVERAGE_TEST) || defined(SQLITE_DEBUG) static int SQLITE_NOINLINE doubleLt(double a, double b){ return ar ); - testcase( x==r ); - return (xr); }else{ i64 y; if( r<-9223372036854775808.0 ) return +1; diff --git a/test/atof1.test b/test/atof1.test index 95f443ce0d..1a5db2cc79 100644 --- a/test/atof1.test +++ b/test/atof1.test @@ -15,7 +15,7 @@ set testdir [file dirname $argv0] source $testdir/tester.tcl -set mxpow [expr {[use_long_double]?100:35}] +set mxpow 35 expr srand(1) for {set i 1} {$i<20000} {incr i} { set pow [expr {int((rand()-0.5)*$mxpow)}] diff --git a/test/cast.test b/test/cast.test index 7f48ed80bf..1c9071d775 100644 --- a/test/cast.test +++ b/test/cast.test @@ -262,11 +262,9 @@ do_test cast-3.12 { do_realnum_test cast-3.13 { execsql {SELECT CAST('9223372036854774800' AS real)} } 9.22337203685477e+18 -ifcapable long_double { - do_test cast-3.14 { - execsql {SELECT CAST(CAST('9223372036854774800' AS real) AS integer)} - } 9223372036854774784 -} +do_test cast-3.14 { + execsql {SELECT CAST(CAST('9223372036854774800' AS real) AS integer)} +} 9223372036854774784 do_test cast-3.15 { execsql {SELECT CAST('-9223372036854774800' AS integer)} } -9223372036854774800 @@ -276,11 +274,9 @@ do_test cast-3.16 { do_realnum_test cast-3.17 { execsql {SELECT CAST('-9223372036854774800' AS real)} } -9.22337203685477e+18 -ifcapable long_double { - do_test cast-3.18 { - execsql {SELECT CAST(CAST('-9223372036854774800' AS real) AS integer)} - } -9223372036854774784 -} +do_test cast-3.18 { + execsql {SELECT CAST(CAST('-9223372036854774800' AS real) AS integer)} +} -9223372036854774784 if {[db eval {PRAGMA encoding}]=="UTF-8"} { do_test cast-3.21 { execsql {SELECT CAST(x'39323233333732303336383534373734383030' AS integer)} @@ -291,14 +287,12 @@ if {[db eval {PRAGMA encoding}]=="UTF-8"} { do_realnum_test cast-3.23 { execsql {SELECT CAST(x'39323233333732303336383534373734383030' AS real)} } 9.22337203685477e+18 - ifcapable long_double { - do_test cast-3.24 { - execsql { - SELECT CAST(CAST(x'39323233333732303336383534373734383030' AS real) - AS integer) - } - } 9223372036854774784 - } + do_test cast-3.24 { + execsql { + SELECT CAST(CAST(x'39323233333732303336383534373734383030' AS real) + AS integer) + } + } 9223372036854774784 } do_test cast-3.31 { execsql {SELECT CAST(NULL AS numeric)} diff --git a/test/fp-speed-1.c b/test/fp-speed-1.c index 5eeb95d348..cb4e0409c3 100644 --- a/test/fp-speed-1.c +++ b/test/fp-speed-1.c @@ -12,7 +12,6 @@ ** ** time ./a.out 0 10000000 <-- standard library ** time ./a.out 1 10000000 <-- SQLite -** time ./a.out 2 10000000 <-- SQLite with long-double disabled */ static double aVal[] = { -1.0163830486285643089e+063, @@ -150,15 +149,6 @@ int main(int argc, char **argv){ } break; } - case 2: { - printf("Doing %d calls to sqlite3_snprintf() without long double\n", cnt); - sqlite3_test_control(SQLITE_TESTCTRL_USELONGDOUBLE, 0); - for(i=0; i=0 ){ - sqlite3_test_control(SQLITE_TESTCTRL_USELONGDOUBLE, useLongDouble); - } -#endif if( g.nReserve>0 ){ sqlite3_file_control(g.db, 0, SQLITE_FCNTL_RESERVE_BYTES, &g.nReserve); } diff --git a/test/testrunner_data.tcl b/test/testrunner_data.tcl index 78f28bbf8e..98b3669a33 100644 --- a/test/testrunner_data.tcl +++ b/test/testrunner_data.tcl @@ -203,7 +203,6 @@ namespace eval trd { -DSQLITE_MAX_ATTACHED=125 -DSQLITE_MAX_MMAP_SIZE=12884901888 -DSQLITE_ENABLE_SORTER_MMAP=1 - -DLONGDOUBLE_TYPE=double --enable-session } set build(Device-One) { @@ -343,7 +342,6 @@ namespace eval trd { -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_HIDDEN_COLUMNS - -DLONGDOUBLE_TYPE=double -DCONFIG_SLOWDOWN_FACTOR=8.0 } diff --git a/tool/speed-check.sh b/tool/speed-check.sh index 5d425c3b37..8a9e67a38b 100644 --- a/tool/speed-check.sh +++ b/tool/speed-check.sh @@ -99,9 +99,6 @@ while test "$1" != ""; do --stmtcache) shift; SPEEDTEST_OPTS="$SPEEDTEST_OPTS --stmtcache $1" ;; - --nolongdouble) - SPEEDTEST_OPTS="$SPEEDTEST_OPTS --nolongdouble" - ;; --checkpoint) SPEEDTEST_OPTS="$SPEEDTEST_OPTS --checkpoint" ;; From f9d1141a3b34e36cf26be87dbd199b036985b2d6 Mon Sep 17 00:00:00 2001 From: dan Date: Wed, 2 Oct 2024 11:11:00 +0000 Subject: [PATCH 25/34] Update docs for sqlite3_snapshot_get(). FossilOrigin-Name: 78c3892ab777a39406da8a9df84d0634397514e25512b0363a13bff3b8bc8925 --- manifest | 15 ++++++--------- manifest.uuid | 2 +- src/sqlite.h.in | 8 ++++++++ 3 files changed, 15 insertions(+), 10 deletions(-) diff --git a/manifest b/manifest index 83d6936a7d..7342f3b4a1 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C When\spossible,\savoid\staking\swal\sfile\sread-lock\s0\sin\ssqlite3_snapshot_get(). -D 2024-09-26T18:02:17.495 +C Update\sdocs\sfor\ssqlite3_snapshot_get(). +D 2024-10-02T11:11:00.069 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 @@ -769,7 +769,7 @@ F src/resolve.c 9750a281f7ba073b4e6da2be1a6c4071f5d841a7746c5fb3f70d6d793b6675ea F src/rowset.c 8432130e6c344b3401a8874c3cb49fefe6873fec593294de077afea2dce5ec97 F src/select.c 4b14337a2742f0c0beeba490e9a05507e9b4b12184b9cd12773501d08d48e3fe F src/shell.c.in 9b68a945f3aafc78eac1a256a4a588a9310dbc61a0cd60378c5b7a78f789af50 -F src/sqlite.h.in 77f55bd1978a04a14db211732f0a609077cf60ba4ccf9baf39988f508945419c +F src/sqlite.h.in 496f927cf2a687f313c6ac41c03e46f45c8f91c84d8f3ff6607aa9f2794e2ec3 F src/sqlite3.rc 5121c9e10c3964d5755191c80dd1180c122fc3a8 F src/sqlite3ext.h 3f046c04ea3595d6bfda99b781926b17e672fd6d27da2ba6d8d8fc39981dcb54 F src/sqliteInt.h 5978cbb11becc3ce6471015d770d95f694ece06336c496f691df1b02460e9cd5 @@ -2213,11 +2213,8 @@ F vsixtest/vsixtest.tcl 6195aba1f12a5e10efc2b8c0009532167be5e301abe5b31385638080 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P 9592b9ba3ad7a842cdd4c4010da278485a6fdec7e811bda01ebe640162a8c3b6 -R 8553e4183ac33940fe95918021cfe535 -T *branch * snapshot_get-locking -T *sym-snapshot_get-locking * -T -sym-trunk * +P 34b6ac3d76dbc6819778ec2a0f81cbcdcc0cd1a6303381d97f1c479e4ecdd132 +R a30055f90af028e040102b1e9655fa8f U dan -Z 2b5e37766517d26ed8f4d4495c7d929b +Z 068c609e961149f2eac59f5d7b1ce4b0 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 986575a33e..00ceed77c8 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -34b6ac3d76dbc6819778ec2a0f81cbcdcc0cd1a6303381d97f1c479e4ecdd132 +78c3892ab777a39406da8a9df84d0634397514e25512b0363a13bff3b8bc8925 diff --git a/src/sqlite.h.in b/src/sqlite.h.in index 5546793c94..013be20371 100644 --- a/src/sqlite.h.in +++ b/src/sqlite.h.in @@ -10539,6 +10539,14 @@ typedef struct sqlite3_snapshot { ** If there is not already a read-transaction open on schema S when ** this function is called, one is opened automatically. ** +** If a read-transaction is opened by this function, then it is guaranteed +** that the returned snapshot object may not be invalidated by a database +** writer or checkpointer until after the read-transaction is closed. This +** is not guaranteed if a read-transaction is already open when this +** function is called. In that case, any subsequent write or checkpoint +** operation on the database may invalidate the returned snapshot handle, +** even while the read-transaction remains open. +** ** The following must be true for this function to succeed. If any of ** the following statements are false when sqlite3_snapshot_get() is ** called, SQLITE_ERROR is returned. The final value of *P is undefined From 010f9f8704563b904083363d236bd0adcab329d8 Mon Sep 17 00:00:00 2001 From: drh <> Date: Wed, 2 Oct 2024 11:34:11 +0000 Subject: [PATCH 26/34] Remove a few more traces of long double from the code. FossilOrigin-Name: 11d6a89e4a25c3f884ff617036d239dc42522859400cd1f4674634f6c7adbb02 --- ext/wasm/GNUmakefile | 1 - ext/wasm/api/sqlite3-wasm.c | 23 ----------------------- manifest | 19 ++++++++----------- manifest.uuid | 2 +- test/func.test | 3 --- 5 files changed, 9 insertions(+), 39 deletions(-) diff --git a/ext/wasm/GNUmakefile b/ext/wasm/GNUmakefile index a68f813d6b..00f1ee50a7 100644 --- a/ext/wasm/GNUmakefile +++ b/ext/wasm/GNUmakefile @@ -239,7 +239,6 @@ SQLITE_OPT.common := \ '-DSQLITE_DEFAULT_UNIX_VFS="unix-none"' \ -DSQLITE_USE_URI=1 \ -DSQLITE_C=$(sqlite3.c) \ - -DSQLITE_USE_LONG_DOUBLE=0 \ -DSQLITE_OMIT_DEPRECATED \ -DSQLITE_OMIT_UTF16 \ -DSQLITE_OMIT_LOAD_EXTENSION \ diff --git a/ext/wasm/api/sqlite3-wasm.c b/ext/wasm/api/sqlite3-wasm.c index b689b426fb..c5dd495e54 100644 --- a/ext/wasm/api/sqlite3-wasm.c +++ b/ext/wasm/api/sqlite3-wasm.c @@ -127,10 +127,6 @@ # define SQLITE_USE_URI 1 #endif -#ifndef SQLITE_USE_LONG_DOUBLE -# define SQLITE_USE_LONG_DOUBLE 0 -#endif - #ifdef SQLITE_WASM_EXTRA_INIT # define SQLITE_EXTRA_INIT sqlite3_wasm_extra_init #endif @@ -163,8 +159,6 @@ # define SQLITE_OMIT_PROGRESS_CALLBACK # undef SQLITE_OMIT_WAL # define SQLITE_OMIT_WAL -# undef SQLITE_USE_LONG_DOUBLE -# define SQLITE_USE_LONG_DOUBLE 0 /* The following OMITs do not work with the standard amalgamation, so require a custom build: @@ -227,23 +221,6 @@ // See also: //__attribute__((export_name("theExportedName"), used, visibility("default"))) -#if 0 -/* Details at https://sqlite.org/forum/forumpost/cbfb0d0ac0a4e349 -** -** Summary: changing to `double` reduces the wasm file size by a mere -** 2k. It is hypothetically not possible that any clients rely on -** doubles larger than 64-bit because there is no mapping between C -** and JS for them. i.e. we "could" switch LONGDOUBLE_TYPE to double -** for wasm builds with very little risk of problems. Clang 18.1 maps -** `long double` to float128 but Emscripten doesn't (cannot) expose -** that to JS. -** -** See also: SQLITE_USE_LONG_DOUBLE -*/ -#undef LONGDOUBLE_TYPE -#define LONGDOUBLE_TYPE double -#endif - /* ** Which sqlite3.c we're using needs to be configurable to enable ** building against a custom copy, e.g. the SEE variant. Note that we diff --git a/manifest b/manifest index 6f37d1934e..0e151bff01 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Remove\sall\scode\sthat\smakes\suse\sof\sthe\sC-language\s"long\sdouble"\sdatatype. -D 2024-10-01T20:29:43.065 +C Remove\sa\sfew\smore\straces\sof\slong\sdouble\sfrom\sthe\scode. +D 2024-10-02T11:34:11.757 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 @@ -603,7 +603,7 @@ F ext/userauth/sqlite3userauth.h 7f3ea8c4686db8e40b0a0e7a8e0b00fac13aa7a3 F ext/userauth/user-auth.txt ca7e9ee82ca4e1c1744295f8184dd70edfae1992865d26c64303f539eb6c084c F ext/userauth/userauth.c 7f00cded7dcaa5d47f54539b290a43d2e59f4b1eb5f447545fa865f002fc80cb F ext/wasm/EXPORTED_FUNCTIONS.fiddle.in 27450c8b8c70875a260aca55435ec927068b34cef801a96205adb81bdcefc65c -F ext/wasm/GNUmakefile c2ee5993e727dd2c1f0f784f47843fb7af45cebd23626b537bae2d2d8f4a3abd +F ext/wasm/GNUmakefile bfd63f0462ac7e5b814a267e9101b8284d61731574ec673dae3178643cdb89ef F ext/wasm/README-dist.txt 6382cb9548076fca472fb3330bbdba3a55c1ea0b180ff9253f084f07ff383576 F ext/wasm/README.md a8a2962c3aebdf8d2104a9102e336c5554e78fc6072746e5daf9c61514e7d193 F ext/wasm/SQLTester/GNUmakefile e0794f676d55819951bbfae45cc5e8d7818dc460492dc317ce7f0d2eca15caff @@ -632,7 +632,7 @@ F ext/wasm/api/sqlite3-vfs-helper.c-pp.js 3f828cc66758acb40e9c5b4dcfd87fd478a14c F ext/wasm/api/sqlite3-vfs-opfs-sahpool.c-pp.js e529a99b7d5a088284821e2902b20d3404b561126969876997d5a73a656c9199 F ext/wasm/api/sqlite3-vfs-opfs.c-pp.js e99e3d99f736937914527070f00ab13e9391d3f1cef884ab99a64cbcbee8d675 F ext/wasm/api/sqlite3-vtab-helper.c-pp.js e809739d71e8b35dfe1b55d24d91f02d04239e6aef7ca1ea92a15a29e704f616 -F ext/wasm/api/sqlite3-wasm.c 2d4340f2dacd9119e95c470d9c4f392e399feffc292962b855f0a67ffb0fc418 +F ext/wasm/api/sqlite3-wasm.c 83f5e9f998e9fa4261eb84e9f092210e3ffe03895119f5ded0429eb34ab9d2be F ext/wasm/api/sqlite3-worker1-promiser.c-pp.js 46f303ba8ddd1b2f0a391798837beddfa72e8c897038c8047eda49ce7d5ed46b F ext/wasm/api/sqlite3-worker1.c-pp.js 5e8706c2c4af2a57fbcdc02f4e7ef79869971bc21bb8ede777687786ce1c92d5 F ext/wasm/batch-runner-sahpool.html e9a38fdeb36a13eac7b50241dfe7ae066fe3f51f5c0b0151e7baee5fce0d07a7 @@ -1251,7 +1251,7 @@ F test/fts4umlaut.test fcaca4471de7e78c9d1f7e8976e3e8704d7d8ad979d57a739d00f3f75 F test/fts4unicode.test 82a9c16b68ba2f358a856226bb2ee02f81583797bc4744061c54401bf1a0f4c9 F test/fts4upfrom.test f25835162c989dffd5e2ef91ec24c4848cc9973093e2d492d1c7b32afac1b49d F test/full.test 6b3c8fb43c6beab6b95438c1675374b95fab245d -F test/func.test b56905748ce0567c01d60005f3e6ad1af19453d224ba4730ee687d048fd09ef9 +F test/func.test 098d28ecd1284e0625797a981c9dbf7c1664763af2900f96b9716af80e6cbe40 F test/func2.test 69f6ae3751b4ec765bdc3b803c0a255aa0f693f28f44805bef03e6b4a3fd242f F test/func3.test 600a632c305a88f3946d38f9a51efe145c989b2e13bd2b2a488db47fe76bab6a F test/func4.test a02e695f62beb31cb092dccf6873ff97543407fff97a5f3ec4da70b5b337bc84 @@ -2213,11 +2213,8 @@ F vsixtest/vsixtest.tcl 6195aba1f12a5e10efc2b8c0009532167be5e301abe5b31385638080 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P 98066e2d226e7d2eceec1931a1432baea956f49bf3c708d8a6d511fa4e864ca3 -R e46e6a9a210c9b73f42cca2feacde577 -T *branch * omit-long-double -T *sym-omit-long-double * -T -sym-trunk * +P f622b52024c8bec1d241b1dc480fbbd839fc1af50b6220f012812503de2c656e +R 7cb8c5e39f3b0a66c9a6cd2a8aa3a2f9 U drh -Z a2f14f0f092d0810a1e1643e01967575 +Z 479f0ce23bd7d658aebb57b7e11ea9e8 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 85854fe7bb..90f9e11206 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -f622b52024c8bec1d241b1dc480fbbd839fc1af50b6220f012812503de2c656e +11d6a89e4a25c3f884ff617036d239dc42522859400cd1f4674634f6c7adbb02 diff --git a/test/func.test b/test/func.test index a3ecd4e30b..228adcc2d6 100644 --- a/test/func.test +++ b/test/func.test @@ -261,9 +261,6 @@ ifcapable floatingpoint { catchsql {SELECT round(b,2.0) FROM t1 ORDER BY b} } {0 {-2.0 1.23 2.0}} # Verify some values reported on the mailing list. - # Some of these fail on MSVC builds with 64-bit - # long doubles, but not on GCC builds with 80-bit - # long doubles. for {set i 1} {$i<999} {incr i} { set x1 [expr 40222.5 + $i] set x2 [expr 40223.0 + $i] From 3b3f230d9511162e7d8ab00253fb9f515ec1b8fe Mon Sep 17 00:00:00 2001 From: drh <> Date: Wed, 2 Oct 2024 16:55:27 +0000 Subject: [PATCH 27/34] Adjust the new truncation behavior of sqlite_dbpage(N,null) such that it causes the database to be truncated to N-1 pages. This makes more since. An error is raised if N is less than 2. FossilOrigin-Name: 7d5ff86ef7386f4f7f6a956dc0de607e61040d335c9f98d1f71e76a39f4f5e03 --- manifest | 15 +++++++-------- manifest.uuid | 2 +- src/dbpage.c | 5 ++++- tool/sqlite3-rsync.c | 19 +++++++++++-------- 4 files changed, 23 insertions(+), 18 deletions(-) diff --git a/manifest b/manifest index 3aa5a7d760..e28592bcfa 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Remove\sall\suse\sof\sthe\s"long\sdouble"\sdata\stype\sfrom\sSQLite,\sas\shardware\ssupport\nfor\slong\sdouble\sis\sincreasingly\srare\sand\sthe\suse\sof\slong\sdouble\screates\nchallenges\sfor\ssome\scompilers. -D 2024-10-02T13:26:17.391 +C Adjust\sthe\snew\struncation\sbehavior\sof\ssqlite_dbpage(N,null)\ssuch\sthat\sit\scauses\nthe\sdatabase\sto\sbe\struncated\sto\sN-1\spages.\s\sThis\smakes\smore\ssince.\s\sAn\serror\sis\nraised\sif\sN\sis\sless\sthan\s2. +D 2024-10-02T16:55:27.051 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 @@ -714,7 +714,7 @@ F src/callback.c db3a45e376deff6a16c0058163fe0ae2b73a2945f3f408ca32cf74960b28d49 F src/complete.c a3634ab1e687055cd002e11b8f43eb75c17da23e F src/ctime.c b224d3db0f28c4a5f1407c50107a0a8133bd244ff3c7f6f8cedeb896a8cf1b64 F src/date.c 89ce1ff20512a7fa5070ba6e7dd5c171148ca7d580955795bf97c79c2456144a -F src/dbpage.c 12e49515d67d4a59625d71f9aa42499556cfdc2e4f1ea49086e674a7f47f46e5 +F src/dbpage.c 9da735cb2eef4ab6941ddb235c8d2c2764e0bb5bd20f7ca3003be1d4ab8d49c9 F src/dbstat.c 73362c0df0f40ad5523a6f5501224959d0976757b511299bf892313e79d14f5c F src/delete.c 03a77ba20e54f0f42ebd8eddf15411ed6bdb06a2c472ac4b6b336521bf7cea42 F src/expr.c 6d5f2c38fe3ec06a7eac599dac822788b36064124e20112a844e9cd5156cb239 @@ -2174,7 +2174,7 @@ F tool/speedtest8inst1.c 7ce07da76b5e745783e703a834417d725b7d45fd F tool/spellsift.tcl 52b4b04dc4333c7ab024f09d9d66ed6b6f7c6eb00b38497a09f338fa55d40618 x F tool/split-sqlite3c.tcl 5aa60643afca558bc732b1444ae81a522326f91e1dc5665b369c54f09e20de60 F tool/sqldiff.c 2a0987d183027c795ced13d6749061c1d2f38e24eddb428f56fa64c3a8f51e4b -F tool/sqlite3-rsync.c 187b262035c1159b047dbfa1959c168b87b5a153b63465e8c8bd1b54fabf4460 +F tool/sqlite3-rsync.c 2f06f02ee3a28f847b3fb8c0f32e3b3296571e0f8027939b95d32df5edfe1dd9 F tool/sqlite3_analyzer.c.in 348ba349bbdc93c9866439f9f935d7284866a2a4e6898bc906ae1204ade56918 F tool/sqltclsh.c.in 1bcc2e9da58fadf17b0bf6a50e68c1159e602ce057210b655d50bad5aaaef898 F tool/sqltclsh.tcl 862f4cf1418df5e1315b5db3b5ebe88969e2a784525af5fbf9596592f14ed848 @@ -2213,9 +2213,8 @@ F vsixtest/vsixtest.tcl 6195aba1f12a5e10efc2b8c0009532167be5e301abe5b31385638080 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P eb5277e490a9b48c865f2dc449cdb8f1b604e233737e492abb4f2f7101a6715b 11d6a89e4a25c3f884ff617036d239dc42522859400cd1f4674634f6c7adbb02 -R dd2610993cca357884642ff1a0c9d8c4 -T +closed 11d6a89e4a25c3f884ff617036d239dc42522859400cd1f4674634f6c7adbb02 +P 761d8fd18b0ee8681b12998f01a2eca1b796807a5174a1270cfb9bdc841424ac +R afa8cb87d393983234687bde8f6e9625 U drh -Z 3a98d9548ba7ad8d74362f910ad4f724 +Z 3ddb58c2554e681f7603c7c59106deb3 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index dde70a7d00..6b9a9877b2 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -761d8fd18b0ee8681b12998f01a2eca1b796807a5174a1270cfb9bdc841424ac +7d5ff86ef7386f4f7f6a956dc0de607e61040d335c9f98d1f71e76a39f4f5e03 diff --git a/src/dbpage.c b/src/dbpage.c index 42b24f9b8d..136c8b0b39 100644 --- a/src/dbpage.c +++ b/src/dbpage.c @@ -375,7 +375,9 @@ static int dbpageUpdate( if( sqlite3_value_type(argv[3])!=SQLITE_BLOB || sqlite3_value_bytes(argv[3])!=szPage ){ - if( sqlite3_value_type(argv[3])==SQLITE_NULL && isInsert ){ + if( sqlite3_value_type(argv[3])==SQLITE_NULL && isInsert && pgno>1 ){ + /* "INSERT INTO dbpage($PGNO,NULL)" causes page number $PGNO and + ** all subsequent pages to be deleted. */ if( iDb>=pTab->nTrunc ){ testcase( pTab->aTrunc!=0 ); pTab->aTrunc = sqlite3_realloc(pTab->aTrunc, (iDb+1)*sizeof(Pgno)); @@ -387,6 +389,7 @@ static int dbpageUpdate( return SQLITE_NOMEM; } } + pgno--; pTab->aTrunc[iDb] = pgno; }else{ zErr = "bad page value"; diff --git a/tool/sqlite3-rsync.c b/tool/sqlite3-rsync.c index 1be206a758..216390c182 100644 --- a/tool/sqlite3-rsync.c +++ b/tool/sqlite3-rsync.c @@ -1456,15 +1456,18 @@ static void replicaSide(SQLiteRsync *p){ }else if( p->nErr ){ runSql(p, "ROLLBACK"); }else{ - int rc; - sqlite3_bind_int64(pIns, 1, nOPage); - sqlite3_bind_null(pIns, 2); - rc = sqlite3_step(pIns); - if( rc!=SQLITE_DONE ){ - reportError(p, "SQL statement [%s] failed (pgno=%u, data=NULL): %s", - sqlite3_sql(pIns), nOPage, sqlite3_errmsg(p->db)); + if( nOPage<0xffffffff ){ + int rc; + sqlite3_bind_int64(pIns, 1, nOPage+1); + sqlite3_bind_null(pIns, 2); + rc = sqlite3_step(pIns); + if( rc!=SQLITE_DONE ){ + reportError(p, + "SQL statement [%s] failed (pgno=%u, data=NULL): %s", + sqlite3_sql(pIns), nOPage, sqlite3_errmsg(p->db)); + } + sqlite3_reset(pIns); } - sqlite3_reset(pIns); p->nPage = nOPage; runSql(p, "COMMIT"); } From 44b8c37017e25e8cc6a1703b37e47524cba08bcc Mon Sep 17 00:00:00 2001 From: dan Date: Wed, 2 Oct 2024 17:43:06 +0000 Subject: [PATCH 28/34] Fix a typo in fts5delete.test. FossilOrigin-Name: b1f001435eff72c2119ecee973194385f70fd1b66ef0be8a66c0b0ad02ae43df --- ext/fts5/test/fts5delete.test | 3 ++- manifest | 13 ++++++------- manifest.uuid | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/ext/fts5/test/fts5delete.test b/ext/fts5/test/fts5delete.test index c9c55e8a4f..024f89594c 100644 --- a/ext/fts5/test/fts5delete.test +++ b/ext/fts5/test/fts5delete.test @@ -161,8 +161,9 @@ do_execsql_test 4.4 { do_execsql_test 4.5 { SELECT * FROM ft1_content } {1 i 3 iii} + do_execsql_test 4.6 { - SELECT * FROM ft1_content + SELECT * FROM ft2_content } {1 i 3 iii} finish_test diff --git a/manifest b/manifest index 739de72095..2f603be8f6 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Add\sthe\scontentless_unindexed=1\soption\sto\sfts5.\sThis\scauses\sthe\svalues\sof\sany\sUNINDEXED\scolumns\sof\sa\scontentless\sfts5\stable\sto\sbe\sstored\spersistently\sin\sthe\sdatabase. -D 2024-10-02T17:04:30.788 +C Fix\sa\stypo\sin\sfts5delete.test. +D 2024-10-02T17:43:06.145 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 @@ -154,7 +154,7 @@ F ext/fts5/test/fts5corrupt5.test 11b47126f5772cc37b67e3e8b2ed05895c4d07c05338bc F ext/fts5/test/fts5corrupt6.test 2d72db743db7b5d9c9a6d0cfef24d799ed1aa5e8192b66c40e871a37ed9eed06 F ext/fts5/test/fts5corrupt7.test 4e830875c33b9ea3c4cf1ba71e692b63893cbb4faae8c69b1071889dc26e211c F ext/fts5/test/fts5corrupt8.test b81d802e41631e98100f49a1aadeeffef860e30a62d6ed7d743c2797c477239e -F ext/fts5/test/fts5delete.test e5ad73ce7cda1201b15ead1170f0bc6a2402107b4c2b4e8c8d38c3c7a5140739 +F ext/fts5/test/fts5delete.test 2a5008f8b1174ef41d1974e606928c20e4f9da77d9f8347aed818994d89cced4 F ext/fts5/test/fts5detail.test 54015e9c43ec4ba542cfb93268abdf280e0300f350efd08ee411284b03595cc4 F ext/fts5/test/fts5determin.test 1b77879b2ae818b5b71c859e534ee334dac088b7cf3ff3bf76a2c82b1c788d11 F ext/fts5/test/fts5dlidx.test a7c42b0a74dc7c8aa1a46d586e0aadda4b6cc42c24450f8d3774b21166e93159 @@ -2215,9 +2215,8 @@ F vsixtest/vsixtest.tcl 6195aba1f12a5e10efc2b8c0009532167be5e301abe5b31385638080 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P 7d5ff86ef7386f4f7f6a956dc0de607e61040d335c9f98d1f71e76a39f4f5e03 81d48df62ccf8b56e7adbc5327103e8ab5499bb22e587c4f0d0780a66adbdb67 -R a123da90db9c6c32b958de081bea877e -T +closed 81d48df62ccf8b56e7adbc5327103e8ab5499bb22e587c4f0d0780a66adbdb67 +P 58313ac59e0bd164f601d68a1474f658c5d1c038638e00f3dc15eb58202e661c +R c9854e52c5a2262f4abddd59c7216292 U dan -Z 2e9bc797f2c159dea04278d2c7653c83 +Z 46008f325e9f0a47cd9f68f44b346532 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 806f03565e..28469eeaae 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -58313ac59e0bd164f601d68a1474f658c5d1c038638e00f3dc15eb58202e661c +b1f001435eff72c2119ecee973194385f70fd1b66ef0be8a66c0b0ad02ae43df From 46a62afbaba8e4e47d86ce9a03c242aa12402e99 Mon Sep 17 00:00:00 2001 From: drh <> Date: Wed, 2 Oct 2024 18:54:40 +0000 Subject: [PATCH 29/34] Modify the behavior of sqlite_dbpage so that the null-INSERT that truncates a database must be the very last INSERT operation within a transaction in order to be effective. This simplifies the code and also makes the behavior easier to document and understand. FossilOrigin-Name: b869a7d9ce9567a61d2257272032aaee705bbc6158c7f2cd36e7f3ee66d72722 --- manifest | 14 +++++++------- manifest.uuid | 2 +- src/dbpage.c | 48 +++++++++++++++++++----------------------------- 3 files changed, 27 insertions(+), 37 deletions(-) diff --git a/manifest b/manifest index 2f603be8f6..23af5a0848 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Fix\sa\stypo\sin\sfts5delete.test. -D 2024-10-02T17:43:06.145 +C Modify\sthe\sbehavior\sof\ssqlite_dbpage\sso\sthat\sthe\snull-INSERT\sthat\struncates\na\sdatabase\smust\sbe\sthe\svery\slast\sINSERT\soperation\swithin\sa\stransaction\sin\sorder\nto\sbe\seffective.\s\sThis\ssimplifies\sthe\scode\sand\salso\smakes\sthe\sbehavior\neasier\sto\sdocument\sand\sunderstand. +D 2024-10-02T18:54:40.278 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 @@ -716,7 +716,7 @@ F src/callback.c db3a45e376deff6a16c0058163fe0ae2b73a2945f3f408ca32cf74960b28d49 F src/complete.c a3634ab1e687055cd002e11b8f43eb75c17da23e F src/ctime.c b224d3db0f28c4a5f1407c50107a0a8133bd244ff3c7f6f8cedeb896a8cf1b64 F src/date.c 89ce1ff20512a7fa5070ba6e7dd5c171148ca7d580955795bf97c79c2456144a -F src/dbpage.c 9da735cb2eef4ab6941ddb235c8d2c2764e0bb5bd20f7ca3003be1d4ab8d49c9 +F src/dbpage.c 6199d8c8d6d37a405a92a5da4ed9a69829d7453e6d5ea7b852d58d1fd41d549c F src/dbstat.c 73362c0df0f40ad5523a6f5501224959d0976757b511299bf892313e79d14f5c F src/delete.c 03a77ba20e54f0f42ebd8eddf15411ed6bdb06a2c472ac4b6b336521bf7cea42 F src/expr.c 6d5f2c38fe3ec06a7eac599dac822788b36064124e20112a844e9cd5156cb239 @@ -2215,8 +2215,8 @@ F vsixtest/vsixtest.tcl 6195aba1f12a5e10efc2b8c0009532167be5e301abe5b31385638080 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P 58313ac59e0bd164f601d68a1474f658c5d1c038638e00f3dc15eb58202e661c -R c9854e52c5a2262f4abddd59c7216292 -U dan -Z 46008f325e9f0a47cd9f68f44b346532 +P b1f001435eff72c2119ecee973194385f70fd1b66ef0be8a66c0b0ad02ae43df +R cb980b8ea9ae6c90e71d1e6639808d4a +U drh +Z 0bd24346b1d9b6d9280a2c12dd94f943 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 28469eeaae..93c9829452 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -b1f001435eff72c2119ecee973194385f70fd1b66ef0be8a66c0b0ad02ae43df +b869a7d9ce9567a61d2257272032aaee705bbc6158c7f2cd36e7f3ee66d72722 diff --git a/src/dbpage.c b/src/dbpage.c index 136c8b0b39..0a2020883f 100644 --- a/src/dbpage.c +++ b/src/dbpage.c @@ -57,8 +57,8 @@ struct DbpageCursor { struct DbpageTable { sqlite3_vtab base; /* Base class. Must be first */ sqlite3 *db; /* The database */ - int nTrunc; /* Entries in aTrunc[] */ - Pgno *aTrunc; /* Truncation size for each database */ + int iDbTrunc; /* Database to truncate */ + Pgno pgnoTrunc; /* Size to truncate to */ }; /* Columns */ @@ -107,8 +107,6 @@ static int dbpageConnect( ** Disconnect from or destroy a dbpagevfs virtual table. */ static int dbpageDisconnect(sqlite3_vtab *pVtab){ - DbpageTable *pTab = (DbpageTable *)pVtab; - sqlite3_free(pTab->aTrunc); sqlite3_free(pVtab); return SQLITE_OK; } @@ -378,19 +376,9 @@ static int dbpageUpdate( if( sqlite3_value_type(argv[3])==SQLITE_NULL && isInsert && pgno>1 ){ /* "INSERT INTO dbpage($PGNO,NULL)" causes page number $PGNO and ** all subsequent pages to be deleted. */ - if( iDb>=pTab->nTrunc ){ - testcase( pTab->aTrunc!=0 ); - pTab->aTrunc = sqlite3_realloc(pTab->aTrunc, (iDb+1)*sizeof(Pgno)); - if( pTab->aTrunc ){ - int j; - for(j=pTab->nTrunc; jaTrunc[j] = 0; - pTab->nTrunc = iDb+1; - }else{ - return SQLITE_NOMEM; - } - } + pTab->iDbTrunc = iDb; pgno--; - pTab->aTrunc[iDb] = pgno; + pTab->pgnoTrunc = pgno; }else{ zErr = "bad page value"; goto update_fail; @@ -403,6 +391,7 @@ static int dbpageUpdate( if( (rc = sqlite3PagerWrite(pDbPage))==SQLITE_OK && pData ){ unsigned char *aPage = sqlite3PagerGetData(pDbPage); memcpy(aPage, pData, szPage); + pTab->pgnoTrunc = 0; } } sqlite3PagerUnref(pDbPage); @@ -426,29 +415,30 @@ static int dbpageBegin(sqlite3_vtab *pVtab){ Btree *pBt = db->aDb[i].pBt; if( pBt ) (void)sqlite3BtreeBeginTrans(pBt, 1, 0); } - if( pTab->nTrunc>0 ){ - memset(pTab->aTrunc, 0, sizeof(pTab->aTrunc[0])*pTab->nTrunc); - } + pTab->pgnoTrunc = 0; return SQLITE_OK; } /* Invoke sqlite3PagerTruncate() as necessary, just prior to COMMIT */ static int dbpageSync(sqlite3_vtab *pVtab){ - int iDb; DbpageTable *pTab = (DbpageTable *)pVtab; - - for(iDb=0; iDbnTrunc; iDb++){ - if( pTab->aTrunc[iDb]>0 ){ - Btree *pBt = pTab->db->aDb[iDb].pBt; - Pager *pPager = sqlite3BtreePager(pBt); - sqlite3PagerTruncateImage(pPager, pTab->aTrunc[iDb]); - pTab->aTrunc[iDb] = 0; - } + if( pTab->pgnoTrunc>0 ){ + Btree *pBt = pTab->db->aDb[pTab->iDbTrunc].pBt; + Pager *pPager = sqlite3BtreePager(pBt); + sqlite3PagerTruncateImage(pPager, pTab->pgnoTrunc); } + pTab->pgnoTrunc = 0; return SQLITE_OK; } +/* Cancel any pending truncate. +*/ +static dbpageRollbackTo(sqlite3_vtab *pVtab, int notUsed1){ + DbpageTable *pTab = (DbpageTable *)pVtab; + pTab->pgnoTrunc = 0; + (void)notUsed1; +} /* ** Invoke this routine to register the "dbpage" virtual table module @@ -477,7 +467,7 @@ int sqlite3DbpageRegister(sqlite3 *db){ 0, /* xRename */ 0, /* xSavepoint */ 0, /* xRelease */ - 0, /* xRollbackTo */ + dbpageRollbackTo, /* xRollbackTo */ 0, /* xShadowName */ 0 /* xIntegrity */ }; From c51dccbd8bacbe2d25d4285b48820a264f13d572 Mon Sep 17 00:00:00 2001 From: drh <> Date: Thu, 3 Oct 2024 09:53:44 +0000 Subject: [PATCH 30/34] Fix missing return value from the new dbpageRollbackTo() callback. FossilOrigin-Name: d1e0992e1f2885be9725d872b8688806e06788f3d66a70de86255179d93f74d3 --- manifest | 12 ++++++------ manifest.uuid | 2 +- src/dbpage.c | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/manifest b/manifest index 23af5a0848..819246082f 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Modify\sthe\sbehavior\sof\ssqlite_dbpage\sso\sthat\sthe\snull-INSERT\sthat\struncates\na\sdatabase\smust\sbe\sthe\svery\slast\sINSERT\soperation\swithin\sa\stransaction\sin\sorder\nto\sbe\seffective.\s\sThis\ssimplifies\sthe\scode\sand\salso\smakes\sthe\sbehavior\neasier\sto\sdocument\sand\sunderstand. -D 2024-10-02T18:54:40.278 +C Fix\smissing\sreturn\svalue\sfrom\sthe\snew\sdbpageRollbackTo()\scallback. +D 2024-10-03T09:53:44.301 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 @@ -716,7 +716,7 @@ F src/callback.c db3a45e376deff6a16c0058163fe0ae2b73a2945f3f408ca32cf74960b28d49 F src/complete.c a3634ab1e687055cd002e11b8f43eb75c17da23e F src/ctime.c b224d3db0f28c4a5f1407c50107a0a8133bd244ff3c7f6f8cedeb896a8cf1b64 F src/date.c 89ce1ff20512a7fa5070ba6e7dd5c171148ca7d580955795bf97c79c2456144a -F src/dbpage.c 6199d8c8d6d37a405a92a5da4ed9a69829d7453e6d5ea7b852d58d1fd41d549c +F src/dbpage.c 83d8ac377c3dc293ff8b6d36edceffe3b703be954807ae44b1207086e9dff839 F src/dbstat.c 73362c0df0f40ad5523a6f5501224959d0976757b511299bf892313e79d14f5c F src/delete.c 03a77ba20e54f0f42ebd8eddf15411ed6bdb06a2c472ac4b6b336521bf7cea42 F src/expr.c 6d5f2c38fe3ec06a7eac599dac822788b36064124e20112a844e9cd5156cb239 @@ -2215,8 +2215,8 @@ F vsixtest/vsixtest.tcl 6195aba1f12a5e10efc2b8c0009532167be5e301abe5b31385638080 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P b1f001435eff72c2119ecee973194385f70fd1b66ef0be8a66c0b0ad02ae43df -R cb980b8ea9ae6c90e71d1e6639808d4a +P b869a7d9ce9567a61d2257272032aaee705bbc6158c7f2cd36e7f3ee66d72722 +R 7bc0596096bbb333fc73b05e652b41df U drh -Z 0bd24346b1d9b6d9280a2c12dd94f943 +Z 0297a20d69432f196ae033089ef7da4d # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 93c9829452..6a7530fd47 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -b869a7d9ce9567a61d2257272032aaee705bbc6158c7f2cd36e7f3ee66d72722 +d1e0992e1f2885be9725d872b8688806e06788f3d66a70de86255179d93f74d3 diff --git a/src/dbpage.c b/src/dbpage.c index 0a2020883f..76e79f9546 100644 --- a/src/dbpage.c +++ b/src/dbpage.c @@ -434,7 +434,7 @@ static int dbpageSync(sqlite3_vtab *pVtab){ /* Cancel any pending truncate. */ -static dbpageRollbackTo(sqlite3_vtab *pVtab, int notUsed1){ +static int dbpageRollbackTo(sqlite3_vtab *pVtab, int notUsed1){ DbpageTable *pTab = (DbpageTable *)pVtab; pTab->pgnoTrunc = 0; (void)notUsed1; From 1e2834dd45069a664822ae3f75db00b8bf285e39 Mon Sep 17 00:00:00 2001 From: drh <> Date: Thu, 3 Oct 2024 10:06:51 +0000 Subject: [PATCH 31/34] Fix to the previous: The dbpageRollbackTo() method should return SQLITE_OK. FossilOrigin-Name: 4dea7221129350a15df8dee5aabd5567e47adda4d255b65d4ba82fd821913759 --- manifest | 12 ++++++------ manifest.uuid | 2 +- src/dbpage.c | 1 + 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/manifest b/manifest index 819246082f..e6055c8eb3 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Fix\smissing\sreturn\svalue\sfrom\sthe\snew\sdbpageRollbackTo()\scallback. -D 2024-10-03T09:53:44.301 +C Fix\sto\sthe\sprevious:\s\sThe\sdbpageRollbackTo()\smethod\sshould\sreturn\sSQLITE_OK. +D 2024-10-03T10:06:51.322 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 @@ -716,7 +716,7 @@ F src/callback.c db3a45e376deff6a16c0058163fe0ae2b73a2945f3f408ca32cf74960b28d49 F src/complete.c a3634ab1e687055cd002e11b8f43eb75c17da23e F src/ctime.c b224d3db0f28c4a5f1407c50107a0a8133bd244ff3c7f6f8cedeb896a8cf1b64 F src/date.c 89ce1ff20512a7fa5070ba6e7dd5c171148ca7d580955795bf97c79c2456144a -F src/dbpage.c 83d8ac377c3dc293ff8b6d36edceffe3b703be954807ae44b1207086e9dff839 +F src/dbpage.c db1be8adaf1f839ad733c08baeac5c22aa912f7b535865c0c061382602081360 F src/dbstat.c 73362c0df0f40ad5523a6f5501224959d0976757b511299bf892313e79d14f5c F src/delete.c 03a77ba20e54f0f42ebd8eddf15411ed6bdb06a2c472ac4b6b336521bf7cea42 F src/expr.c 6d5f2c38fe3ec06a7eac599dac822788b36064124e20112a844e9cd5156cb239 @@ -2215,8 +2215,8 @@ F vsixtest/vsixtest.tcl 6195aba1f12a5e10efc2b8c0009532167be5e301abe5b31385638080 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P b869a7d9ce9567a61d2257272032aaee705bbc6158c7f2cd36e7f3ee66d72722 -R 7bc0596096bbb333fc73b05e652b41df +P d1e0992e1f2885be9725d872b8688806e06788f3d66a70de86255179d93f74d3 +R 07d0f94fc8d3eb3dc6f1d0e0fdfaf3d3 U drh -Z 0297a20d69432f196ae033089ef7da4d +Z a4eec9783f650abfafca00d3ce1f718c # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 6a7530fd47..e8bc481a7c 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -d1e0992e1f2885be9725d872b8688806e06788f3d66a70de86255179d93f74d3 +4dea7221129350a15df8dee5aabd5567e47adda4d255b65d4ba82fd821913759 diff --git a/src/dbpage.c b/src/dbpage.c index 76e79f9546..a0ee9246dc 100644 --- a/src/dbpage.c +++ b/src/dbpage.c @@ -438,6 +438,7 @@ static int dbpageRollbackTo(sqlite3_vtab *pVtab, int notUsed1){ DbpageTable *pTab = (DbpageTable *)pVtab; pTab->pgnoTrunc = 0; (void)notUsed1; + return SQLITE_OK; } /* From 51bbf0c7b88db09970dd34844180b299db1ce032 Mon Sep 17 00:00:00 2001 From: drh <> Date: Thu, 3 Oct 2024 16:31:08 +0000 Subject: [PATCH 32/34] Unconditionally include <ctype.h> in sqliteInt.h, even in builds where it is not needed. FossilOrigin-Name: 825f01d7e258ac7981f715fd10708560381b079f0e026abc414cf56d16d862da --- manifest | 12 ++++++------ manifest.uuid | 2 +- src/sqliteInt.h | 10 +--------- 3 files changed, 8 insertions(+), 16 deletions(-) diff --git a/manifest b/manifest index e6055c8eb3..dd25afaa33 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Fix\sto\sthe\sprevious:\s\sThe\sdbpageRollbackTo()\smethod\sshould\sreturn\sSQLITE_OK. -D 2024-10-03T10:06:51.322 +C Unconditionally\sinclude\s<ctype.h>\sin\ssqliteInt.h,\seven\sin\sbuilds\swhere\nit\sis\snot\sneeded. +D 2024-10-03T16:31:08.852 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 @@ -774,7 +774,7 @@ F src/shell.c.in 981efe98f98a983c1d0193d18528eb2d765207c0c82b67b610be60f17995a43 F src/sqlite.h.in 8a6dfab34cf3ad687346446a8c930e49132770ac380e8317f1aa3383e86fcaed F src/sqlite3.rc 5121c9e10c3964d5755191c80dd1180c122fc3a8 F src/sqlite3ext.h 3f046c04ea3595d6bfda99b781926b17e672fd6d27da2ba6d8d8fc39981dcb54 -F src/sqliteInt.h 6ffd984ac04b5cfbe03f985a79d4664fe40be1198482add1c3de1137a8d9b86f +F src/sqliteInt.h 989dca8b25ca11f5c52e5a457cc500042c43b0b3e5fea9a12d9020d0350722cd F src/sqliteLimit.h 6878ab64bdeb8c24a1d762d45635e34b96da21132179023338c93f820eee6728 F src/status.c cb11f8589a6912af2da3bb1ec509a94dd8ef27df4d4c1a97e0bcf2309ece972b F src/table.c 0f141b58a16de7e2fbe81c308379e7279f4c6b50eb08efeec5892794a0ba30d1 @@ -2215,8 +2215,8 @@ F vsixtest/vsixtest.tcl 6195aba1f12a5e10efc2b8c0009532167be5e301abe5b31385638080 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P d1e0992e1f2885be9725d872b8688806e06788f3d66a70de86255179d93f74d3 -R 07d0f94fc8d3eb3dc6f1d0e0fdfaf3d3 +P 4dea7221129350a15df8dee5aabd5567e47adda4d255b65d4ba82fd821913759 +R f2244f797434d5d72e0a77b20c024462 U drh -Z a4eec9783f650abfafca00d3ce1f718c +Z 01a73e86129b00ff79017b970432daf9 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index e8bc481a7c..4b29a72009 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -4dea7221129350a15df8dee5aabd5567e47adda4d255b65d4ba82fd821913759 +825f01d7e258ac7981f715fd10708560381b079f0e026abc414cf56d16d862da diff --git a/src/sqliteInt.h b/src/sqliteInt.h index 2b800abd95..0e0035ce60 100644 --- a/src/sqliteInt.h +++ b/src/sqliteInt.h @@ -638,6 +638,7 @@ #include #include #include +#include /* ** Use a macro to replace memcpy() if compiled with SQLITE_INLINE_MEMCPY. @@ -4632,15 +4633,6 @@ int sqlite3CantopenError(int); # define SQLITE_ENABLE_FTS3 1 #endif -/* -** The ctype.h header is needed for non-ASCII systems. It is also -** needed by FTS3 when FTS3 is included in the amalgamation. -*/ -#if !defined(SQLITE_ASCII) || \ - (defined(SQLITE_ENABLE_FTS3) && defined(SQLITE_AMALGAMATION)) -# include -#endif - /* ** The following macros mimic the standard library functions toupper(), ** isspace(), isalnum(), isdigit() and isxdigit(), respectively. The From c8c95f514947b26f522183bfa7c5db76c5df9285 Mon Sep 17 00:00:00 2001 From: dan Date: Fri, 4 Oct 2024 17:02:36 +0000 Subject: [PATCH 33/34] Fix typo in documentation for SQLITE_SUBTYPE. No code changes. FossilOrigin-Name: 6733893f450097e07cbd563d6a46790825fd0689283d60181c09793ce7d5509e --- manifest | 14 +++++++------- manifest.uuid | 2 +- src/sqlite.h.in | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/manifest b/manifest index dd25afaa33..85f652cffa 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Unconditionally\sinclude\s<ctype.h>\sin\ssqliteInt.h,\seven\sin\sbuilds\swhere\nit\sis\snot\sneeded. -D 2024-10-03T16:31:08.852 +C Fix\stypo\sin\sdocumentation\sfor\sSQLITE_SUBTYPE.\sNo\scode\schanges. +D 2024-10-04T17:02:36.758 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 @@ -771,7 +771,7 @@ F src/resolve.c 9750a281f7ba073b4e6da2be1a6c4071f5d841a7746c5fb3f70d6d793b6675ea F src/rowset.c 8432130e6c344b3401a8874c3cb49fefe6873fec593294de077afea2dce5ec97 F src/select.c 4b14337a2742f0c0beeba490e9a05507e9b4b12184b9cd12773501d08d48e3fe F src/shell.c.in 981efe98f98a983c1d0193d18528eb2d765207c0c82b67b610be60f17995a43e -F src/sqlite.h.in 8a6dfab34cf3ad687346446a8c930e49132770ac380e8317f1aa3383e86fcaed +F src/sqlite.h.in 1def838497ad53c81486649ce79821925d1ac20a9843af317a344d507efe116e F src/sqlite3.rc 5121c9e10c3964d5755191c80dd1180c122fc3a8 F src/sqlite3ext.h 3f046c04ea3595d6bfda99b781926b17e672fd6d27da2ba6d8d8fc39981dcb54 F src/sqliteInt.h 989dca8b25ca11f5c52e5a457cc500042c43b0b3e5fea9a12d9020d0350722cd @@ -2215,8 +2215,8 @@ F vsixtest/vsixtest.tcl 6195aba1f12a5e10efc2b8c0009532167be5e301abe5b31385638080 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P 4dea7221129350a15df8dee5aabd5567e47adda4d255b65d4ba82fd821913759 -R f2244f797434d5d72e0a77b20c024462 -U drh -Z 01a73e86129b00ff79017b970432daf9 +P 825f01d7e258ac7981f715fd10708560381b079f0e026abc414cf56d16d862da +R 97cc1dd0446101afb82e95a43b8cd5d1 +U dan +Z 7fafcff3019d45fab79373554fe0a5e2 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 4b29a72009..9b7bdc0c33 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -825f01d7e258ac7981f715fd10708560381b079f0e026abc414cf56d16d862da +6733893f450097e07cbd563d6a46790825fd0689283d60181c09793ce7d5509e diff --git a/src/sqlite.h.in b/src/sqlite.h.in index 27f7a8cfeb..5108d3c1e9 100644 --- a/src/sqlite.h.in +++ b/src/sqlite.h.in @@ -5603,7 +5603,7 @@ int sqlite3_create_window_function( ** This flag instructs SQLite to omit some corner-case optimizations that ** might disrupt the operation of the [sqlite3_value_subtype()] function, ** causing it to return zero rather than the correct subtype(). -** SQL functions that invokes [sqlite3_value_subtype()] should have this +** All SQL functions that invoke [sqlite3_value_subtype()] should have this ** property. If the SQLITE_SUBTYPE property is omitted, then the return ** value from [sqlite3_value_subtype()] might sometimes be zero even though ** a non-zero subtype was specified by the function argument expression. From 706fdeebb834a11fedc5e9473f951af79e6f2d65 Mon Sep 17 00:00:00 2001 From: stephan Date: Sat, 5 Oct 2024 12:02:17 +0000 Subject: [PATCH 34/34] Add ext/wasm to the top-level clean/distclean rules in such a way that any error due to a lack of gmake are ignored. FossilOrigin-Name: 2f7eab381e16760952d1c90a9119d2a217933f0136442d8f6eeb6d95e366ca4f --- Makefile.in | 2 ++ manifest | 14 +++++++------- manifest.uuid | 2 +- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/Makefile.in b/Makefile.in index 6fc821da23..91ba94c1aa 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1663,11 +1663,13 @@ tidy: # clean: tidy rm -rf omittest* testrunner* testdir* + -gmake -C ext/wasm clean # Clean up everything. No exceptions. # distclean: clean rm -f sqlite_cfg.h config.log config.status Makefile $(LIBTOOL) + -gmake -C ext/wasm distclean # # Windows section diff --git a/manifest b/manifest index 85f652cffa..3a576a9093 100644 --- a/manifest +++ b/manifest @@ -1,9 +1,9 @@ -C Fix\stypo\sin\sdocumentation\sfor\sSQLITE_SUBTYPE.\sNo\scode\schanges. -D 2024-10-04T17:02:36.758 +C Add\sext/wasm\sto\sthe\stop-level\sclean/distclean\srules\sin\ssuch\sa\sway\sthat\sany\serror\sdue\sto\sa\slack\sof\sgmake\sare\signored. +D 2024-10-05T12:02:17.445 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 -F Makefile.in 6a826facc78c3c8ad38bf00ed588f6aa3665ccd7a9749b891d20582fc290c77e +F Makefile.in 71c69b6eb6d8a5e2d418ab80d16f3621099d58f8afabe4ab0d7240c5ca57494a F Makefile.linux-gcc f3842a0b1efbfbb74ac0ef60e56b301836d05b4d867d014f714fa750048f1ab6 F Makefile.msc 9c6d80d9d103fa42e931f4c464884a5e577fae8563acc7589bff4e43fbe8f864 F README.md c3c0f19532ce28f6297a71870f3c7b424729f0e6d9ab889616d3587dd2332159 @@ -2215,8 +2215,8 @@ F vsixtest/vsixtest.tcl 6195aba1f12a5e10efc2b8c0009532167be5e301abe5b31385638080 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P 825f01d7e258ac7981f715fd10708560381b079f0e026abc414cf56d16d862da -R 97cc1dd0446101afb82e95a43b8cd5d1 -U dan -Z 7fafcff3019d45fab79373554fe0a5e2 +P 6733893f450097e07cbd563d6a46790825fd0689283d60181c09793ce7d5509e +R 749ae8645be170a25b1c641eade23387 +U stephan +Z c3b0bf3081778b6e6721957f472a53c9 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 9b7bdc0c33..717f299acd 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -6733893f450097e07cbd563d6a46790825fd0689283d60181c09793ce7d5509e +2f7eab381e16760952d1c90a9119d2a217933f0136442d8f6eeb6d95e366ca4f