/ Check-in [73eec675]
Login

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

Overview
Comment:Remove some pointless asserts from btree.c. (CVS 1768)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 73eec675059f6d2178c6175268e80750378bf07b
User & Date: drh 2004-06-30 01:07:02
Context
2004-06-30
02:29
Some extra tests for the OP_MustBeInt opcode. (CVS 1769) check-in: b9d5858c user: drh tags: trunk
01:07
Remove some pointless asserts from btree.c. (CVS 1768) check-in: 73eec675 user: drh tags: trunk
2004-06-29
23:52
Run tests in UTF-16 mode. (CVS 1767) check-in: 822bee3a user: danielk1977 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.174 2004/06/28 01:11:46 danielk1977 Exp $
           12  +** $Id: btree.c,v 1.175 2004/06/30 01:07:02 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.
................................................................................
  1769   1769   ** begins at "offset".
  1770   1770   **
  1771   1771   ** Return SQLITE_OK on success or an error code if anything goes
  1772   1772   ** wrong.  An error is returned if "offset+amt" is larger than
  1773   1773   ** the available payload.
  1774   1774   */
  1775   1775   int sqlite3BtreeKey(BtCursor *pCur, u32 offset, u32 amt, void *pBuf){
  1776         -  assert( amt>=0 );
  1777         -  assert( offset>=0 );
  1778   1776     if( pCur->isValid==0 ){
  1779   1777       return pCur->status;
  1780   1778     }
  1781   1779     assert( pCur->pPage!=0 );
  1782   1780     assert( pCur->pPage->intKey==0 );
  1783   1781     assert( pCur->idx>=0 && pCur->idx<pCur->pPage->nCell );
  1784   1782     return getPayload(pCur, offset, amt, (unsigned char*)pBuf, 0);
................................................................................
  1793   1791   ** wrong.  An error is returned if "offset+amt" is larger than
  1794   1792   ** the available payload.
  1795   1793   */
  1796   1794   int sqlite3BtreeData(BtCursor *pCur, u32 offset, u32 amt, void *pBuf){
  1797   1795     if( !pCur->isValid ){
  1798   1796       return pCur->status ? pCur->status : SQLITE_INTERNAL;
  1799   1797     }
  1800         -  assert( amt>=0 );
  1801         -  assert( offset>=0 );
  1802   1798     assert( pCur->pPage!=0 );
  1803   1799     assert( pCur->idx>=0 && pCur->idx<pCur->pPage->nCell );
  1804   1800     return getPayload(pCur, offset, amt, pBuf, 1);
  1805   1801   }
  1806   1802   
  1807   1803   /*
  1808   1804   ** Return a pointer to payload information from the entry that the