/ Check-in [62257eb5]
Login

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

Overview
Comment:Fix a problem causing the pre-update hook to be passed an incorrect rowid value in some single-pass multi-row updates.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | onepass-update
Files: files | file ages | folders
SHA1: 62257eb53c13d4c7ed128d5d89f6f10d4aff945c
User & Date: dan 2017-01-11 20:10:30
Context
2017-01-11
21:03
Changes to allow some multi-row UPDATE statements to avoid the two-pass approach. check-in: 7ae6104a user: dan tags: trunk
20:10
Fix a problem causing the pre-update hook to be passed an incorrect rowid value in some single-pass multi-row updates. Closed-Leaf check-in: 62257eb5 user: dan tags: onepass-update
19:03
Fix a problem with single-pass multi-row UPDATE statements that invoke REPLACE conflict handling. check-in: 0a2b8e1b user: dan tags: onepass-update
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/update.c.

639
640
641
642
643
644
645




646
647
648
649
650
651
652
    */
    assert( regNew==regNewRowid+1 );
#ifdef SQLITE_ENABLE_PREUPDATE_HOOK
    sqlite3VdbeAddOp3(v, OP_Delete, iDataCur,
        OPFLAG_ISUPDATE | ((hasFK || chngKey) ? 0 : OPFLAG_ISNOOP),
        regNewRowid
    );




    if( !pParse->nested ){
      sqlite3VdbeAppendP4(v, pTab, P4_TABLE);
    }
#else
    if( hasFK || chngKey ){
      sqlite3VdbeAddOp2(v, OP_Delete, iDataCur, 0);
    }







>
>
>
>







639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
    */
    assert( regNew==regNewRowid+1 );
#ifdef SQLITE_ENABLE_PREUPDATE_HOOK
    sqlite3VdbeAddOp3(v, OP_Delete, iDataCur,
        OPFLAG_ISUPDATE | ((hasFK || chngKey) ? 0 : OPFLAG_ISNOOP),
        regNewRowid
    );
    if( eOnePass==ONEPASS_MULTI ){
      assert( hasFK==0 && chngKey==0 );
      sqlite3VdbeChangeP5(v, OPFLAG_SAVEPOSITION);
    }
    if( !pParse->nested ){
      sqlite3VdbeAppendP4(v, pTab, P4_TABLE);
    }
#else
    if( hasFK || chngKey ){
      sqlite3VdbeAddOp2(v, OP_Delete, iDataCur, 0);
    }