/ Check-in [6dfd4a12]
Login

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

Overview
Comment:Remove vestiges of the SQLITE_PROTOCOL error. (CVS 3773)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:6dfd4a12a8a03c204505e7a211e179b7dd47e4fb
User & Date: drh 2007-03-30 20:43:41
Context
2007-03-30
20:46
Remove vestiges of SQLITE_PROTOCOL from the test scripts. (CVS 3774) check-in: e5e8d563 user: drh tags: trunk
20:43
Remove vestiges of the SQLITE_PROTOCOL error. (CVS 3773) check-in: 6dfd4a12 user: drh tags: trunk
20:40
Fix a memory leak that occurs after a malloc failure in trigger parsing. (CVS 3772) check-in: 407a85e6 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace 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.347 2007/03/30 14:06:34 drh Exp $
           12  +** $Id: btree.c,v 1.348 2007/03/30 20:43:41 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.
................................................................................
  1836   1836   /*
  1837   1837   ** Get a reference to pPage1 of the database file.  This will
  1838   1838   ** also acquire a readlock on that file.
  1839   1839   **
  1840   1840   ** SQLITE_OK is returned on success.  If the file is not a
  1841   1841   ** well-formed database file, then SQLITE_CORRUPT is returned.
  1842   1842   ** SQLITE_BUSY is returned if the database is locked.  SQLITE_NOMEM
  1843         -** is returned if we run out of memory.  SQLITE_PROTOCOL is returned
  1844         -** if there is a locking protocol violation.
         1843  +** is returned if we run out of memory. 
  1845   1844   */
  1846   1845   static int lockBtree(BtShared *pBt){
  1847   1846     int rc, pageSize;
  1848   1847     MemPage *pPage1;
  1849   1848     if( pBt->pPage1 ) return SQLITE_OK;
  1850   1849     rc = getPage(pBt, 1, &pPage1, 0);
  1851   1850     if( rc!=SQLITE_OK ) return rc;

Changes to src/main.c.

    10     10   **
    11     11   *************************************************************************
    12     12   ** Main file for the SQLite library.  The routines in this file
    13     13   ** implement the programmer interface to the library.  Routines in
    14     14   ** other files are for internal use by SQLite and should not be
    15     15   ** accessed by users of the library.
    16     16   **
    17         -** $Id: main.c,v 1.365 2007/03/30 11:29:32 drh Exp $
           17  +** $Id: main.c,v 1.366 2007/03/30 20:43:42 drh Exp $
    18     18   */
    19     19   #include "sqliteInt.h"
    20     20   #include "os.h"
    21     21   #include <ctype.h>
    22     22   
    23     23   /*
    24     24   ** The following constant value is used by the SQLITE_BIGENDIAN and
................................................................................
   256    256       case SQLITE_NOMEM:      z = "out of memory";                         break;
   257    257       case SQLITE_READONLY:   z = "attempt to write a readonly database";  break;
   258    258       case SQLITE_INTERRUPT:  z = "interrupted";                           break;
   259    259       case SQLITE_IOERR:      z = "disk I/O error";                        break;
   260    260       case SQLITE_CORRUPT:    z = "database disk image is malformed";      break;
   261    261       case SQLITE_FULL:       z = "database or disk is full";              break;
   262    262       case SQLITE_CANTOPEN:   z = "unable to open database file";          break;
   263         -    case SQLITE_PROTOCOL:   z = "database locking protocol failure";     break;
   264    263       case SQLITE_EMPTY:      z = "table contains no data";                break;
   265    264       case SQLITE_SCHEMA:     z = "database schema has changed";           break;
   266    265       case SQLITE_CONSTRAINT: z = "constraint failed";                     break;
   267    266       case SQLITE_MISMATCH:   z = "datatype mismatch";                     break;
   268    267       case SQLITE_MISUSE:     z = "library routine called out of sequence";break;
   269    268       case SQLITE_NOLFS:      z = "kernel lacks large file support";       break;
   270    269       case SQLITE_AUTH:       z = "authorization denied";                  break;

Changes to src/pager.c.

    14     14   ** The pager is used to access a database disk file.  It implements
    15     15   ** atomic commit and rollback through the use of a journal file that
    16     16   ** is separate from the database file.  The pager also implements file
    17     17   ** locking to prevent two processes from writing the same database
    18     18   ** file simultaneously, or one process from reading the database while
    19     19   ** another is writing.
    20     20   **
    21         -** @(#) $Id: pager.c,v 1.310 2007/03/30 17:18:51 drh Exp $
           21  +** @(#) $Id: pager.c,v 1.311 2007/03/30 20:43:42 drh Exp $
    22     22   */
    23     23   #ifndef SQLITE_OMIT_DISKIO
    24     24   #include "sqliteInt.h"
    25     25   #include "os.h"
    26     26   #include "pager.h"
    27     27   #include <assert.h>
    28     28   #include <string.h>
................................................................................
   211    211   #define PGHDR_TO_EXTRA(G,P) ((void*)&((char*)(&(G)[1]))[(P)->pageSize])
   212    212   #define PGHDR_TO_HIST(P,PGR)  \
   213    213               ((PgHistory*)&((char*)(&(P)[1]))[(PGR)->pageSize+(PGR)->nExtra])
   214    214   
   215    215   /*
   216    216   ** A open page cache is an instance of the following structure.
   217    217   **
   218         -** Pager.errCode may be set to SQLITE_IOERR, SQLITE_CORRUPT, SQLITE_PROTOCOL
          218  +** Pager.errCode may be set to SQLITE_IOERR, SQLITE_CORRUPT, or
   219    219   ** or SQLITE_FULL. Once one of the first three errors occurs, it persists
   220    220   ** and is returned as the result of every major pager API call.  The
   221    221   ** SQLITE_FULL return code is slightly different. It persists only until the
   222    222   ** next successful rollback is performed on the pager cache. Also,
   223    223   ** SQLITE_FULL does not affect the sqlite3PagerGet() and sqlite3PagerLookup()
   224    224   ** APIs, they may still be used successfully.
   225    225   */
................................................................................
   471    471   
   472    472   /*
   473    473   ** This function should be called when an error occurs within the pager
   474    474   ** code. The first argument is a pointer to the pager structure, the
   475    475   ** second the error-code about to be returned by a pager API function. 
   476    476   ** The value returned is a copy of the second argument to this function. 
   477    477   **
   478         -** If the second argument is SQLITE_IOERR, SQLITE_CORRUPT or SQLITE_PROTOCOL,
          478  +** If the second argument is SQLITE_IOERR, SQLITE_CORRUPT, or SQLITE_FULL
   479    479   ** the error becomes persistent. All subsequent API calls on this Pager
   480    480   ** will immediately return the same error code.
   481    481   */
   482    482   static int pager_error(Pager *pPager, int rc){
   483    483     int rc2 = rc & 0xff;
   484    484     assert( pPager->errCode==SQLITE_FULL || pPager->errCode==SQLITE_OK );
   485    485     if(
   486    486       rc2==SQLITE_FULL ||
   487    487       rc2==SQLITE_IOERR ||
   488         -    rc2==SQLITE_CORRUPT ||
   489         -    rc2==SQLITE_PROTOCOL
          488  +    rc2==SQLITE_CORRUPT
   490    489     ){
   491    490       pPager->errCode = rc;
   492    491     }
   493    492     return rc;
   494    493   }
   495    494   
   496    495   #ifdef SQLITE_CHECK_PAGES
................................................................................
  3786   3785   
  3787   3786   /*
  3788   3787   ** Rollback all changes.  The database falls back to PAGER_SHARED mode.
  3789   3788   ** All in-memory cache pages revert to their original data contents.
  3790   3789   ** The journal is deleted.
  3791   3790   **
  3792   3791   ** This routine cannot fail unless some other process is not following
  3793         -** the correct locking protocol (SQLITE_PROTOCOL) or unless some other
         3792  +** the correct locking protocol or unless some other
  3794   3793   ** process is writing trash into the journal file (SQLITE_CORRUPT) or
  3795   3794   ** unless a prior malloc() failed (SQLITE_NOMEM).  Appropriate error
  3796   3795   ** codes are returned for all these occasions.  Otherwise,
  3797   3796   ** SQLITE_OK is returned.
  3798   3797   */
  3799   3798   int sqlite3PagerRollback(Pager *pPager){
  3800   3799     int rc;

Changes to src/sqlite.h.in.

     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 header file defines the interface that the SQLite library
    13     13   ** presents to client programs.
    14     14   **
    15         -** @(#) $Id: sqlite.h.in,v 1.200 2007/03/28 13:07:41 drh Exp $
           15  +** @(#) $Id: sqlite.h.in,v 1.201 2007/03/30 20:43:42 drh Exp $
    16     16   */
    17     17   #ifndef _SQLITE3_H_
    18     18   #define _SQLITE3_H_
    19     19   #include <stdarg.h>     /* Needed for the definition of va_list */
    20     20   
    21     21   /*
    22     22   ** Make sure we can call this stuff from C++.
................................................................................
   178    178   #define SQLITE_READONLY     8   /* Attempt to write a readonly database */
   179    179   #define SQLITE_INTERRUPT    9   /* Operation terminated by sqlite3_interrupt()*/
   180    180   #define SQLITE_IOERR       10   /* Some kind of disk I/O error occurred */
   181    181   #define SQLITE_CORRUPT     11   /* The database disk image is malformed */
   182    182   #define SQLITE_NOTFOUND    12   /* NOT USED. Table or record not found */
   183    183   #define SQLITE_FULL        13   /* Insertion failed because database is full */
   184    184   #define SQLITE_CANTOPEN    14   /* Unable to open the database file */
   185         -#define SQLITE_PROTOCOL    15   /* Database lock protocol error */
          185  +#define SQLITE_PROTOCOL    15   /* NOT USED. Database lock protocol error */
   186    186   #define SQLITE_EMPTY       16   /* Database is empty */
   187    187   #define SQLITE_SCHEMA      17   /* The database schema changed */
   188    188   #define SQLITE_TOOBIG      18   /* NOT USED. Too much data for one row */
   189    189   #define SQLITE_CONSTRAINT  19   /* Abort due to contraint violation */
   190    190   #define SQLITE_MISMATCH    20   /* Data type mismatch */
   191    191   #define SQLITE_MISUSE      21   /* Library used incorrectly */
   192    192   #define SQLITE_NOLFS       22   /* Uses OS features not supported on host */