/fiddle: before resetting a db, roll back any transactions (resolves problem reported in [forum:0b41a25d65|forum post 0b41a25d65]) and remove an obsolete/broken reference to a long-gone API which could cause initialization to fail prematurely.
FossilOrigin-Name: ee164ca73cf4151b1a1bf351729afa9b0ec95bd5004a5d5bfce3ed46268bfbf3
This commit is contained in:
parent
18281494a2
commit
2c3973fdff
@ -166,11 +166,10 @@
|
||||
stdout("SQLite version", capi.sqlite3_libversion(),
|
||||
capi.sqlite3_sourceid().substr(0,19));
|
||||
stdout('Welcome to the "fiddle" shell.');
|
||||
if(sqlite3.opfs){
|
||||
if(capi.sqlite3_vfs_find("opfs")){
|
||||
stdout("\nOPFS is available. To open a persistent db, use:\n\n",
|
||||
" .open file:name?vfs=opfs\n\nbut note that some",
|
||||
"features (e.g. upload) do not yet work with OPFS.");
|
||||
sqlite3.opfs.registerVfs();
|
||||
}
|
||||
stdout('\nEnter ".help" for usage hints.');
|
||||
this.exec([ // initialization commands...
|
||||
@ -317,7 +316,7 @@
|
||||
};
|
||||
console.warn("Unknown fiddle-worker message type:",ev);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
emscripten module for use with build mode -sMODULARIZE.
|
||||
*/
|
||||
|
16
manifest
16
manifest
@ -1,5 +1,5 @@
|
||||
C Fix\sa\scompiler\swarning\sin\sdate.c.\s\sUpdate\smakefiles\sto\sinclude\sall\snecessary\ndependencies\sfor\sbuilding\sshell.c.
|
||||
D 2024-03-04T18:22:18.359
|
||||
C /fiddle:\sbefore\sresetting\sa\sdb,\sroll\sback\sany\stransactions\s(resolves\sproblem\sreported\sin\s[forum:0b41a25d65|forum\spost\s0b41a25d65])\sand\sremove\san\sobsolete/broken\sreference\sto\sa\slong-gone\sAPI\swhich\scould\scause\sinitialization\sto\sfail\sprematurely.
|
||||
D 2024-03-05T06:31:37.489
|
||||
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
|
||||
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
|
||||
F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724
|
||||
@ -640,7 +640,7 @@ F ext/wasm/dist.make 3a851858aad72e246a5d9c5aaf6b6a144305f1bf898ac1846760ea7bab9
|
||||
F ext/wasm/example_extra_init.c 2347cd69d19d839ef4e5e77b7855103a7fe3ef2af86f2e8c95839afd8b05862f
|
||||
F ext/wasm/fiddle.make fa2ba6e90457ba2a71cb745f200d409caf773076df75ae5b177cc225d7627a11
|
||||
F ext/wasm/fiddle/emscripten.css 3d253a6fdb8983a2ac983855bfbdd4b6fa1ff267c28d69513dd6ef1f289ada3f
|
||||
F ext/wasm/fiddle/fiddle-worker.js 9be57887756c6854dbdcb5e7d8b7a26935d565491333a2f91dc4113598c659b5
|
||||
F ext/wasm/fiddle/fiddle-worker.js 850e66fce39b89d59e161d1abac43a181a4caa89ddeea162765d660277cd84ce
|
||||
F ext/wasm/fiddle/fiddle.js 974b995119ac443685d7d94d3b3c58c6a36540e9eb3fed7069d5653284071715
|
||||
F ext/wasm/fiddle/index.html 5daf54e8f3d7777cbb1ca4f93affe28858dbfff25841cb4ab81d694efed28ec2
|
||||
F ext/wasm/index-dist.html e91d76e4581185238fd3d42ed86ec600f7023ed3e3a944c5c356f25304bf1263
|
||||
@ -751,7 +751,7 @@ F src/random.c 606b00941a1d7dd09c381d3279a058d771f406c5213c9932bbd93d5587be4b9c
|
||||
F src/resolve.c d77c6160bc8f249c2196fdd3e75f66a1dd70e37aa25c39aedc7b1f93c42b7c6d
|
||||
F src/rowset.c 8432130e6c344b3401a8874c3cb49fefe6873fec593294de077afea2dce5ec97
|
||||
F src/select.c 43fabfc01bf87addd15e39f112f1e2ade15b19594835ab8a9e5bd50839d4e1b1
|
||||
F src/shell.c.in 2ec564ed3ff0147036be313efeb47b3dbfb8753d5eb5ea0e90636427c6b3a365
|
||||
F src/shell.c.in 6e7cd81874e3cea68b4f2dc72a8731a5f545aca0b3e48f132e3c6ee6862e3c0a
|
||||
F src/sqlite.h.in 19a2db3995a699bd7f6dfb423856242bfceb7ec849a93c91d241d19fc28d9f0f
|
||||
F src/sqlite3.rc 5121c9e10c3964d5755191c80dd1180c122fc3a8
|
||||
F src/sqlite3ext.h 3f046c04ea3595d6bfda99b781926b17e672fd6d27da2ba6d8d8fc39981dcb54
|
||||
@ -2176,8 +2176,8 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93
|
||||
F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
|
||||
F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
|
||||
F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
|
||||
P 0d19eeaafb296aad212ee4f55a0f6df8c7c5185b14d7f7f49c020fe4cbe370c1
|
||||
R 191956f8db663f29da20ebca61821faf
|
||||
U drh
|
||||
Z 23a2cbc5a581c90c55252c83bc05fa14
|
||||
P 178b7d46f9c8e1694ed6f506d2785a9f5c49e2b428e04c8096d557cc1b5c9680
|
||||
R 64eca58e8ac762a5eb6b341ff69c8405
|
||||
U stephan
|
||||
Z ff3bca729d13aff9e0b3d1adfb9ed46d
|
||||
# Remove this line to create a well-formed Fossil manifest.
|
||||
|
@ -1 +1 @@
|
||||
178b7d46f9c8e1694ed6f506d2785a9f5c49e2b428e04c8096d557cc1b5c9680
|
||||
ee164ca73cf4151b1a1bf351729afa9b0ec95bd5004a5d5bfce3ed46268bfbf3
|
@ -12838,7 +12838,7 @@ sqlite3_vfs * fiddle_db_vfs(const char *zDbName){
|
||||
|
||||
/* Only for emcc experimentation purposes. */
|
||||
sqlite3 * fiddle_db_arg(sqlite3 *arg){
|
||||
printf("fiddle_db_arg(%p)\n", (const void*)arg);
|
||||
oputf("fiddle_db_arg(%p)\n", (const void*)arg);
|
||||
return arg;
|
||||
}
|
||||
|
||||
@ -12864,12 +12864,22 @@ const char * fiddle_db_filename(const char * zDbName){
|
||||
|
||||
/*
|
||||
** Completely wipes out the contents of the currently-opened database
|
||||
** but leaves its storage intact for reuse.
|
||||
** but leaves its storage intact for reuse. If any transactions are
|
||||
** active, they are forcibly rolled back.
|
||||
*/
|
||||
void fiddle_reset_db(void){
|
||||
if( globalDb ){
|
||||
int rc = sqlite3_db_config(globalDb, SQLITE_DBCONFIG_RESET_DATABASE, 1, 0);
|
||||
if( 0==rc ) rc = sqlite3_exec(globalDb, "VACUUM", 0, 0, 0);
|
||||
int rc;
|
||||
while( sqlite3_txn_state(globalDb,0)>0 ){
|
||||
/*
|
||||
** Resolve problem reported in
|
||||
** https://sqlite.org/forum/forumpost/0b41a25d65
|
||||
*/
|
||||
oputz("Rolling back in-progress transaction.\n");
|
||||
sqlite3_exec(globalDb,"ROLLBACK", 0, 0, 0);
|
||||
}
|
||||
rc = sqlite3_db_config(globalDb, SQLITE_DBCONFIG_RESET_DATABASE, 1, 0);
|
||||
if( 0==rc ) sqlite3_exec(globalDb, "VACUUM", 0, 0, 0);
|
||||
sqlite3_db_config(globalDb, SQLITE_DBCONFIG_RESET_DATABASE, 0, 0);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user