-C Remove\snRef\sand\svfsMutex\sfrom\sthe\ssqlite3_vfs\sstructure.\s\sOmit\sthe\nsqlite3_vfs_release()\sinterface.\s\sLess\smemory\sallocated\sfor\sa\spager\nin\sthe\scommon\scase\swhere\sthe\ssize\sof\sthe\spathname\sis\sless\sthan\sMAX_PATH.\s(CVS\s4287)
-D 2007-08-24T16:08:29
+C Fix\sbugs\sin\stemp\sdatabase\shandling\sintroduced\sby\sthe\sprevous\scheck-in.\s(CVS\s4288)
+D 2007-08-24T16:29:24
F Makefile.in 0c0e53720f658c7a551046442dd7afba0b72bfbe
F Makefile.linux-gcc 65241babba6faf1152bf86574477baab19190499
F README 9c4e2d6706bdcc3efdd773ce752a8cdab4f90028
F src/os_unix.h 5768d56d28240d3fe4537fac08cc85e4fb52279e
F src/os_win.c e2598a18dbcb70cba888cebd37fb46d1eaee82b1
F src/os_win.h 41a946bea10f61c158ce8645e7646b29d44f122b
-F src/pager.c f5c2a4e85b632faa7cd891c214f1cfd021c1ffa9
+F src/pager.c b076458d72dcda7517c49aae0f0fd43c9a1195e5
F src/pager.h 53087c6fb9db01aed17c7fd044662a27507e89b8
F src/parse.y 2d2ce439dc6184621fb0b86f4fc5aca7f391a590
F src/pragma.c 9b989506a1b7c8aecd6befb8235e2f57a4aba7e5
F test/misuse.test 30b3a458e5a70c31e74c291937b6c82204c59f33
F test/notnull.test 44d600f916b770def8b095a9962dbe3be5a70d82
F test/null.test 9503e1f63e959544c006d9f01709c5b5eab67d54
-F test/pager.test f07c06fef8e3b4964a9b337b751b56825a44d326
+F test/pager.test 60303481b22b240c18d6dd1b64edcecc2f4b5a97
F test/pager2.test c025f91b75fe65e85febda64d9416428b8a5cab5
F test/pager3.test 2323bf27fd5bd887b580247e5bce500ceee994b4
F test/pageropt.test 51e3c091bc2992f5098f7576e3594e1908988939
F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0
F www/version3.tcl 890248cf7b70e60c383b0e84d77d5132b3ead42b
F www/whentouse.tcl fc46eae081251c3c181bd79c5faef8195d7991a5
-P 13dda2e8e879835c21e539ba3ff8f96face1af4c
-R 9943ec857d44edaed5e279e84f17aaa5
+P b8451da378179d43f25d9a014480c0f13dd1dc37
+R 56a3777f2f9b394db341a6008cd56bd7
U drh
-Z a0440ce84e84a78d112a7ad4d7f13668
+Z 62539d3b8746b570b0ccb1349666e464
-b8451da378179d43f25d9a014480c0f13dd1dc37
\ No newline at end of file
+300038be9368556a29efce7cf3657fabfe54d8f9
\ No newline at end of file
** file simultaneously, or one process from reading the database while
** another is writing.
**
-** @(#) $Id: pager.c,v 1.375 2007/08/24 16:08:29 drh Exp $
+** @(#) $Id: pager.c,v 1.376 2007/08/24 16:29:24 drh Exp $
*/
#ifndef SQLITE_OMIT_DISKIO
#include "sqliteInt.h"
** other error code if we fail. The OS will automatically delete the temporary
** file when it is closed.
**
-** If zNameOut is 0, then SQLITE_OPEN_SUBJOURNAL is passed to the OS layer.
-** If zNameOut is not 0, SQLITE_OPEN_TEMP_DB is passed.
+** If zFilename is 0, then an appropriate temporary filename is
+** generated automatically and SQLITE_OPEN_SUBJOURNAL is passed to
+** the OS layer as the file type.
+**
+** If zFilename is not 0, SQLITE_OPEN_TEMP_DB is passed as the file type.
*/
static int sqlite3PagerOpentemp(
sqlite3_vfs *pVfs,
sqlite3_file *pFile,
- char *zNameOut
+ char *zFilename
){
- int cnt = 8;
int rc;
int flags = (
SQLITE_OPEN_READWRITE|SQLITE_OPEN_CREATE|
);
char *zFree = 0;
- if( zNameOut==0 ){
+ if( zFilename==0 ){
zFree = (char *)sqlite3_malloc(pVfs->mxPathname);
if( !zFree ){
return SQLITE_NOMEM;
}
- zNameOut = zFree;
+ zFilename = zFree;
flags |= SQLITE_OPEN_SUBJOURNAL;
+ rc = sqlite3OsGetTempName(pVfs, zFilename);
+ if( rc!=SQLITE_OK ){
+ sqlite3_free(zFree);
+ return rc;
+ }
}else{
flags |= SQLITE_OPEN_TEMP_DB;
}
sqlite3_opentemp_count++; /* Used for testing and analysis only */
#endif
- do{
- cnt--;
- sqlite3OsGetTempName(pVfs, zNameOut);
- rc = sqlite3OsOpen(pVfs, zNameOut, pFile, flags, 0);
- assert( rc!=SQLITE_OK || pFile->pMethods );
- }while( cnt>0 && rc!=SQLITE_OK && rc!=SQLITE_NOMEM );
-
+ rc = sqlite3OsOpen(pVfs, zFilename, pFile, flags, 0);
+ assert( rc!=SQLITE_OK || pFile->pMethods );
sqlite3_free(zFree);
return rc;
}
#endif
{
rc = sqlite3OsFullPathname(pVfs, zFilename, zPathname);
- if( rc!=SQLITE_OK ){
- sqlite3_free(zPathname);
- return rc;
- }
}
}else{
- zPathname[0] = 0;
+ rc = sqlite3OsGetTempName(pVfs, zPathname);
+ }
+ if( rc!=SQLITE_OK ){
+ sqlite3_free(zPathname);
+ return rc;
}
nPathname = strlen(zPathname);
/* Open the pager file.
*/
- if( pPager->zFilename[0] ){
+ if( zFilename && zFilename[0] && !memDb ){
if( nPathname>(pVfs->mxPathname - sizeof("-journal")) ){
rc = SQLITE_CANTOPEN;
}else{
# This file implements regression tests for SQLite library. The
# focus of this script is page cache subsystem.
#
-# $Id: pager.test,v 1.29 2007/08/24 16:08:29 drh Exp $
+# $Id: pager.test,v 1.30 2007/08/24 16:29:24 drh Exp $
set testdir [file dirname $argv0]
# Test truncate on an in-memory database is Ok.
ifcapable memorydb {
do_test pager-4.6.2 {
-btree_breakpoint
set ::p2 [pager_open :memory: 10]
pager_truncate $::p2 5
} {}