1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-05 15:55:57 +03:00

Do not simulate OOM conditions in the sqlite3OsXXX() calls if the underlying file is an in-memory journal file. (CVS 6946)

FossilOrigin-Name: d486811715350f315374cc41f3d808a75d140afb
This commit is contained in:
danielk1977
2009-07-27 11:41:20 +00:00
parent c7538b5f63
commit b5a1920816
3 changed files with 21 additions and 21 deletions

View File

@@ -1,5 +1,5 @@
C When\sextracting\svalues\sfrom\sa\srecord\sto\suse\sin\san\sUPDATEd\sversion\sof\sthat\srecord,\sapply\sOP_RealAffinity\sif\srequired.\sFix\sfor\s#3992.\s(CVS\s6945) C Do\snot\ssimulate\sOOM\sconditions\sin\sthe\ssqlite3OsXXX()\scalls\sif\sthe\sunderlying\sfile\sis\san\sin-memory\sjournal\sfile.\s(CVS\s6946)
D 2009-07-27T10:05:05 D 2009-07-27T11:41:21
F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0 F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0
F Makefile.in df9359da7a726ccb67a45db905c5447d5c00c6ef F Makefile.in df9359da7a726ccb67a45db905c5447d5c00c6ef
F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654 F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
@@ -141,7 +141,7 @@ F src/mutex_os2.c 6b5a74f812082a8483c3df05b47bbaac2424b9a0
F src/mutex_unix.c 2f936339dfef1a4c142db290d575a3509b77315f F src/mutex_unix.c 2f936339dfef1a4c142db290d575a3509b77315f
F src/mutex_w32.c cd611ebe0671a05e3d5b4e3f37032a45eb2ce612 F src/mutex_w32.c cd611ebe0671a05e3d5b4e3f37032a45eb2ce612
F src/notify.c 0127121816d8a861deb0dfd111b495346bf233db F src/notify.c 0127121816d8a861deb0dfd111b495346bf233db
F src/os.c c2aa4a7d8bb845222e5c37f56cde377b20c3b087 F src/os.c 5029ae6c88d1869ad9034008a9531658d53438e4
F src/os.h fa3f4aa0119ff721a2da4b47ffd74406ac864c05 F src/os.h fa3f4aa0119ff721a2da4b47ffd74406ac864c05
F src/os_common.h 8c61457df58f1a4bd5f5adc3e90e01b37bf7afbc F src/os_common.h 8c61457df58f1a4bd5f5adc3e90e01b37bf7afbc
F src/os_os2.c bed77dc26e3a95ce4a204936b9a1ca6fe612fcc5 F src/os_os2.c bed77dc26e3a95ce4a204936b9a1ca6fe612fcc5
@@ -739,7 +739,7 @@ F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff
F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224 F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
F tool/vdbe-compress.tcl 672f81d693a03f80f5ae60bfefacd8a349e76746 F tool/vdbe-compress.tcl 672f81d693a03f80f5ae60bfefacd8a349e76746
P 886e665f6cf780464b280c286b03c9fb5c1a6b2a P 3616766a6f5c8179cc55444c29ecf29cc69f88ce
R 899fdca0f993aff7c16e3dca0f2bd4bf R 15dcf1e2e323ed2f20117bf58e184446
U danielk1977 U danielk1977
Z 8a5d8493499fa3d337872f4bdb3cfbf7 Z 83c16bc9609be7e94d58c26429e0fd97

View File

@@ -1 +1 @@
3616766a6f5c8179cc55444c29ecf29cc69f88ce d486811715350f315374cc41f3d808a75d140afb

View File

