]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Teach kvvf's xClose() and xFileControl() to return more specific result codes for...
authorstephan <stephan@noemail.net>
Wed, 26 Nov 2025 20:18:11 +0000 (20:18 +0000)
committerstephan <stephan@noemail.net>
Wed, 26 Nov 2025 20:18:11 +0000 (20:18 +0000)
FossilOrigin-Name: 6b48375972e6e4112efd51ffea0e54d33a4245bf0155b7fa3ca1e3f147eb043c

ext/wasm/api/sqlite3-vfs-kvvfs.c-pp.js
manifest
manifest.uuid

index cab96bc373d6b94f39115d617b9f1965c8899ea1..7500d171403cdb427384ce5df8c301fb0be81d6d 100644 (file)
@@ -721,7 +721,7 @@ globalThis.sqlite3ApiBootstrap.initializers.push(function(sqlite3){
         let i = 0;
         const npOut = Number(pOut);
         for(; i < nOut; ++i) heap[npOut + i] = (Math.random()*255000) & 0xFF;
-        return i;
+        return nOut;
       },
 
       xGetLastError: function(pVfs,nOut,pOut){
@@ -734,13 +734,14 @@ globalThis.sqlite3ApiBootstrap.initializers.push(function(sqlite3){
             wasm.cstrncpy(pOut, cMsg, nOut);
             if(n > nOut) wasm.poke8(wasm.ptr.add(pOut,nOut,-1), 0);
             debug("set xGetLastError",e.message);
+            return (e.resultCode | 0) || capi.SQLITE_IOERR;
           }catch(e){
             return capi.SQLITE_NOMEM;
           }finally{
             wasm.scopedAllocPop(scope);
           }
         }
-        return e ? ((e.resultCode | 0) || capi.SQLITE_IOERR) : 0;
+        return 0;
       }
 
 //#if nope
@@ -786,7 +787,7 @@ globalThis.sqlite3ApiBootstrap.initializers.push(function(sqlite3){
           return 0;
         }catch(e){
           error("xClose",e);
-          return capi.SQLITE_ERROR;
+          return cache.setError(e);
         }
       },
 
@@ -821,7 +822,7 @@ globalThis.sqlite3ApiBootstrap.initializers.push(function(sqlite3){
           return originalIoMethods(h.file).xFileControl(pFile, opId, pArg);
         }catch(e){
           error("xFileControl",e);
-          return capi.SQLITE_ERROR;
+          return cache.setError(e);
         }
       },
 
index 9139ab8fc91f73553b1039a4674652eea1926180..97661f1d3889fe143563fae051f6150f5814843d 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C kvvfs:\ssilently\sreject\sattempts\sto\schange\sthe\spage\ssize,\sas\schanging\sit\scorrupts\sthis\svfs\sfor\sreasons\snot\syet\sunderstood.\sAdd\smore\skvvfs\stests.
-D 2025-11-26T20:12:29.088
+C Teach\skvvf's\sxClose()\sand\sxFileControl()\sto\sreturn\smore\sspecific\sresult\scodes\sfor\sexceptions.
+D 2025-11-26T20:18:11.986
 F .fossil-settings/binary-glob 61195414528fb3ea9693577e1980230d78a1f8b0a54c78cf1b9b24d0a409ed6a x
 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
@@ -600,7 +600,7 @@ F ext/wasm/api/sqlite3-api-worker1.c-pp.js 1041dd645e8e821c082b628cd8d9acf70c667
 F ext/wasm/api/sqlite3-license-version-header.js 0c807a421f0187e778dc1078f10d2994b915123c1223fe752b60afdcd1263f89
 F ext/wasm/api/sqlite3-opfs-async-proxy.js 9654b565b346dc609b75d15337f20acfa7af7d9d558da1afeb9b6d8eaa404966
 F ext/wasm/api/sqlite3-vfs-helper.c-pp.js 3f828cc66758acb40e9c5b4dcfd87fd478a14c8fb7f0630264e6c7fa0e57515d
-F ext/wasm/api/sqlite3-vfs-kvvfs.c-pp.js 08b058de61d3a04e98388a179bf622dbfab0d841aa3546ce1541e442880a012a
+F ext/wasm/api/sqlite3-vfs-kvvfs.c-pp.js ce2919a4ed90a9664563fb28ae97e5f3aa945d0967aea15d8bdfb33c8e5335e5
 F ext/wasm/api/sqlite3-vfs-opfs-sahpool.c-pp.js a2eea6442556867b589e04107796c6e1d04a472219529eeb45b7cd221d7d048b
 F ext/wasm/api/sqlite3-vfs-opfs.c-pp.js 88ce2078267a2d1af57525a32d896295f4a8db7664de0e17e82dc9ff006ed8d3
 F ext/wasm/api/sqlite3-vtab-helper.c-pp.js 9097074724172e31e56ce20ccd7482259cf72a76124213cbc9469d757676da86
@@ -2178,8 +2178,8 @@ F tool/version-info.c 33d0390ef484b3b1cb685d59362be891ea162123cea181cb8e6d2cf6dd
 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7
 F tool/warnings.sh d924598cf2f55a4ecbc2aeb055c10bd5f48114793e7ba25f9585435da29e7e98
 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
-P e2e94f9094f8bbe93cdf7d2a2e72e92462b94e18319603c5a364f183cb780be1
-R eb733c7a4409e01bf94307709e4f0a90
+P 65272adfab333565719bde4f6c5bbe4f0b5415c17a8de43e6b2d7b0518cca4c7
+R 7ff02af4799af090b17818f6b0942a23
 U stephan
-Z 460ddd5e8bff8ef00b5202225229de31
+Z 21a402996c80c3c212f253d56f5c611b
 # Remove this line to create a well-formed Fossil manifest.
index 29d3bc3ee389d0d5ee992915043f01dbdd06512d..152e1b90cc1d9deb21555997f8804d35b41df3d8 100644 (file)
@@ -1 +1 @@
-65272adfab333565719bde4f6c5bbe4f0b5415c17a8de43e6b2d7b0518cca4c7
+6b48375972e6e4112efd51ffea0e54d33a4245bf0155b7fa3ca1e3f147eb043c