/ Check-in [36115e40]
Login

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

Overview
Comment:Change an unreachable error condition test to an assert() in rowset.c. (CVS 6429)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:36115e4073528f03253dd94fadf3954522c0dfb9
User & Date: drh 2009-04-01 19:35:55
Context
2009-04-01
20:44
Fix the strftime() function so that the %s format can handle dates outside of the range of 1901 to 2038. Ticket #3769. (CVS 6430) check-in: a95b843a user: drh tags: trunk
19:35
Change an unreachable error condition test to an assert() in rowset.c. (CVS 6429) check-in: 36115e40 user: drh tags: trunk
19:07
Remove an unreachable branch from lockBtree(). Add comments. (CVS 6428) check-in: 85979295 user: danielk1977 tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/rowset.c.

21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
...
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
** This implementation accumulates rowids in a linked list.  For
** output, it first sorts the linked list (removing duplicates during
** the sort) then returns elements one by one by walking the list.
**
** Big chunks of rowid/next-ptr pairs are allocated at a time, to
** reduce the malloc overhead.
**
** $Id: rowset.c,v 1.3 2009/01/13 20:14:16 drh Exp $
*/
#include "sqliteInt.h"

/*
** The number of rowset entries per allocation chunk.
*/
#define ROWSET_ENTRY_PER_CHUNK  63
................................................................................
**
** The mallocFailed flag of the database connection is set if a
** memory allocation fails.
*/
void sqlite3RowSetInsert(RowSet *p, i64 rowid){
  struct RowSetEntry *pEntry;
  struct RowSetEntry *pLast;
  if( p==0 ) return;  /* Must have been a malloc failure */
  if( p->nFresh==0 ){
    struct RowSetChunk *pNew;
    pNew = sqlite3DbMallocRaw(p->db, sizeof(*pNew));
    if( pNew==0 ){
      return;
    }
    pNew->pNext = p->pChunk;







|







 







|







21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
...
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
** This implementation accumulates rowids in a linked list.  For
** output, it first sorts the linked list (removing duplicates during
** the sort) then returns elements one by one by walking the list.
**
** Big chunks of rowid/next-ptr pairs are allocated at a time, to
** reduce the malloc overhead.
**
** $Id: rowset.c,v 1.4 2009/04/01 19:35:55 drh Exp $
*/
#include "sqliteInt.h"

/*
** The number of rowset entries per allocation chunk.
*/
#define ROWSET_ENTRY_PER_CHUNK  63
................................................................................
**
** The mallocFailed flag of the database connection is set if a
** memory allocation fails.
*/
void sqlite3RowSetInsert(RowSet *p, i64 rowid){
  struct RowSetEntry *pEntry;
  struct RowSetEntry *pLast;
  assert( p!=0 );
  if( p->nFresh==0 ){
    struct RowSetChunk *pNew;
    pNew = sqlite3DbMallocRaw(p->db, sizeof(*pNew));
    if( pNew==0 ){
      return;
    }
    pNew->pNext = p->pChunk;