diff options
author | drh <drh@noemail.net> | 2018-04-13 16:29:50 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2018-04-13 16:29:50 +0000 |
commit | 12e40cebb70297099806a50de652c71d3182a801 (patch) | |
tree | 8cdd06da4b2000a14b2f57bca20f6a208979cfec /src | |
parent | c8a0c90b62bb4dc1782b079d9e7d315f49d8bd9a (diff) | |
parent | 54f2cd905b2d81e5bbce99d106f95c343b12579b (diff) | |
download | sqlite-12e40cebb70297099806a50de652c71d3182a801.tar.gz sqlite-12e40cebb70297099806a50de652c71d3182a801.zip |
Merge the preupdate hook change from trunk.
FossilOrigin-Name: 7353caabb31803ccff83fe188c4ee65e75c883de2beea79cbe17375a4a98d9ac
Diffstat (limited to 'src')
-rw-r--r-- | src/insert.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/insert.c b/src/insert.c index df2f3f6ea..fb4f442e9 100644 --- a/src/insert.c +++ b/src/insert.c @@ -1468,14 +1468,13 @@ void sqlite3GenerateConstraintChecks( regNewData, 1, 0, OE_Replace, 1, -1); }else{ #ifdef SQLITE_ENABLE_PREUPDATE_HOOK - if( HasRowid(pTab) ){ - /* This OP_Delete opcode fires the pre-update-hook only. It does - ** not modify the b-tree. It is more efficient to let the coming - ** OP_Insert replace the existing entry than it is to delete the - ** existing entry and then insert a new one. */ - sqlite3VdbeAddOp2(v, OP_Delete, iDataCur, OPFLAG_ISNOOP); - sqlite3VdbeAppendP4(v, pTab, P4_TABLE); - } + assert( HasRowid(pTab) ); + /* This OP_Delete opcode fires the pre-update-hook only. It does + ** not modify the b-tree. It is more efficient to let the coming + ** OP_Insert replace the existing entry than it is to delete the + ** existing entry and then insert a new one. */ + sqlite3VdbeAddOp2(v, OP_Delete, iDataCur, OPFLAG_ISNOOP); + sqlite3VdbeAppendP4(v, pTab, P4_TABLE); #endif /* SQLITE_ENABLE_PREUPDATE_HOOK */ if( pTab->pIndex ){ sqlite3MultiWrite(pParse); |