@@ -13,7 +13,7 @@
** This file contains OS interface code that is common to all ** This file contains OS interface code that is common to all
** architectures. ** architectures.
** **
** $Id: os.c,v 1.126 2009/03/25 14:24:42 drh Exp $ ** $Id: os.c,v 1.127 2009/07/27 11:41:21 danielk1977 Exp $
*/ */
#define _SQLITE_OS_C_ 1 #define _SQLITE_OS_C_ 1
#include "sqliteInt.h" #include "sqliteInt.h"
@@ -37,13 +37,13 @@
** **
*/ */
#if defined(SQLITE_TEST) && (SQLITE_OS_WIN==0) #if defined(SQLITE_TEST) && (SQLITE_OS_WIN==0)
#define DO_OS_MALLOC_TEST if (1) { \ #define DO_OS_MALLOC_TEST(x) if (!x || !sqlite3IsMemJournal(x)) { \
void *pTstAlloc = sqlite3Malloc(10); \ void *pTstAlloc = sqlite3Malloc(10); \
if (!pTstAlloc) return SQLITE_IOERR_NOMEM; \ if (!pTstAlloc) return SQLITE_IOERR_NOMEM; \
sqlite3_free(pTstAlloc); \ sqlite3_free(pTstAlloc); \
} }
#else #else
#define DO_OS_MALLOC_TEST #define DO_OS_MALLOC_TEST(x)
#endif #endif
/* /*
@@ -61,33 +61,33 @@ int sqlite3OsClose(sqlite3_file *pId){
return rc; return rc;
} }
int sqlite3OsRead(sqlite3_file *id, void *pBuf, int amt, i64 offset){ int sqlite3OsRead(sqlite3_file *id, void *pBuf, int amt, i64 offset){
DO_OS_MALLOC_TEST; DO_OS_MALLOC_TEST(id);
return id->pMethods->xRead(id, pBuf, amt, offset); return id->pMethods->xRead(id, pBuf, amt, offset);
} }
int sqlite3OsWrite(sqlite3_file *id, const void *pBuf, int amt, i64 offset){ int sqlite3OsWrite(sqlite3_file *id, const void *pBuf, int amt, i64 offset){
DO_OS_MALLOC_TEST; DO_OS_MALLOC_TEST(id);
return id->pMethods->xWrite(id, pBuf, amt, offset); return id->pMethods->xWrite(id, pBuf, amt, offset);
} }
int sqlite3OsTruncate(sqlite3_file *id, i64 size){ int sqlite3OsTruncate(sqlite3_file *id, i64 size){
return id->pMethods->xTruncate(id, size); return id->pMethods->xTruncate(id, size);
} }
int sqlite3OsSync(sqlite3_file *id, int flags){ int sqlite3OsSync(sqlite3_file *id, int flags){
DO_OS_MALLOC_TEST; DO_OS_MALLOC_TEST(id);
return id->pMethods->xSync(id, flags); return id->pMethods->xSync(id, flags);
} }
int sqlite3OsFileSize(sqlite3_file *id, i64 *pSize){ int sqlite3OsFileSize(sqlite3_file *id, i64 *pSize){
DO_OS_MALLOC_TEST; DO_OS_MALLOC_TEST(id);
return id->pMethods->xFileSize(id, pSize); return id->pMethods->xFileSize(id, pSize);
} }
int sqlite3OsLock(sqlite3_file *id, int lockType){ int sqlite3OsLock(sqlite3_file *id, int lockType){
DO_OS_MALLOC_TEST; DO_OS_MALLOC_TEST(id);
return id->pMethods->xLock(id, lockType); return id->pMethods->xLock(id, lockType);
} }
int sqlite3OsUnlock(sqlite3_file *id, int lockType){ int sqlite3OsUnlock(sqlite3_file *id, int lockType){
return id->pMethods->xUnlock(id, lockType); return id->pMethods->xUnlock(id, lockType);
} }
int sqlite3OsCheckReservedLock(sqlite3_file *id, int *pResOut){ int sqlite3OsCheckReservedLock(sqlite3_file *id, int *pResOut){
DO_OS_MALLOC_TEST; DO_OS_MALLOC_TEST(id);
return id->pMethods->xCheckReservedLock(id, pResOut); return id->pMethods->xCheckReservedLock(id, pResOut);
} }
int sqlite3OsFileControl(sqlite3_file *id, int op, void *pArg){ int sqlite3OsFileControl(sqlite3_file *id, int op, void *pArg){
@@ -113,7 +113,7 @@ int sqlite3OsOpen(
int *pFlagsOut int *pFlagsOut
){ ){
int rc; int rc;
DO_OS_MALLOC_TEST; DO_OS_MALLOC_TEST(0);
rc = pVfs->xOpen(pVfs, zPath, pFile, flags, pFlagsOut); rc = pVfs->xOpen(pVfs, zPath, pFile, flags, pFlagsOut);
assert( rc==SQLITE_OK || pFile->pMethods==0 ); assert( rc==SQLITE_OK || pFile->pMethods==0 );
return rc; return rc;
@@ -127,7 +127,7 @@ int sqlite3OsAccess(
int flags, int flags,
int *pResOut int *pResOut
){ ){
DO_OS_MALLOC_TEST; DO_OS_MALLOC_TEST(0);
return pVfs->xAccess(pVfs, zPath, flags, pResOut); return pVfs->xAccess(pVfs, zPath, flags, pResOut);
} }
int sqlite3OsFullPathname( int sqlite3OsFullPathname(