SQLite

Check-in [75deaa442f]
Login

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

Overview
Comment:Remove an obsolete layer of redirection in pager.c. (CVS 5723)
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 75deaa442f3a363c4ea5b6f0e510306feeaa8915
User & Date: danielk1977 2008-09-19 09:14:44.000
Context
2008-09-19
15:10
In sqlite3BtreeGetMeta(), if BtShared.pPage1 is available use it instead of requesting a new reference from the pager layer. (CVS 5724) (check-in: 59be34cfa4 user: danielk1977 tags: trunk)
09:14
Remove an obsolete layer of redirection in pager.c. (CVS 5723) (check-in: 75deaa442f user: danielk1977 tags: trunk)
2008-09-18
18:18
Do not run the async tests if the async module is not installed. (CVS 5722) (check-in: 4de71a4e2f user: drh tags: trunk)
Changes
Side-by-Side Diff Ignore Whitespace Patch
Changes to src/pager.c.
14
15
16
17
18
19
20
21

22
23
24
25
26
27
28
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.492 2008/09/18 17:34:44 danielk1977 Exp $
** @(#) $Id: pager.c,v 1.493 2008/09/19 09:14:44 danielk1977 Exp $
*/
#ifndef SQLITE_OMIT_DISKIO
#include "sqliteInt.h"

/*
** Macros for troubleshooting.  Normally turned off
*/
2789
2790
2791
2792
2793
2794
2795
2796

2797
2798
2799
2800
2801
2802
2803
2789
2790
2791
2792
2793
2794
2795

2796
2797
2798
2799
2800
2801
2802
2803







-
+







** of the page at this time, so do not do a disk read.  Just fill in the
** page content with zeros.  But mark the fact that we have not read the
** content by setting the PgHdr.needRead flag.  Later on, if 
** sqlite3PagerWrite() is called on this page or if this routine is
** called again with noContent==0, that means that the content is needed
** and the disk read should occur at that point.
*/
static int pagerAcquire(
int sqlite3PagerAcquire(
  Pager *pPager,      /* The pager open on the database file */
  Pgno pgno,          /* Page number to fetch */
  DbPage **ppPage,    /* Write a pointer to the page here */
  int noContent       /* Do not bother reading content from disk if true */
){
  PgHdr *pPg = 0;
  int rc;
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2885
2886
2887
2888
2889
2890
2891












2892
2893
2894
2895
2896
2897
2898







-
-
-
-
-
-
-
-
-
-
-
-







      }
    }
  }

  *ppPage = pPg;
  return SQLITE_OK;
}

int sqlite3PagerAcquire(
  Pager *pPager,      /* The pager open on the database file */
  Pgno pgno,          /* Page number to fetch */
  DbPage **ppPage,    /* Write a pointer to the page here */
  int noContent       /* Do not bother reading content from disk if true */
){
  int rc;
  rc = pagerAcquire(pPager, pgno, ppPage, noContent);
  return rc;
}


/*
** Acquire a page if it is already in the in-memory cache.  Do
** not read the page from disk.  Return a pointer to the page,
** or 0 if the page is not in cache.
**
** See also sqlite3PagerGet().  The difference between this routine