SQLite

Check-in [cf4e3c158a]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Ensure temporary files are deleted when they are closed. (CVS 4277)
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: cf4e3c158aa71afc91f263a314c2e750d191fb41
User & Date: danielk1977 2007-08-23 11:47:59.000
Context
2007-08-23
14:48
Add code to reduce rollback journal i/o based on IOCAP flags. As yet untested. (CVS 4278) (check-in: 595568492e user: danielk1977 tags: trunk)
11:47
Ensure temporary files are deleted when they are closed. (CVS 4277) (check-in: cf4e3c158a user: danielk1977 tags: trunk)
11:07
Add some further tests and a bugfix for the atomic-write optimization. (CVS 4276) (check-in: 5f0fb894f4 user: danielk1977 tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/pager.c.
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
** The pager is used to access a database disk file.  It implements
** atomic commit and rollback through the use of a journal file that
** is separate from the database file.  The pager also implements file
** locking to prevent two processes from writing the same database
** file simultaneously, or one process from reading the database while
** another is writing.
**
** @(#) $Id: pager.c,v 1.369 2007/08/23 11:07:10 danielk1977 Exp $
*/
#ifndef SQLITE_OMIT_DISKIO
#include "sqliteInt.h"
#include <assert.h>
#include <string.h>

/*







|







14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
** The pager is used to access a database disk file.  It implements
** atomic commit and rollback through the use of a journal file that
** is separate from the database file.  The pager also implements file
** locking to prevent two processes from writing the same database
** file simultaneously, or one process from reading the database while
** another is writing.
**
** @(#) $Id: pager.c,v 1.370 2007/08/23 11:47:59 danielk1977 Exp $
*/
#ifndef SQLITE_OMIT_DISKIO
#include "sqliteInt.h"
#include <assert.h>
#include <string.h>

/*
1794
1795
1796
1797
1798
1799
1800

1801


1802
1803
1804
1805
1806
1807
1808
static int sqlite3PagerOpentemp(
  sqlite3_vfs *pVfs, 
  sqlite3_file *pFile, 
  char *zNameOut
){
  int cnt = 8;
  int rc;

  int flags = (SQLITE_OPEN_READWRITE|SQLITE_OPEN_CREATE|SQLITE_OPEN_EXCLUSIVE);



  char *zFree = 0;
  if( zNameOut==0 ){
    zFree = (char *)sqlite3_malloc(pVfs->mxPathname);
    if( !zFree ){
      return SQLITE_NOMEM;
    }







>
|
>
>







1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
static int sqlite3PagerOpentemp(
  sqlite3_vfs *pVfs, 
  sqlite3_file *pFile, 
  char *zNameOut
){
  int cnt = 8;
  int rc;
  int flags = (
     SQLITE_OPEN_READWRITE|SQLITE_OPEN_CREATE|
     SQLITE_OPEN_EXCLUSIVE|SQLITE_OPEN_DELETEONCLOSE
  );

  char *zFree = 0;
  if( zNameOut==0 ){
    zFree = (char *)sqlite3_malloc(pVfs->mxPathname);
    if( !zFree ){
      return SQLITE_NOMEM;
    }