/ Check-in [62c44634]
Login

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

Overview
Comment:Avoid segfaulting on an incremental blob write if SQLITE_ENABLE_PREUPDATE_HOOK set but no pre-update hooks are defined.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | sessions
Files: files | file ages | folders
SHA1:62c446340475b52b843c0345eda32ebe86fa9159
User & Date: drh 2011-08-03 21:32:11
Context
2011-08-03
21:46
Merge the latest trunk changes into the sessions branch. check-in: c5709036 user: drh tags: sessions
21:32
Avoid segfaulting on an incremental blob write if SQLITE_ENABLE_PREUPDATE_HOOK set but no pre-update hooks are defined. check-in: 62c44634 user: drh tags: sessions
2011-07-26
17:53
Fix errors in a comment in sqlite3session.c. No changes to code. check-in: d5f4c4c0 user: dan tags: sessions
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/vdbeblob.c.

388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
    /* Call either BtreeData() or BtreePutData(). If SQLITE_ABORT is
    ** returned, clean-up the statement handle.
    */
    assert( db == v->db );
    sqlite3BtreeEnterCursor(p->pCsr);

#ifdef SQLITE_ENABLE_PREUPDATE_HOOK
    if( xCall==sqlite3BtreePutData ){
      /* If a pre-update hook is registered and this is a write cursor, 
      ** invoke it here. 
      ** 
      ** TODO: The preupdate-hook is passed SQLITE_DELETE, even though this
      ** operation should really be an SQLITE_UPDATE. This is probably
      ** incorrect, but is convenient because at this point the new.* values 
      ** are not easily obtainable. And for the sessions module, an 







|







388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
    /* Call either BtreeData() or BtreePutData(). If SQLITE_ABORT is
    ** returned, clean-up the statement handle.
    */
    assert( db == v->db );
    sqlite3BtreeEnterCursor(p->pCsr);

#ifdef SQLITE_ENABLE_PREUPDATE_HOOK
    if( xCall==sqlite3BtreePutData && db->xPreUpdateCallback ){
      /* If a pre-update hook is registered and this is a write cursor, 
      ** invoke it here. 
      ** 
      ** TODO: The preupdate-hook is passed SQLITE_DELETE, even though this
      ** operation should really be an SQLITE_UPDATE. This is probably
      ** incorrect, but is convenient because at this point the new.* values 
      ** are not easily obtainable. And for the sessions module, an