-C Allocate\spage\scache\sheaders\sand\spage\scache\sdata\sbuffers\sseparately.\nThe\sdata\sbuffer\swill\sbe\sa\spower\sof\stwo\sin\ssize\sand\sthis\sgives\ssome\nmalloc\simplementation\sadditional\soptimization\sopportunitites.\s(CVS\s4409)
-D 2007-09-06T22:19:15
+C Base\sthe\sname\sof\sthe\sstatement\sjournal\son\sthe\soriginal\sdatabase\sfilename.\nRemember\sthe\sstatement\sjournal\sname\sfor\sthe\slifetime\sof\sthe\sPager\sso\nthat\sthe\sname\spointer\spassed\sto\sxOpen\spersists\sas\slong\sas\sthe\sfile\nexists.\s(CVS\s4410)
+D 2007-09-06T23:28:24
F Makefile.in cbfb898945536a8f9ea8b897e1586dd1fdbcc5db
F Makefile.linux-gcc 65241babba6faf1152bf86574477baab19190499
F README 9c4e2d6706bdcc3efdd773ce752a8cdab4f90028
F src/os_unix.h 5768d56d28240d3fe4537fac08cc85e4fb52279e
F src/os_win.c b663c171abbbfa8ca20e5b9b93f7a0f09df616e9
F src/os_win.h 41a946bea10f61c158ce8645e7646b29d44f122b
-F src/pager.c 10a95d9373105af62255a05aac1ffe0400b93a3d
+F src/pager.c 70b4b9b6e1715adba48cd6a263885ae848f3f263
F src/pager.h d783e7f184afdc33adff37ba58d4e029bd8793b3
F src/parse.y 2d2ce439dc6184621fb0b86f4fc5aca7f391a590
F src/pragma.c 363e548dafb52327face8d99757ab56a7b1c1b26
F test/lock.test 6825aea0b5885578b1b63a3b178803842c4ee9f1
F test/lock2.test 5f9557b775662c2a5ee435378f39e10d64f65cb3
F test/lock3.test 615111293cf32aa2ed16d01c6611737651c96fb9
-F test/lock4.test c8e035ba9cf08985e4fc0f4600ffae241a435ab3
+F test/lock4.test f358fa835dff485d462072eee991111f09e87441
F test/main.test 05f585bb70c05caac3e047903b517cbb319ed204
F test/malloc.test 5b4ac16e0e11cca99a25574298eb5ac8e93236db
F test/malloc2.test c1a74f46a3581b56df29ff46a4e1c99b41c44ad9
F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0
F www/version3.tcl 890248cf7b70e60c383b0e84d77d5132b3ead42b
F www/whentouse.tcl fc46eae081251c3c181bd79c5faef8195d7991a5
-P 3298441086330d1d24c30b7c061dfec98e9ea3ac
-R fab7f476269f83c2a9fb525589500817
+P 2b755defe51a565a2b6ace58381d6e91f6f17db8
+R 7302a8ee1069963289d7beafba5ccbcf
U drh
-Z 091fe80161eedb1e09f57479031bbfb6
+Z 2eeafbb47f910b6b2e141f033520b30a
** file simultaneously, or one process from reading the database while
** another is writing.
**
-** @(#) $Id: pager.c,v 1.386 2007/09/06 22:19:15 drh Exp $
+** @(#) $Id: pager.c,v 1.387 2007/09/06 23:28:24 drh Exp $
*/
#ifndef SQLITE_OMIT_DISKIO
#include "sqliteInt.h"
char *zFilename; /* Name of the database file */
char *zJournal; /* Name of the journal file */
char *zDirectory; /* Directory hold database and journal files */
+ char *zStmtJrnl; /* Name of the statement journal file */
sqlite3_file *fd, *jfd; /* File descriptors for database and journal */
sqlite3_file *stfd; /* File descriptor for the statement subjournal*/
BusyHandler *pBusyHandler; /* Pointer to sqlite.busyHandler */
** Write the file descriptor into *fd. Return SQLITE_OK on success or some
** other error code if we fail. The OS will automatically delete the temporary
** file when it is closed.
-**
-** If zFilename is 0, then an appropriate temporary filename is
-** generated automatically.
-**
-** The vfsFlags value should be SQLITE_OPEN_SUBJOURNAL or SQLITE_OPEN
*/
static int sqlite3PagerOpentemp(
sqlite3_vfs *pVfs, /* The virtual file system layer */
int vfsFlags /* Flags passed through to the VFS */
){
int rc;
-
- char *zFree = 0;
- if( zFilename==0 ){
- zFree = (char *)sqlite3_malloc(pVfs->mxPathname);
- if( !zFree ){
- return SQLITE_NOMEM;
- }
- zFilename = zFree;
- rc = sqlite3OsGetTempName(pVfs, zFilename);
- if( rc!=SQLITE_OK ){
- sqlite3_free(zFree);
- return rc;
- }
- }
+ assert( zFilename!=0 );
#ifdef SQLITE_TEST
sqlite3_opentemp_count++; /* Used for testing and analysis only */
SQLITE_OPEN_EXCLUSIVE | SQLITE_OPEN_DELETEONCLOSE;
rc = sqlite3OsOpen(pVfs, zFilename, pFile, vfsFlags, 0);
assert( rc!=SQLITE_OK || pFile->pMethods );
- sqlite3_free(zFree);
return rc;
}
sizeof(*pPager) + /* Pager structure */
journalFileSize + /* The journal file structure */
pVfs->szOsFile * 2 + /* The db and stmt journal files */
- nPathname * 3 + 30 /* zFilename, zDirectory, zJournal */
+ 4*nPathname + 40 /* zFilename, zDirectory, zJournal, zStmtJrnl */
);
if( !pPager ){
sqlite3_free(zPathname);
pPager->zFilename = (char*)&pPtr[pVfs->szOsFile*2+journalFileSize];
pPager->zDirectory = &pPager->zFilename[nPathname+1];
pPager->zJournal = &pPager->zDirectory[nPathname+1];
+ pPager->zStmtJrnl = &pPager->zJournal[nPathname+10];
pPager->pVfs = pVfs;
memcpy(pPager->zFilename, zPathname, nPathname+1);
sqlite3_free(zPathname);
for(i=strlen(pPager->zDirectory); i>0 && pPager->zDirectory[i-1]!='/'; i--){}
if( i>0 ) pPager->zDirectory[i-1] = 0;
- /* Fill in Pager.zJournal[] */
+ /* Fill in Pager.zJournal[] and Pager.zStmtJrnl[] */
memcpy(pPager->zJournal, pPager->zFilename, nPathname);
memcpy(&pPager->zJournal[nPathname], "-journal", 9);
+ memcpy(pPager->zStmtJrnl, pPager->zFilename, nPathname);
+ memcpy(&pPager->zStmtJrnl[nPathname], "-stmtjrnl", 10);
/* pPager->journalOpen = 0; */
pPager->useJournal = useJournal && !memDb;
pPager->stmtHdrOff = 0;
pPager->stmtCksum = pPager->cksumInit;
if( !pPager->stmtOpen ){
- rc = sqlite3PagerOpentemp(pPager->pVfs, pPager->stfd, 0,
+ rc = sqlite3PagerOpentemp(pPager->pVfs, pPager->stfd, pPager->zStmtJrnl,
SQLITE_OPEN_SUBJOURNAL);
- if( rc ) goto stmt_begin_failed;
+ if( rc ){
+ goto stmt_begin_failed;
+ }
pPager->stmtOpen = 1;
pPager->stmtNRec = 0;
}