1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-08 14:02:16 +03:00

Fix the pager such that if the xOpen() message sends back the SQLITE_OPEN_MEMORY

flag, the pager is opened in journal-mode MEMORY, even if compiled with
SQLITE_OMIT_DESERIALIZE.  No changes to the logic as long as that OMIT flag
is omitted.  We need to better document the behavior of xOpen to describe this.

FossilOrigin-Name: da1252b29852191eccbea98e0314408c75bb83a51f9d68d589705d4971a23850
This commit is contained in:
drh
2023-06-16 11:05:49 +00:00
parent f025fc164d
commit 2e4d526996
3 changed files with 7 additions and 13 deletions

View File

@@ -1,5 +1,5 @@
C Updates\sto\sthe\sREADME.md\sfile. C Fix\sthe\spager\ssuch\sthat\sif\sthe\sxOpen()\smessage\ssends\sback\sthe\sSQLITE_OPEN_MEMORY\nflag,\sthe\spager\sis\sopened\sin\sjournal-mode\sMEMORY,\seven\sif\scompiled\swith\nSQLITE_OMIT_DESERIALIZE.\s\sNo\schanges\sto\sthe\slogic\sas\slong\sas\sthat\sOMIT\sflag\nis\somitted.\s\sWe\sneed\sto\sbetter\sdocument\sthe\sbehavior\sof\sxOpen\sto\sdescribe\sthis.
D 2023-06-15T16:02:19.084 D 2023-06-16T11:05:49.710
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
@@ -623,7 +623,7 @@ F src/os_setup.h 6011ad7af5db4e05155f385eb3a9b4470688de6f65d6166b8956e58a3d87210
F src/os_unix.c 95b407307deb902a3bd9a5d5666c7838709cccb337baeee6ef0a53f512d3673e F src/os_unix.c 95b407307deb902a3bd9a5d5666c7838709cccb337baeee6ef0a53f512d3673e
F src/os_win.c 79ff2345aafe92be324e8d9062050c6c5ae714c2db6b4b5334d7d28e70ea81e6 F src/os_win.c 79ff2345aafe92be324e8d9062050c6c5ae714c2db6b4b5334d7d28e70ea81e6
F src/os_win.h 7b073010f1451abe501be30d12f6bc599824944a F src/os_win.h 7b073010f1451abe501be30d12f6bc599824944a
F src/pager.c 0dfe6a9c76ca8ad8eb91a3867dd20ba1f5c854bc5e9cd9cde62112bdee1822be F src/pager.c 30adfa7f9316dd0e925e48fa17a87fce72370e49cd18cac990f1d356e8857c48
F src/pager.h f82e9844166e1585f5786837ddc7709966138ced17f568c16af7ccf946c2baa3 F src/pager.h f82e9844166e1585f5786837ddc7709966138ced17f568c16af7ccf946c2baa3
F src/parse.y b1ac02e59fdd76d7613c4d75855fb51854f6566c5aa2c372f94023a12d7945f7 F src/parse.y b1ac02e59fdd76d7613c4d75855fb51854f6566c5aa2c372f94023a12d7945f7
F src/pcache.c 4cd4a0043167da9ba7e19b4d179a0e6354e7fe32c16f781ecf9bf0a5ff63b40b F src/pcache.c 4cd4a0043167da9ba7e19b4d179a0e6354e7fe32c16f781ecf9bf0a5ff63b40b
@@ -2040,8 +2040,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 6937986a687e4afea39168702f3a29aef0d60cebff024edab30d1aecfe159065 P fa5cb6dab52dcf853854ad12922a125b9a5f898362e883bb31b2f789c632288b
R e1b72416938244e2dcaed8362cccd982 R 1e00351adb0d3a10f3ec45aa365fd7b0
U drh U drh
Z a4d53ad11b0af40e07ac8fdc927f8b7c Z 963464765e856b8e7087ddeaacf625ce
# Remove this line to create a well-formed Fossil manifest. # Remove this line to create a well-formed Fossil manifest.

View File

@@ -1 +1 @@
fa5cb6dab52dcf853854ad12922a125b9a5f898362e883bb31b2f789c632288b da1252b29852191eccbea98e0314408c75bb83a51f9d68d589705d4971a23850

View File

@@ -4679,11 +4679,7 @@ int sqlite3PagerOpen(
int rc = SQLITE_OK; /* Return code */ int rc = SQLITE_OK; /* Return code */
int tempFile = 0; /* True for temp files (incl. in-memory files) */ int tempFile = 0; /* True for temp files (incl. in-memory files) */
int memDb = 0; /* True if this is an in-memory file */ int memDb = 0; /* True if this is an in-memory file */
#ifndef SQLITE_OMIT_DESERIALIZE
int memJM = 0; /* Memory journal mode */ int memJM = 0; /* Memory journal mode */
#else
# define memJM 0
#endif
int readOnly = 0; /* True if this is a read-only file */ int readOnly = 0; /* True if this is a read-only file */
int journalFileSize; /* Bytes to allocate for each journal fd */ int journalFileSize; /* Bytes to allocate for each journal fd */
char *zPathname = 0; /* Full path to database file */ char *zPathname = 0; /* Full path to database file */
@@ -4882,9 +4878,7 @@ int sqlite3PagerOpen(
int fout = 0; /* VFS flags returned by xOpen() */ int fout = 0; /* VFS flags returned by xOpen() */
rc = sqlite3OsOpen(pVfs, pPager->zFilename, pPager->fd, vfsFlags, &fout); rc = sqlite3OsOpen(pVfs, pPager->zFilename, pPager->fd, vfsFlags, &fout);
assert( !memDb ); assert( !memDb );
#ifndef SQLITE_OMIT_DESERIALIZE
pPager->memVfs = memJM = (fout&SQLITE_OPEN_MEMORY)!=0; pPager->memVfs = memJM = (fout&SQLITE_OPEN_MEMORY)!=0;
#endif
readOnly = (fout&SQLITE_OPEN_READONLY)!=0; readOnly = (fout&SQLITE_OPEN_READONLY)!=0;
/* If the file was successfully opened for read/write access, /* If the file was successfully opened for read/write access,