/ Check-in [0ab45188]
Login

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

Overview
Comment:Remove an always-true branch from the preupdate hook logic.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 0ab4518811b23bdb57feba55014cef07de66028f8fcbf8cf0831a712b2954b91
User & Date: drh 2018-04-13 16:23:22
Context
2018-04-16
10:34
Reduce the size of the NameContext object by grouping seldom-used fields into a union. check-in: dba3095f user: drh tags: trunk
2018-04-14
18:46
Experimental change to "SELECT * FROM ... ORDER BY" processing to load some column values from the db after sorting. check-in: 9719cb46 user: dan tags: sorter-reference
2018-04-13
16:29
Merge the preupdate hook change from trunk. check-in: 7353caab user: drh tags: upsert
16:23
Remove an always-true branch from the preupdate hook logic. check-in: 0ab45188 user: drh tags: trunk
2018-04-11
17:10
Help the parser run faster by avoiding the "explain ::= ." production. check-in: d7ec7b59 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/insert.c.

  1446   1446           }
  1447   1447           if( pTrigger || sqlite3FkRequired(pParse, pTab, 0, 0) ){
  1448   1448             sqlite3MultiWrite(pParse);
  1449   1449             sqlite3GenerateRowDelete(pParse, pTab, pTrigger, iDataCur, iIdxCur,
  1450   1450                                      regNewData, 1, 0, OE_Replace, 1, -1);
  1451   1451           }else{
  1452   1452   #ifdef SQLITE_ENABLE_PREUPDATE_HOOK
  1453         -          if( HasRowid(pTab) ){
  1454         -            /* This OP_Delete opcode fires the pre-update-hook only. It does
  1455         -            ** not modify the b-tree. It is more efficient to let the coming
  1456         -            ** OP_Insert replace the existing entry than it is to delete the
  1457         -            ** existing entry and then insert a new one. */
  1458         -            sqlite3VdbeAddOp2(v, OP_Delete, iDataCur, OPFLAG_ISNOOP);
  1459         -            sqlite3VdbeAppendP4(v, pTab, P4_TABLE);
  1460         -          }
         1453  +          assert( HasRowid(pTab) );
         1454  +          /* This OP_Delete opcode fires the pre-update-hook only. It does
         1455  +          ** not modify the b-tree. It is more efficient to let the coming
         1456  +          ** OP_Insert replace the existing entry than it is to delete the
         1457  +          ** existing entry and then insert a new one. */
         1458  +          sqlite3VdbeAddOp2(v, OP_Delete, iDataCur, OPFLAG_ISNOOP);
         1459  +          sqlite3VdbeAppendP4(v, pTab, P4_TABLE);
  1461   1460   #endif /* SQLITE_ENABLE_PREUPDATE_HOOK */
  1462   1461             if( pTab->pIndex ){
  1463   1462               sqlite3MultiWrite(pParse);
  1464   1463               sqlite3GenerateRowIndexDelete(pParse, pTab, iDataCur, iIdxCur,0,-1);
  1465   1464             }
  1466   1465           }
  1467   1466           seenReplace = 1;