Pull the src/os_kv.c part of [13839759f8f4] into the kv-vfs branch.
FossilOrigin-Name: e334449912d5176e355d02024a07ed867741f71c9d10ce6744ca800414bf3eeb
This commit is contained in:
parent
5fd8f27bfb
commit
d22cfa8c80
12
manifest
12
manifest
@ -1,5 +1,5 @@
|
|||||||
C Remove\san\sextraneous\skey-copy\sop\sin\sthe\sEM_JS\simpl\sof\skvstorageDelete().
|
C Pull\sthe\ssrc/os_kv.c\spart\sof\s[13839759f8f4]\sinto\sthe\skv-vfs\sbranch.
|
||||||
D 2022-09-12T20:21:34.667
|
D 2022-09-16T01:08:06.279
|
||||||
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
|
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
|
||||||
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
|
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
|
||||||
F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724
|
F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724
|
||||||
@ -574,7 +574,7 @@ F src/notify.c 89a97dc854c3aa62ad5f384ef50c5a4a11d70fcc69f86de3e991573421130ed6
|
|||||||
F src/os.c 0eb831ba3575af5277e47f4edd14fdfc90025c67eb25ce5cda634518d308d4e9
|
F src/os.c 0eb831ba3575af5277e47f4edd14fdfc90025c67eb25ce5cda634518d308d4e9
|
||||||
F src/os.h 1ff5ae51d339d0e30d8a9d814f4b8f8e448169304d83a7ed9db66a65732f3e63
|
F src/os.h 1ff5ae51d339d0e30d8a9d814f4b8f8e448169304d83a7ed9db66a65732f3e63
|
||||||
F src/os_common.h b2f4707a603e36811d9b1a13278bffd757857b85
|
F src/os_common.h b2f4707a603e36811d9b1a13278bffd757857b85
|
||||||
F src/os_kv.c 889c6f9b59702859f9041549845769bae2cbd6b59cf15bd7904551a676b85533
|
F src/os_kv.c d4909b439043183f9b6aec65528a7433cee49d41cca95b9a3a4c8fb6bbedc0c2
|
||||||
F src/os_setup.h 0711dbc4678f3ac52d7fe736951b6384a0615387c4ba5135a4764e4e31f4b6a6
|
F src/os_setup.h 0711dbc4678f3ac52d7fe736951b6384a0615387c4ba5135a4764e4e31f4b6a6
|
||||||
F src/os_unix.c 0fa91925f0b8831fc0156a9c04d39d86f85baf9eef66c98712395e1715cb75cc
|
F src/os_unix.c 0fa91925f0b8831fc0156a9c04d39d86f85baf9eef66c98712395e1715cb75cc
|
||||||
F src/os_win.c e9454cb141908e8eef2102180bad353a36480612d5b736e4c2bd5777d9b25a34
|
F src/os_win.c e9454cb141908e8eef2102180bad353a36480612d5b736e4c2bd5777d9b25a34
|
||||||
@ -2004,8 +2004,8 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93
|
|||||||
F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
|
F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
|
||||||
F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
|
F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
|
||||||
F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
|
F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
|
||||||
P 878cc93e779c3857adc711f212520f007256274fcd3f6f3d72c754a937fcd198
|
P 1c5aeee45564c14e7e2e7730f3f52106339ea3148fb5aa786fa767a35db46f51
|
||||||
R ea387427fef090c92e0fdcd9a6ab25a2
|
R 06fb792046d4c535864a12af9a1a5d61
|
||||||
U stephan
|
U stephan
|
||||||
Z d8eaf9989333b333239c3719fa4ba2d7
|
Z 125d6637967f22bfb5b9fb3681eda03b
|
||||||
# Remove this line to create a well-formed Fossil manifest.
|
# Remove this line to create a well-formed Fossil manifest.
|
||||||
|
@ -1 +1 @@
|
|||||||
1c5aeee45564c14e7e2e7730f3f52106339ea3148fb5aa786fa767a35db46f51
|
e334449912d5176e355d02024a07ed867741f71c9d10ce6744ca800414bf3eeb
|
26
src/os_kv.c
26
src/os_kv.c
@ -351,7 +351,7 @@ int sqlite3__wasm_emjs_kvvfs(int whichOp){
|
|||||||
switch( whichOp ){
|
switch( whichOp ){
|
||||||
case 0: break;
|
case 0: break;
|
||||||
case 1:
|
case 1:
|
||||||
kvstorageWrite(zClass, zKey, "world");
|
rc = kvstorageWrite(zClass, zKey, "world");
|
||||||
break;
|
break;
|
||||||
case 2: {
|
case 2: {
|
||||||
char buffer[128] = {0};
|
char buffer[128] = {0};
|
||||||
@ -602,7 +602,7 @@ static void kvvfsDecodeJournal(
|
|||||||
const char *zTxt, /* Text encoding. Zero-terminated */
|
const char *zTxt, /* Text encoding. Zero-terminated */
|
||||||
int nTxt /* Bytes in zTxt, excluding zero terminator */
|
int nTxt /* Bytes in zTxt, excluding zero terminator */
|
||||||
){
|
){
|
||||||
unsigned int n = 0;
|
unsigned int n;
|
||||||
int c, i, mult;
|
int c, i, mult;
|
||||||
i = 0;
|
i = 0;
|
||||||
mult = 1;
|
mult = 1;
|
||||||
@ -634,10 +634,10 @@ static sqlite3_int64 kvvfsReadFileSize(KVVfsFile *pFile){
|
|||||||
kvstorageRead(pFile->zClass, "sz", zData, sizeof(zData)-1);
|
kvstorageRead(pFile->zClass, "sz", zData, sizeof(zData)-1);
|
||||||
return strtoll(zData, 0, 0);
|
return strtoll(zData, 0, 0);
|
||||||
}
|
}
|
||||||
static void kvvfsWriteFileSize(KVVfsFile *pFile, sqlite3_int64 sz){
|
static int kvvfsWriteFileSize(KVVfsFile *pFile, sqlite3_int64 sz){
|
||||||
char zData[50];
|
char zData[50];
|
||||||
sqlite3_snprintf(sizeof(zData), zData, "%lld", sz);
|
sqlite3_snprintf(sizeof(zData), zData, "%lld", sz);
|
||||||
kvstorageWrite(pFile->zClass, "sz", zData);
|
return kvstorageWrite(pFile->zClass, "sz", zData);
|
||||||
}
|
}
|
||||||
|
|
||||||
/****** sqlite3_io_methods methods ******************************************/
|
/****** sqlite3_io_methods methods ******************************************/
|
||||||
@ -788,7 +788,9 @@ static int kvvfsWriteDb(
|
|||||||
pgno = 1 + iOfst/iAmt;
|
pgno = 1 + iOfst/iAmt;
|
||||||
sqlite3_snprintf(sizeof(zKey), zKey, "%u", pgno);
|
sqlite3_snprintf(sizeof(zKey), zKey, "%u", pgno);
|
||||||
kvvfsEncode(zBuf, iAmt, aData);
|
kvvfsEncode(zBuf, iAmt, aData);
|
||||||
kvstorageWrite(pFile->zClass, zKey, aData);
|
if( kvstorageWrite(pFile->zClass, zKey, aData) ){
|
||||||
|
return SQLITE_IOERR;
|
||||||
|
}
|
||||||
if( iOfst+iAmt > pFile->szDb ){
|
if( iOfst+iAmt > pFile->szDb ){
|
||||||
pFile->szDb = iOfst + iAmt;
|
pFile->szDb = iOfst + iAmt;
|
||||||
}
|
}
|
||||||
@ -825,8 +827,7 @@ static int kvvfsTruncateDb(sqlite3_file *pProtoFile, sqlite_int64 size){
|
|||||||
pgno++;
|
pgno++;
|
||||||
}
|
}
|
||||||
pFile->szDb = size;
|
pFile->szDb = size;
|
||||||
kvvfsWriteFileSize(pFile, size);
|
return kvvfsWriteFileSize(pFile, size) ? SQLITE_IOERR : SQLITE_OK;
|
||||||
return SQLITE_OK;
|
|
||||||
}
|
}
|
||||||
return SQLITE_IOERR;
|
return SQLITE_IOERR;
|
||||||
}
|
}
|
||||||
@ -854,17 +855,18 @@ static int kvvfsSyncJrnl(sqlite3_file *pProtoFile, int flags){
|
|||||||
}while( n>0 );
|
}while( n>0 );
|
||||||
zOut[i++] = ' ';
|
zOut[i++] = ' ';
|
||||||
kvvfsEncode(pFile->aJrnl, pFile->nJrnl, &zOut[i]);
|
kvvfsEncode(pFile->aJrnl, pFile->nJrnl, &zOut[i]);
|
||||||
kvstorageWrite(pFile->zClass, "jrnl", zOut);
|
i = kvstorageWrite(pFile->zClass, "jrnl", zOut);
|
||||||
sqlite3_free(zOut);
|
sqlite3_free(zOut);
|
||||||
return SQLITE_OK;
|
return i ? SQLITE_IOERR : SQLITE_OK;
|
||||||
}
|
}
|
||||||
static int kvvfsSyncDb(sqlite3_file *pProtoFile, int flags){
|
static int kvvfsSyncDb(sqlite3_file *pProtoFile, int flags){
|
||||||
KVVfsFile *pFile = (KVVfsFile *)pProtoFile;
|
KVVfsFile *pFile = (KVVfsFile *)pProtoFile;
|
||||||
|
int rc = SQLITE_OK;
|
||||||
SQLITE_KV_LOG(("xSync('%s-db')\n", pFile->zClass));
|
SQLITE_KV_LOG(("xSync('%s-db')\n", pFile->zClass));
|
||||||
if( pFile->szDb>0 ){
|
if( pFile->szDb>0 && 0!=kvvfsWriteFileSize(pFile, pFile->szDb) ){
|
||||||
kvvfsWriteFileSize(pFile, pFile->szDb);
|
rc = SQLITE_IOERR;
|
||||||
}
|
}
|
||||||
return SQLITE_OK;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Loading…
Reference in New Issue
Block a user