From 3e205eff8e3a98e2c7f876807c95b5a97cc4dfd2 Mon Sep 17 00:00:00 2001 From: stephan Date: Sat, 20 Sep 2025 22:10:59 +0000 Subject: [PATCH] Add missing sqlite3_vtab::xIntegrity wasm mapping. Correct signatures for the (unused) xDlOpen and xDlError bindings. Disable OPFS-related tests in tester1.js in 64-bit builds. FossilOrigin-Name: a106be90a2dba7476e54dbb4bdf47d0999031dae0ca82d73e51a48dadd6bcdc0 --- ext/wasm/api/sqlite3-vtab-helper.c-pp.js | 1 + ext/wasm/api/sqlite3-wasm.c | 7 ++++--- ext/wasm/tester1.c-pp.js | 8 +++++++- manifest | 16 ++++++++-------- manifest.uuid | 2 +- 5 files changed, 21 insertions(+), 13 deletions(-) diff --git a/ext/wasm/api/sqlite3-vtab-helper.c-pp.js b/ext/wasm/api/sqlite3-vtab-helper.c-pp.js index 73b23eb8ce..2260cf60a0 100644 --- a/ext/wasm/api/sqlite3-vtab-helper.c-pp.js +++ b/ext/wasm/api/sqlite3-vtab-helper.c-pp.js @@ -408,6 +408,7 @@ globalThis.sqlite3ApiBootstrap.initializers.push(function(sqlite3){ if(0===mod.$iVersion){ let v; if('number'===typeof opt.iVersion) v = opt.iVersion; + else if(mod.$xIntegrity) v = 4; else if(mod.$xShadowName) v = 3; else if(mod.$xSavePoint || mod.$xRelease || mod.$xRollbackTo) v = 2; else v = 1; diff --git a/ext/wasm/api/sqlite3-wasm.c b/ext/wasm/api/sqlite3-wasm.c index 9561308135..a6bec9f121 100644 --- a/ext/wasm/api/sqlite3-wasm.c +++ b/ext/wasm/api/sqlite3-wasm.c @@ -1028,8 +1028,8 @@ const char * sqlite3__wasm_enum_json(void){ M(xDelete, "i(ppi)"); M(xAccess, "i(ppip)"); M(xFullPathname, "i(ppip)"); - M(xDlOpen, "p(pp)"); - M(xDlError, "p(pip)"); + M(xDlOpen, "v(pp)"); + M(xDlError, "v(pip)"); M(xDlSym, "p()"); M(xDlClose, "v(pp)"); M(xRandomness, "i(pip)"); @@ -1082,7 +1082,6 @@ const char * sqlite3__wasm_enum_json(void){ } _StructBinder; #undef CurrentStruct - #if SQLITE_WASM_HAS_VTAB #define CurrentStruct sqlite3_vtab StructBinder { @@ -1126,6 +1125,8 @@ const char * sqlite3__wasm_enum_json(void){ M(xRollbackTo, "i(pi)"); // ^^^ v2. v3+ follows... M(xShadowName, "i(s)"); + // ^^^ v3. v4+ follows... + M(xIntegrity, "i(pppip)"); } _StructBinder; #undef CurrentStruct diff --git a/ext/wasm/tester1.c-pp.js b/ext/wasm/tester1.c-pp.js index e42e37d496..43eb2c00e2 100644 --- a/ext/wasm/tester1.c-pp.js +++ b/ext/wasm/tester1.c-pp.js @@ -2541,7 +2541,7 @@ globalThis.sqlite3InitModule = sqlite3InitModule; .assert(tmplMod.$xCreate === tmplMod.$xConnect, "setup() must make these equivalent and "+ "installMethods() must avoid re-compiling identical functions"); - tmplMod.$xCreate = 0 /* make tmplMod eponymous-only */; + tmplMod.$xCreate = wasm.NullPtr /* make tmplMod eponymous-only */; let rc = capi.sqlite3_create_module( this.db, "testvtab", tmplMod, 0 ); @@ -3191,6 +3191,7 @@ globalThis.sqlite3InitModule = sqlite3InitModule; .t({ name: 'OPFS db sanity checks', test: async function(sqlite3){ + if( skipIn64BitBuild('"opfs" vfs') ) return; T.assert(capi.sqlite3_vfs_find('opfs')); const opfs = sqlite3.opfs; const filename = this.opfsDbFile = '/dir/sqlite3-tester1.db'; @@ -3228,6 +3229,7 @@ globalThis.sqlite3InitModule = sqlite3InitModule; .t({ name: 'OPFS import', test: async function(sqlite3){ + if( skipIn64BitBuild('"opfs" vfs import') ) return; let db; const filename = this.opfsDbFile; try { @@ -3265,6 +3267,7 @@ globalThis.sqlite3InitModule = sqlite3InitModule; .t({ name: '(Internal-use) OPFS utility APIs', test: async function(sqlite3){ + if( skipIn64BitBuild('"opfs" internal APIs') ) return; const filename = this.opfsDbFile; const unlink = this.opfsUnlink; T.assert(filename && !!unlink); @@ -3317,6 +3320,7 @@ globalThis.sqlite3InitModule = sqlite3InitModule; .t({ name: 'SAH sanity checks', test: async function(sqlite3){ + if( skipIn64BitBuild('"opfs-sahpool" vfs') ) return; T.assert(!sqlite3.capi.sqlite3_vfs_find(sahPoolConfig.name)) .assert(sqlite3.capi.sqlite3_js_vfs_list().indexOf(sahPoolConfig.name) < 0) const inst = sqlite3.installOpfsSAHPoolVfs, @@ -3347,6 +3351,7 @@ globalThis.sqlite3InitModule = sqlite3InitModule; T.assert(0 === u1.getFileCount()); const dbName = '/foo.db'; + //wasm.xWrap.debug = true; let db = new u1.OpfsSAHPoolDb(dbName); T.assert(db instanceof sqlite3.oo1.DB) .assert(1 === u1.getFileCount()); @@ -3676,6 +3681,7 @@ globalThis.sqlite3InitModule = sqlite3InitModule; predicate: ()=>hasOpfs() || "Requires OPFS to reproduce", //predicate: ()=>false, test: async function(sqlite3){ + if( skipIn64BitBuild('pending repair of opfs') ) return; /* https://sqlite.org/forum/forumpost/cf37d5ff1182c31081 The "opfs" VFS (but not SAHPool) was formerly misbehaving diff --git a/manifest b/manifest index b244c0c6d1..f08056b146 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Reinstate\sthe\sworking-again\scommit/rollback/update\shook\stests.\sThe\sbug\sbreaking\sthose\swas\sthe\sone-letter\schange\sat\sthe\stop\sof\sthis\sdiff. -D 2025-09-20T21:03:28.339 +C Add\smissing\ssqlite3_vtab::xIntegrity\swasm\smapping.\sCorrect\ssignatures\sfor\sthe\s(unused)\sxDlOpen\sand\sxDlError\sbindings.\sDisable\sOPFS-related\stests\sin\stester1.js\sin\s64-bit\sbuilds. +D 2025-09-20T22:10:59.665 F .fossil-settings/binary-glob 61195414528fb3ea9693577e1980230d78a1f8b0a54c78cf1b9b24d0a409ed6a x F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea @@ -606,8 +606,8 @@ F ext/wasm/api/sqlite3-opfs-async-proxy.js 9654b565b346dc609b75d15337f20acfa7af7 F ext/wasm/api/sqlite3-vfs-helper.c-pp.js 3f828cc66758acb40e9c5b4dcfd87fd478a14c8fb7f0630264e6c7fa0e57515d F ext/wasm/api/sqlite3-vfs-opfs-sahpool.c-pp.js 0f68a64e508598910e7c01214ae27d603dfc8baec6a184506fafac603a901931 F ext/wasm/api/sqlite3-vfs-opfs.c-pp.js c4927aed1ed6e814ea16a8cd37fb45f68c199ebc6c8c6ba26a6c98177afdce85 -F ext/wasm/api/sqlite3-vtab-helper.c-pp.js dbe7f773126ded5e641157410e6a2e218888e53e3fb115f35d748ea5257e9a9c -F ext/wasm/api/sqlite3-wasm.c 75c50e7721136b60e2132537e039f6b85991449c761090709c2d920c4b82f420 +F ext/wasm/api/sqlite3-vtab-helper.c-pp.js 729131e48d5c0a757970da167d667ce87e49042e0cc7016da5e95d8af70088b9 +F ext/wasm/api/sqlite3-wasm.c ff2dc011e17b06186b8b35e408626d7ace69a362b92c197a34d78bef25c7105a F ext/wasm/api/sqlite3-worker1-promiser.c-pp.js 4ad256b4ff7f839ad18931ed35d46cced544207bd2209665ec552e193f7f4544 F ext/wasm/api/sqlite3-worker1.c-pp.js 5e8706c2c4af2a57fbcdc02f4e7ef79869971bc21bb8ede777687786ce1c92d5 F ext/wasm/batch-runner-sahpool.html e9a38fdeb36a13eac7b50241dfe7ae066fe3f51f5c0b0151e7baee5fce0d07a7 @@ -655,7 +655,7 @@ F ext/wasm/test-opfs-vfs.html 1f2d672f3f3fce810dfd48a8d56914aba22e45c6834e262555 F ext/wasm/test-opfs-vfs.js 1618670e466f424aa289859fe0ec8ded223e42e9e69b5c851f809baaaca1a00c F ext/wasm/tester1-worker.html ebc4b820a128963afce328ecf63ab200bd923309eb939f4110510ab449e9814c F ext/wasm/tester1.c-pp.html 1c1bc78b858af2019e663b1a31e76657b73dc24bede28ca92fbe917c3a972af2 -F ext/wasm/tester1.c-pp.js d2b125ee226f622ae00c93dea4baae3eacaa6328137622c9a04a8d48c564c6a0 +F ext/wasm/tester1.c-pp.js ac124a04eeb07a88b0193c6a58e8ac0f5e11456a54cafa91db1947d0738d21d8 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 @@ -2175,8 +2175,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7 F tool/warnings.sh 1ad0169b022b280bcaaf94a7fa231591be96b514230ab5c98fbf15cd7df842dd F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 9fd82ebe31993c11e61a47205b7fc17a28283ec96cf278df1b6ea8a196d1fcb1 -R a5eb631217c057235f5f97c2af477c24 +P c582513a77cd1d1d9479e5a4518ddf15ef5a213bed1bfb6af9bd21bf3be41f8a +R 471bdd32696386c08a96366c6671e4f4 U stephan -Z cd6385e618eb05003d04ae0738f14397 +Z f9103108aed0b2ced38cae0ee697d90a # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 639f675454..00f2d0748c 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -c582513a77cd1d1d9479e5a4518ddf15ef5a213bed1bfb6af9bd21bf3be41f8a +a106be90a2dba7476e54dbb4bdf47d0999031dae0ca82d73e51a48dadd6bcdc0 -- 2.47.3