-C Return\san\serror\swhen\san\sxBestIndex()\smethod\sindicates\sthat\sit\sintends\sto\suse\sthe\svalue\sof\san\sunusable\sconstraint.\sRelated\sto\s#2998.\s(CVS\s4867)
-D 2008-03-17T09:36:45
+C Put\sthe\sstatement\sjournal\sin\sthe\stemp-file\sdirectory\ssince\sthat\ndirectory\sis\soften\son\soptimized\sstorage\ssuch\sas\sRAM\sdisk\sand\sbecause\nunlike\sthe\smain\sjournal,\sthe\sstatement\sjournal\sdoes\snot\sneed\sto\nbe\scolocated\swith\sthe\sdatabase\sfile.\s(CVS\s4868)
+D 2008-03-17T13:50:58
F Makefile.arm-wince-mingw32ce-gcc ac5f7b2cef0cd850d6f755ba6ee4ab961b1fadf7
F Makefile.in 5be94fea84f1599672e5041de03b97990baca593
F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
F src/os_unix.h 5768d56d28240d3fe4537fac08cc85e4fb52279e
F src/os_win.c aa3f4bbee3b8c182d25a33fbc319f486857c12c1
F src/os_win.h 41a946bea10f61c158ce8645e7646b29d44f122b
-F src/pager.c c2cabad85f50c895430cd317c46b43fe87ccb95b
+F src/pager.c 2ebd895730163721d0b470aca47afbe28039c5e7
F src/pager.h 8174615ffd14ccc2cad2b081b919a398fa95e3f9
F src/parse.y 00f2698c8ae84f315be5e3f10b63c94f531fdd6d
F src/pragma.c e3f39f8576234887ecd0c1de43dc51af5855930c
F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0
F www/version3.tcl 890248cf7b70e60c383b0e84d77d5132b3ead42b
F www/whentouse.tcl fc46eae081251c3c181bd79c5faef8195d7991a5
-P 5589b9d395fb8267a124d56dd5d7987e57505e3d
-R 5404f9fa9fd8ab644119c7147401ab02
-U danielk1977
-Z c0d9e9f0eaef6302049326fc96233904
+P ffd470279540b1b8e3fdce6eb14001bae489b16d
+R b0594243937ab6c61e858122dd1f0c8e
+U drh
+Z 1448a749c8158f88c0270cbac8188569
** file simultaneously, or one process from reading the database while
** another is writing.
**
-** @(#) $Id: pager.c,v 1.416 2008/03/14 19:33:06 drh Exp $
+** @(#) $Id: pager.c,v 1.417 2008/03/17 13:50:58 drh Exp $
*/
#ifndef SQLITE_OMIT_DISKIO
#include "sqliteInt.h"
int nDefaultPage = SQLITE_DEFAULT_PAGE_SIZE;
char *zPathname;
int nPathname;
+ char *zStmtJrnl;
+ int nStmtJrnl;
/* The default return is a NULL pointer */
*ppPager = 0;
/* Compute the full pathname */
nPathname = pVfs->mxPathname+1;
- zPathname = sqlite3_malloc(nPathname);
+ zPathname = sqlite3_malloc(nPathname*2);
if( zPathname==0 ){
return SQLITE_NOMEM;
}
}
nPathname = strlen(zPathname);
+ /* Put the statement journal in temporary disk space since this is
+ ** sometimes RAM disk or other optimized storage. Unlikely the main
+ ** main journal file, the statement journal does not need to be
+ ** colocated with the database nor does it need to be persistent.
+ */
+ zStmtJrnl = &zPathname[nPathname+1];
+ rc = sqlite3OsGetTempname(pVfs, pVfs->mxPathname+1, zStmtJrnl);
+ if( rc!=SQLITE_OK ){
+ sqlite3_free(zPathname);
+ return rc;
+ }
+ nStmtJrnl = strlen(zStmtJrnl);
+
/* Allocate memory for the pager structure */
pPager = sqlite3MallocZero(
sizeof(*pPager) + /* Pager structure */
journalFileSize + /* The journal file structure */
pVfs->szOsFile * 3 + /* The main db and two journal files */
- 4*nPathname + 40 /* zFilename, zDirectory, zJournal, zStmtJrnl */
+ 3*nPathname + 40 + /* zFilename, zDirectory, zJournal */
+ nStmtJrnl /* zStmtJrnl */
);
if( !pPager ){
sqlite3_free(zPathname);
pPager->zStmtJrnl = &pPager->zJournal[nPathname+10];
pPager->pVfs = pVfs;
memcpy(pPager->zFilename, zPathname, nPathname+1);
+ memcpy(pPager->zStmtJrnl, zStmtJrnl, nStmtJrnl+1);
sqlite3_free(zPathname);
/* Open the pager file.
for(i=strlen(pPager->zDirectory); i>0 && pPager->zDirectory[i-1]!='/'; i--){}
if( i>0 ) pPager->zDirectory[i-1] = 0;
- /* Fill in Pager.zJournal[] and Pager.zStmtJrnl[] */
+ /* Fill in Pager.zJournal[] */
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;