/ Check-in [b623538c]
Login

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

Overview
Comment:Get the build working with SQLITE_OMIT_SHARED_CACHE. Ticket #2307. (CVS 3857)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:b623538c559498b858fd9088faf0f3457b024968
User & Date: drh 2007-04-19 00:24:34
Context
2007-04-19
11:09
Fix a bug whereby sqlite3_prepare_v2() could return both an out-of-memory error and a valid statement handle. (CVS 3858) check-in: 8795d11c user: danielk1977 tags: trunk
00:24
Get the build working with SQLITE_OMIT_SHARED_CACHE. Ticket #2307. (CVS 3857) check-in: b623538c user: drh tags: trunk
2007-04-18
17:07
Fix a && where & was intended. This is a real problem, but it would be very difficult to devise a test case where it might lead to an unexpected result. Ticket #2306. (CVS 3856) check-in: 7f9f0444 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Show Whitespace Changes Patch

Changes to src/btree.c.

     5      5   ** a legal notice, here is a blessing:
     6      6   **
     7      7   **    May you do good and not evil.
     8      8   **    May you find forgiveness for yourself and forgive others.
     9      9   **    May you share freely, never taking more than you give.
    10     10   **
    11     11   *************************************************************************
    12         -** $Id: btree.c,v 1.355 2007/04/13 02:14:30 drh Exp $
           12  +** $Id: btree.c,v 1.356 2007/04/19 00:24:34 drh Exp $
    13     13   **
    14     14   ** This file implements a external (disk-based) database using BTrees.
    15     15   ** For a detailed discussion of BTrees, refer to
    16     16   **
    17     17   **     Donald E. Knuth, THE ART OF COMPUTER PROGRAMMING, Volume 3:
    18     18   **     "Sorting And Searching", pages 473-480. Addison-Wesley
    19     19   **     Publishing Company, Reading, Massachusetts.
................................................................................
  3515   3515   ** was already pointing to the last entry in the database before
  3516   3516   ** this routine was called, then set *pRes=1.
  3517   3517   */
  3518   3518   int sqlite3BtreeNext(BtCursor *pCur, int *pRes){
  3519   3519     int rc;
  3520   3520     MemPage *pPage;
  3521   3521   
  3522         -#ifndef SQLITE_OMIT_SHARED_CACHE
  3523   3522     rc = restoreOrClearCursorPosition(pCur);
  3524   3523     if( rc!=SQLITE_OK ){
  3525   3524       return rc;
  3526   3525     }
  3527         -#endif 
  3528   3526     assert( pRes!=0 );
  3529   3527     pPage = pCur->pPage;
  3530   3528     if( CURSOR_INVALID==pCur->eState ){
  3531   3529       *pRes = 1;
  3532   3530       return SQLITE_OK;
  3533   3531     }
  3534         -#ifndef SQLITE_OMIT_SHARED_CACHE
  3535   3532     if( pCur->skip>0 ){
  3536   3533       pCur->skip = 0;
  3537   3534       *pRes = 0;
  3538   3535       return SQLITE_OK;
  3539   3536     }
  3540   3537     pCur->skip = 0;
  3541         -#endif 
  3542   3538   
  3543   3539     assert( pPage->isInit );
  3544   3540     assert( pCur->idx<pPage->nCell );
  3545   3541   
  3546   3542     pCur->idx++;
  3547   3543     pCur->info.nSize = 0;
  3548   3544     if( pCur->idx>=pPage->nCell ){
................................................................................
  3585   3581   ** this routine was called, then set *pRes=1.
  3586   3582   */
  3587   3583   int sqlite3BtreePrevious(BtCursor *pCur, int *pRes){
  3588   3584     int rc;
  3589   3585     Pgno pgno;
  3590   3586     MemPage *pPage;
  3591   3587   
  3592         -#ifndef SQLITE_OMIT_SHARED_CACHE
  3593   3588     rc = restoreOrClearCursorPosition(pCur);
  3594   3589     if( rc!=SQLITE_OK ){
  3595   3590       return rc;
  3596   3591     }
  3597         -#endif
  3598   3592     if( CURSOR_INVALID==pCur->eState ){
  3599   3593       *pRes = 1;
  3600   3594       return SQLITE_OK;
  3601   3595     }
  3602         -#ifndef SQLITE_OMIT_SHARED_CACHE
  3603   3596     if( pCur->skip<0 ){
  3604   3597       pCur->skip = 0;
  3605   3598       *pRes = 0;
  3606   3599       return SQLITE_OK;
  3607   3600     }
  3608   3601     pCur->skip = 0;
  3609         -#endif
  3610   3602   
  3611   3603     pPage = pCur->pPage;
  3612   3604     assert( pPage->isInit );
  3613   3605     assert( pCur->idx>=0 );
  3614   3606     if( !pPage->leaf ){
  3615   3607       pgno = get4byte( findCell(pPage, pCur->idx) );
  3616   3608       rc = moveToChild(pCur, pgno);

Changes to src/vtab.c.

     7      7   **    May you do good and not evil.
     8      8   **    May you find forgiveness for yourself and forgive others.
     9      9   **    May you share freely, never taking more than you give.
    10     10   **
    11     11   *************************************************************************
    12     12   ** This file contains code used to help implement virtual tables.
    13     13   **
    14         -** $Id: vtab.c,v 1.42 2007/04/18 14:24:34 danielk1977 Exp $
           14  +** $Id: vtab.c,v 1.43 2007/04/19 00:24:35 drh Exp $
    15     15   */
    16     16   #ifndef SQLITE_OMIT_VIRTUALTABLE
    17     17   #include "sqliteInt.h"
    18     18   
    19     19   /*
    20     20   ** External API function used to create a new virtual-table module.
    21     21   */
................................................................................
   128    128     Token *pName1,        /* Name of new table, or database name */
   129    129     Token *pName2,        /* Name of new table or NULL */
   130    130     Token *pModuleName    /* Name of the module for the virtual table */
   131    131   ){
   132    132     int iDb;              /* The database the table is being created in */
   133    133     Table *pTable;        /* The new virtual table */
   134    134   
          135  +#ifndef SQLITE_OMIT_SHARED_CACHE
   135    136     if( sqlite3ThreadDataReadOnly()->useSharedData ){
   136    137       sqlite3ErrorMsg(pParse, "Cannot use virtual tables in shared-cache mode");
   137    138       return;
   138    139     }
          140  +#endif
   139    141   
   140    142     sqlite3StartTable(pParse, pName1, pName2, 0, 0, 1, 0);
   141    143     pTable = pParse->pNewTable;
   142    144     if( pTable==0 || pParse->nErr ) return;
   143    145     assert( 0==pTable->pIndex );
   144    146   
   145    147     iDb = sqlite3SchemaToIndex(pParse->db, pTable->pSchema);