/ Check-in [62257eb5]
Login
SQLite training in Houston TX on 2019-11-05 (details)
Part of the 2019 Tcl Conference

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 Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/update.c.

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