SQLite

Check-in [efda310480]
Login

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

Overview
Comment:Not true: For a zeroblob, the Mem.z pointer can be null: The Mem.z pointer can never been NULL for a string or blob, even a zero-length string or blob. Assert this fact.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | mistake
Files: files | file ages | folders
SHA1: efda3104800c1e10006250137d9d8ed7b4e02ecf
User & Date: drh 2010-10-01 15:11:09.000
Original Comment: The Mem.z pointer can never been NULL for a string or blob, even a zero-length string or blob. Assert this fact.
Context
2010-10-01
15:11
Not true: For a zeroblob, the Mem.z pointer can be null: The Mem.z pointer can never been NULL for a string or blob, even a zero-length string or blob. Assert this fact. (Closed-Leaf check-in: efda310480 user: drh tags: mistake)
13:28
Updates to the showjournal.c utility in order to bring it up to version 3. (check-in: fa97d89546 user: drh tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/vdbemem.c.
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
  flags = pMem->flags;
  if( flags & MEM_Int ){
    return pMem->u.i;
  }else if( flags & MEM_Real ){
    return doubleToInt64(pMem->r);
  }else if( flags & (MEM_Str|MEM_Blob) ){
    i64 value;
    assert( pMem->z || pMem->n==0 );
    testcase( pMem->z==0 );
    sqlite3Atoi64(pMem->z, &value, pMem->n, pMem->enc);
    return value;
  }else{
    return 0;
  }
}








|
<







364
365
366
367
368
369
370
371

372
373
374
375
376
377
378
  flags = pMem->flags;
  if( flags & MEM_Int ){
    return pMem->u.i;
  }else if( flags & MEM_Real ){
    return doubleToInt64(pMem->r);
  }else if( flags & (MEM_Str|MEM_Blob) ){
    i64 value;
    assert( pMem->z );

    sqlite3Atoi64(pMem->z, &value, pMem->n, pMem->enc);
    return value;
  }else{
    return 0;
  }
}