]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Merge all the latest enhancements from trunk.
authordrh <drh@noemail.net>
Fri, 30 Oct 2015 16:50:00 +0000 (16:50 +0000)
committerdrh <drh@noemail.net>
Fri, 30 Oct 2015 16:50:00 +0000 (16:50 +0000)
FossilOrigin-Name: 395a153ff7b3c7a72f3d02b6fe76d72383f4e480

17 files changed:
1  2 
Makefile.in
Makefile.msc
main.mk
manifest
manifest.uuid
src/delete.c
src/insert.c
src/main.c
src/sqlite.h.in
src/sqliteInt.h
src/test_config.c
src/update.c
src/vdbe.c
src/vdbe.h
src/vdbeInt.h
src/vdbeaux.c
src/vdbemem.c

diff --cc Makefile.in
Simple merge
diff --cc Makefile.msc
index 883fb967f0c2230915d35203e071109025dcda57,408073c6511637e2f89eddabc7041d5608b46b8c..33e7aa17915a11aceada7dbb8a4d7fc925b2b520
@@@ -1832,15 -1814,11 +1842,15 @@@ showjournal.exe:     $(TOP)\tool\showjourna
  
  showwal.exe:  $(TOP)\tool\showwal.c $(SQLITE3C)
        $(LTLINK) $(NO_WARN) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -Fe$@ \
-               $(TOP)\tool\showwal.c $(SQLITE3C)
+               $(TOP)\tool\showwal.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
  
 +changeset.exe:        $(TOP)\ext\session\changeset.c $(SQLITE3C)
 +      $(LTLINK) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -Fe$@ \
 +              $(TOP)\ext\session\changeset.c $(SQLITE3C)
 +
  fts3view.exe: $(TOP)\ext\fts3\tool\fts3view.c $(SQLITE3C)
        $(LTLINK) $(NO_WARN) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -Fe$@ \
-               $(TOP)\ext\fts3\tool\fts3view.c $(SQLITE3C)
+               $(TOP)\ext\fts3\tool\fts3view.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
  
  rollback-test.exe:    $(TOP)\tool\rollback-test.c $(SQLITE3C)
        $(LTLINK) $(NO_WARN) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -Fe$@ \
diff --cc main.mk
Simple merge
diff --cc manifest
index b9aa29466885f726572bc5127871485c3c2e89af,f83dc922cc6b083201c97749d405003a0d68b0d0..2e418262ca0aa8e5651b0988549d5dd85f2e92ef
+++ b/manifest
@@@ -1,14 -1,11 +1,11 @@@
- C Merge\sthe\sversion\s3.9.1\supdates.
- D 2015-10-16T20:20:08.651
- F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
- F Makefile.in de2700ab4ca481c15970405274ccf3c872026e3c
- F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
- F Makefile.msc 9025b539b5dc491ea9c6c9c04109d2ff617bc990
- F Makefile.vxworks e1b65dea203f054e71653415bd8f96dcaed47858
 -C Increase\sthe\sversion\snumber\sto\s3.10.0,\sdue\sto\sthe\saddition\sof\sthe\nsqlite3_db_cacheflush()\sinterface.
 -D 2015-10-30T16:36:42.626
 -F Makefile.in 4469ed8b02a9934fea9503d791165367d19db2f7
++C Merge\sall\sthe\slatest\senhancements\sfrom\strunk.
++D 2015-10-30T16:50:00.513
++F Makefile.in 3229179cfbc7d1378aba248dcbdf5213fff6214a
+ F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434
 -F Makefile.msc 702d3e98f3afc6587a78481257f3c4c900efc3a4
++F Makefile.msc 2ed14817d36a6c26cb146e53b9c8a7318ba5bdd4
  F README.md 8ecc12493ff9f820cdea6520a9016001cb2e59b7
- F VERSION a47917b59f38b632b3a8662d14fd20f94956bdd0
+ F VERSION 8b9d3ac6f1962f94e06ba05462422a544f9c4e36
  F aclocal.m4 a5c22d164aff7ed549d53a90fa56d56955281f50
- F addopcodes.awk 9eb448a552d5c0185cf62c463f9c173cedae3811
  F art/sqlite370.eps aa97a671332b432a54e1d74ff5e8775be34200c2
  F art/sqlite370.ico af56c1d00fee7cd4753e8631ed60703ed0fc6e90
  F art/sqlite370.jpg d512473dae7e378a67e28ff96a34da7cb331def2
@@@ -284,9 -263,7 +283,7 @@@ F ext/userauth/userauth.c 5fa3bdb492f48
  F install-sh 9d4de14ab9fb0facae2f48780b874848cbf2f895 x
  F ltmain.sh 3ff0879076df340d2e23ae905484d8c15d5fdea8
  F magic.txt 8273bf49ba3b0c8559cb2774495390c31fd61c60
- F main.mk a43e99059b03953281f629ac8b27ba600cdd4429
- F mkopcodec.awk c2ff431854d702cdd2d779c9c0d1f58fa16fa4ea
- F mkopcodeh.awk 0e7f04a8eb90f92259e47d80110e4e98d7ce337a
 -F main.mk 47b879ad92fe896895dcfc1bbec5c119ee2aa690
++F main.mk ace127ebc8f73fbe37ecf9021385f9efdc4d595d
  F mkso.sh fd21c06b063bb16a5d25deea1752c2da6ac3ed83
  F mptest/config01.test 3c6adcbc50b991866855f1977ff172eb6d901271
  F mptest/config02.test 4415dfe36c48785f751e16e32c20b077c28ae504
@@@ -314,8 -291,8 +311,8 @@@ F src/complete.c addcd8160b081131005d5b
  F src/ctime.c 509ef9c64d1321f42448f111da86400b1799218a
  F src/date.c fb1c99172017dcc8e237339132c91a21a0788584
  F src/dbstat.c e637e7a7ff40ef32132a418c6fdf1cfb63aa27c7
- F src/delete.c 4545c9f793f27d14a32195f6a0b121913a80f692
- F src/expr.c b89dfbb8a385a45411c487355597c01f4ea4c882
 -F src/delete.c c4c6fb9da78b946fcba2a6aac5b24bc5c15e752a
++F src/delete.c 9dddc4434aace0f42f1ed1c5224cdcfc2328ed67
+ F src/expr.c 0080c0f12806eca91e75a23a121a68918e9da357
  F src/fault.c 160a0c015b6c2629d3899ed2daf63d75754a32bb
  F src/fkey.c 31900763094a3736a5fc887469202eb579fef2d0
  F src/func.c ecdd69ec6a1e406f04cc73324be2ebbf6354197f
@@@ -323,18 -300,18 +320,18 @@@ F src/global.c 508e4087f7b41d688e4762dc
  F src/hash.c 4263fbc955f26c2e8cdc0cf214bc42435aa4e4f5
  F src/hash.h c8f3c31722cf3277d03713909761e152a5b81094
  F src/hwtime.h d32741c8f4df852c7d959236615444e2b1063b08
- F src/insert.c 5f9bbe7f68ce13a423edeb93014e8807c0cea729
 -F src/insert.c 419a947f27ce2da18eebf440a5aa80cc825defae
++F src/insert.c 0dbbde4b667b6e47a45ea98958516e2f30a9f9c4
  F src/journal.c b4124532212b6952f42eb2c12fa3c25701d8ba8d
  F src/legacy.c ba1863ea58c4c840335a84ec276fc2b25e22bc4e
  F src/lempar.c d344a95d60c24e2f490ee59db9784b1b17439012
- F src/loadext.c c5916a158f1fb74d955847c84f7ebdb6f5de9d8c
- F src/main.c 3679a4f40434358fdfdfc86bf9576604b8d6fc9b
- F src/malloc.c 3a37ce6979a40f499d8cea9e9ab4e8517854d35d
+ F src/loadext.c 18586e45a215325f15096821e9c082035d4fb810
 -F src/main.c f393acc6e5d604cbe0054376d62f668a5560b3f1
++F src/main.c cae25642d7f49cd94d833c49726eeb28381349f0
+ F src/malloc.c 337bbe9c7d436ef9b7d06b5dd10bbfc8f3025972
  F src/mem0.c 6a55ebe57c46ca1a7d98da93aaa07f99f1059645
- F src/mem1.c abe6ee469b6c5a35c7f22bfeb9c9bac664a1c987
+ F src/mem1.c 6919bcf12f221868ea066eec27e579fed95ce98b
  F src/mem2.c f1940d9e91948dd6a908fbb9ce3835c36b5d83c3
- F src/mem3.c 61c9d47b792908c532ca3a62b999cf21795c6534
- F src/mem5.c 61eeb90134f9a5be6c2e68d8daae7628b25953fb
+ F src/mem3.c 8768ac94694f31ffaf8b4d0ea5dc08af7010a35a
+ F src/mem5.c c1ab1153bd6443bdf6f71e4213c6fb31221b9eb7
  F src/memjournal.c 3eb2c0b51adbd869cb6a44780323f05fa904dc85
  F src/msvc.h d9ba56c6851227ab44b3f228a35f3f5772296495
  F src/mutex.c 8e45800ee78e0cd1f1f3fe8e398853307f4a085c
@@@ -363,19 -340,19 +360,19 @@@ F src/printf.c 0c4bcdd1c2e2521024f0a69c
  F src/random.c ba2679f80ec82c4190062d756f22d0c358180696
  F src/resolve.c 1954a0f01bf65d78d7d559aea3d5c67f33376d91
  F src/rowset.c eccf6af6d620aaa4579bd3b72c1b6395d9e9fa1e
- F src/select.c 0bc9cd2e1cacfdc9cdc9a83884cc100f166e80a4
+ F src/select.c 167b4e9058bc8e997d18d6b6b20ecbb0c9c457af
 -F src/shell.c d25df04168d6ba5a4fa05bdbf859df667f9eb621
 -F src/sqlite.h.in 3cfc86c55e57c63d86b9e1e92869e2bfb162ca8e
 +F src/shell.c 993863f82d764be0c00803056e56b9b744f86f02
- F src/sqlite.h.in ef10b6cba73e0a9848259b856480dd56e7f593a3
++F src/sqlite.h.in 45821b35edf55ac410c16a3e1de4d6d43aa7ee16
  F src/sqlite3.rc 992c9f5fb8285ae285d6be28240a7e8d3a7f2bad
  F src/sqlite3ext.h 4b66e3e3435da4b4c8c83696d0349f0c503b3924
- F src/sqliteInt.h 4150e72a668204fbcbdfbcc5f44c9aa5151663f8
 -F src/sqliteInt.h b1e72ffe282c91ae30a2bf403319126dbaebd556
++F src/sqliteInt.h b2e72eaa886665d042908a736d98fadacab95ef6
  F src/sqliteLimit.h 216557999cb45f2e3578ed53ebefe228d779cb46
- F src/status.c f266ad8a2892d659b74f0f50cb6a88b6e7c12179
+ F src/status.c 70912d7be68e9e2dbc4010c93d344af61d4c59ba
  F src/table.c 51b46b2a62d1b3a959633d593b89bab5e2c9155e
 -F src/tclsqlite.c d9439b6a910985b7fff43ba6756bcef00de22649
 +F src/tclsqlite.c e2344bee0d192397f555a24ef3fab26f2ed93bcc
- F src/test1.c 8fff9c5aa63d6490f516d018b70c12a9cb9a4d8a
+ F src/test1.c 9ac5cbfe3c859ab7518edc5109a2959d6bf7b059
  F src/test2.c 577961fe48961b2f2e5c8b56ee50c3f459d3359d
- F src/test3.c 64d2afdd68feac1bb5e2ffb8226c8c639f798622
+ F src/test3.c f7ae1d6a4aa07aac257de18a43800c1199b513fc
  F src/test4.c d168f83cc78d02e8d35567bb5630e40dcd85ac1e
  F src/test5.c 5a34feec76d9b3a86aab30fd4f6cc9c48cbab4c1
  F src/test6.c 41cacf3b0dd180823919bf9e1fbab287c9266723
@@@ -387,7 -364,7 +384,7 @@@ F src/test_autoext.c dea8a01a7153b9adc9
  F src/test_backup.c 2e6e6a081870150f20c526a2e9d0d29cda47d803
  F src/test_blob.c e5a7a81d61a780da79101aeb1e60d300af169e07
  F src/test_btree.c 2e9978eca99a9a4bfa8cae949efb00886860a64f
- F src/test_config.c 6d95fdff9fa8668db56a8b8ac78c7fa1d1ffd483
 -F src/test_config.c 426527fbb12fc23669a1e973ecdc8c5e92c2e2cf
++F src/test_config.c e1fc48719655d83ea23513f3c3da32b4c4205899
  F src/test_demovfs.c 0de72c2c89551629f58486fde5734b7d90758852
  F src/test_devsym.c e7498904e72ba7491d142d5c83b476c4e76993bc
  F src/test_fs.c ced436e3d4b8e4681328409b8081051ce614e28f
@@@ -419,21 -396,21 +416,21 @@@ F src/test_vfs.c 3b65d42e18b262805716bd
  F src/test_vfstrace.c bab9594adc976cbe696ff3970728830b4c5ed698
  F src/test_wsd.c 41cadfd9d97fe8e3e4e44f61a4a8ccd6f7ca8fe9
  F src/threads.c bbfb74450643cb5372a43ad4f6cffd7e9dfcecb0
- F src/tokenize.c 83c6ed569423a3af83a83973b444cf7123be33a6
+ F src/tokenize.c 338bc8f7c9dd103188952cda7964696bacac6d22
  F src/treeview.c 154f0acc622fa3514de8777dcedf4c8a8802b4ce
  F src/trigger.c 322f23aad694e8f31d384dcfa386d52a48d3c52f
- F src/update.c 19b4edc4f0334db61a9fc1c73f01225df0634b31
 -F src/update.c 40e51cd0883cb5bfd6abb7d8a7cd8aa47fab2945
++F src/update.c c2fff3b60bfcabcb0372acbe8cf6f77c2bb515bc
  F src/utf.c fc6b889ba0779b7722634cdeaa25f1930d93820c
  F src/util.c fc612367108b74573c5fd13a85d0a23027f438bd
  F src/vacuum.c 2ddd5cad2a7b9cef7f9e431b8c7771634c6b1701
- F src/vdbe.c fd0fba1ba0d117a65f16252d38083fa17eb9c44a
- F src/vdbe.h 67151895e779b35475c6c11b16be2ceb839066c8
- F src/vdbeInt.h 42fa34502937071aabd3c0596575ba9776547353
 -F src/vdbe.c dfbaae2570172c523bce14299021d352b8508f7f
 -F src/vdbe.h efb7a8c1459e31f3ea4377824c6a7e4cb5068637
 -F src/vdbeInt.h 33403622c6a8feaaac5f0f3f17f5d1bf6df42286
 -F src/vdbeapi.c 020681b943e77766b32ae1cddf86d7831b7374ca
 -F src/vdbeaux.c 717bc2ae9cc0b58ef398fff44bd9164bfd96772a
 -F src/vdbeblob.c 565fabd302f5fca3bdf3d56cac330483616a39b6
 -F src/vdbemem.c fdd1578e47bea61390d472de53c565781d81e045
++F src/vdbe.c 755ebcef6b85f4917b567401752aa39523cd06e5
++F src/vdbe.h bfe3f80dba435377cdb64fd917f2529f0f48ab77
++F src/vdbeInt.h d6ae6e64ad16e213f37306b1735ff72fb98bec69
 +F src/vdbeapi.c f5eda36a5c85ef578957ab4311e8d9b1f51a3552
- F src/vdbeaux.c 4cbd4cc79dad0e2c2b9996ae018d79a7330110f4
++F src/vdbeaux.c 3c67cbdee0308a0e0a942e5edea95339e021ea5c
 +F src/vdbeblob.c b400c25ac822af3c507ef84b5cd93c1583a70321
- F src/vdbemem.c 28ab8455ac490373798cf2c21def2c1287942551
- F src/vdbesort.c f5009e7a35e3065635d8918b9a31f498a499976b
++F src/vdbemem.c 25b6cfd665b5073480452426e84136edd94140c0
+ F src/vdbesort.c 8b23930a1289526f6d2a3a9f2e965bcc963e4a68
  F src/vdbetrace.c 8befe829faff6d9e6f6e4dee5a7d3f85cc85f1a0
  F src/vtab.c 2a8b44aa372c33f6154208e7a7f6c44254549806
  F src/vxworks.h c18586c8edc1bddbc15c004fa16aeb1e1342b4fb
@@@ -1403,15 -1389,15 +1410,15 @@@ F tool/split-sqlite3c.tcl d9be87f1c3402
  F tool/sqldiff.c b318efc2eaf7a7fac4d281a0ce736193cb2506df
  F tool/stack_usage.tcl f8e71b92cdb099a147dad572375595eae55eca43
  F tool/symbols-mingw.sh 4dbcea7e74768305384c9fd2ed2b41bbf9f0414d
 -F tool/symbols.sh fec58532668296d7c7dc48be9c87f75ccdb5814f
 +F tool/symbols.sh c5a617b8c61a0926747a56c65f5671ef8ac0e148
- F tool/tostr.awk 11760e1b94a5d3dcd42378f3cc18544c06cfa576
+ F tool/tostr.tcl 96022f35ada2194f6f8ccf6fd95809e90ed277c4
  F tool/varint.c 5d94cb5003db9dbbcbcc5df08d66f16071aee003
  F tool/vdbe-compress.tcl 5926c71f9c12d2ab73ef35c29376e756eb68361c
- F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1
+ F tool/vdbe_profile.tcl 246d0da094856d72d2c12efec03250d71639d19f
  F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4
  F tool/warnings.sh 48bd54594752d5be3337f12c72f28d2080cb630b
  F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
- P e1afdbb50120f7d058b25538c6cb8ce3bb34993d 767c1727fec4ce11b83f25b3f1bfcfe68a2c8b02
- R 416ec582b2ccbe834a5229a0e696d766
 -P ad80d3073388c59f67171720efc6ef766e19886f
 -R 05540c814207efb67f7c8e8b3a47d3f0
++P 2bbb9595ccc4fdd854bf16a1efcddbc42a7ff14e 7565b046ff939e8310631397a4526fbd98b99aaf
++R 01665c5c372c0e12761e9c423a71cfd1
  U drh
- Z 46e0986ebe5f9df0f173f75bf0f33062
 -Z 14542ee53e71e033be97bac3859f7dcc
++Z b4b0651f582925800ad2e9fdf5ebff65
diff --cc manifest.uuid
index 4ceef889fab44863899ec8b924f2d65ab20ab5eb,3e10f9d11a3236208ed41f7972b2331bf8ae3949..a404e6af25149237d63ac8fb8adf9c870605f701
@@@ -1,1 -1,1 +1,1 @@@
- 2bbb9595ccc4fdd854bf16a1efcddbc42a7ff14e
 -7565b046ff939e8310631397a4526fbd98b99aaf
++395a153ff7b3c7a72f3d02b6fe76d72383f4e480
diff --cc src/delete.c
Simple merge
diff --cc src/insert.c
Simple merge
diff --cc src/main.c
Simple merge
diff --cc src/sqlite.h.in
index a5d4e94871774677b62556f772584a75cd4c4c7d,961c5169fc7167500446867b07dcc481ce07c831..ff5cf27ec18d6eb3d5601afb10c50bc0dcccf9e4
@@@ -7790,102 -7792,36 +7792,131 @@@ int sqlite3_stmt_scanstatus
  */
  void sqlite3_stmt_scanstatus_reset(sqlite3_stmt*);
  
+ /*
+ ** CAPI3REF: Flush caches to disk mid-transaction
+ **
+ ** If a write-transaction is open when this function is called, any dirty
+ ** pages in the pager-cache that are not currently in use are written out 
+ ** to disk. A dirty page may be in use if a database cursor created by an
+ ** active SQL statement is reading from it, or if it is page 1 of a database
+ ** file (page 1 is always "in use"). Dirty pages are flushed for all
+ ** databases - "main", "temp" and any attached databases.
+ **
+ ** If this function needs to obtain extra database locks before dirty pages 
+ ** can be flushed to disk, it does so. If said locks cannot be obtained 
+ ** immediately and there is a busy-handler callback configured, it is invoked
+ ** in the usual manner. If the required lock still cannot be obtained, then
+ ** the database is skipped and an attempt made to flush any dirty pages
+ ** belonging to the next (if any) database. If any databases are skipped
+ ** because locks cannot be obtained, but no other error occurs, this
+ ** function returns SQLITE_BUSY.
+ **
+ ** If any other error occurs while flushing dirty pages to disk (for
+ ** example an IO error or out-of-memory condition), then processing is
+ ** abandoned and an SQLite error code returned to the caller immediately.
+ **
+ ** Otherwise, if no error occurs, SQLITE_OK is returned.
+ **
+ ** This function does not set the database handle error code or message
+ ** returned by the sqlite3_errcode() and sqlite3_errmsg() functions.
+ */
+ int sqlite3_db_cacheflush(sqlite3*);
  
 +/*
 +** CAPI3REF: The pre-update hook.
 +** EXPERIMENTAL
 +**
 +** ^These interfaces are only available if SQLite is compiled using the
 +** [SQLITE_ENABLE_UPDATE_HOOK] compile-time option.
 +**
 +** ^The [sqlite3_preupdate_hook()] interface registers a callback function
 +** that is invoked prior to each [INSERT], [UPDATE], and [DELETE] operation.
 +** ^At most one preupdate hook may be registered at a time on a single
 +** [database connection]; each call to [sqlite3_preupdate_hook()] overrides
 +** the previous setting.
 +** ^The preupdate hook is disabled by invoking [sqlite3_preupdate_hook()]
 +** with a NULL pointer as the second parameter.
 +** ^The third parameter to [sqlite3_preupdate_hook()] is passed through as
 +** the first parameter to callbacks.
 +**
 +** ^The preupdate hook only fires for changes to real tables; the preupdate
 +** hook is not invoked for changes to virtual tables.
 +**
 +** ^The second parameter to the preupdate callback is a pointer to
 +** the [database connection] that registered the preupdate hook.
 +** ^The third parameter to the preupdate callback is one of the constants
 +** [SQLITE_INSERT], [SQLITE_DELETE], or [SQLITE_UPDATE] to indentify the
 +** kind of update operation that is about to occur.
 +** ^(The fourth parameter to the preupdate callback is the name of the
 +** database within the database connection that is being modified.  This
 +** will be "main" for the main database or "temp" for TEMP tables or 
 +** the name given after the AS keyword in the [ATTACH] statement for attached
 +** databases.)^
 +** ^The fifth parameter to the preupdate callback is the name of the
 +** table that is being modified.
 +** ^The sixth parameter to the preupdate callback is the initial [rowid] of the
 +** row being changes for SQLITE_UPDATE and SQLITE_DELETE changes and is
 +** undefined for SQLITE_INSERT changes.
 +** ^The seventh parameter to the preupdate callback is the final [rowid] of
 +** the row being changed for SQLITE_UPDATE and SQLITE_INSERT changes and is
 +** undefined for SQLITE_DELETE changes.
 +**
 +** The [sqlite3_preupdate_old()], [sqlite3_preupdate_new()],
 +** [sqlite3_preupdate_count()], and [sqlite3_preupdate_depth()] interfaces
 +** provide additional information about a preupdate event. These routines
 +** may only be called from within a preupdate callback.  Invoking any of
 +** these routines from outside of a preupdate callback or with a
 +** [database connection] pointer that is different from the one supplied
 +** to the preupdate callback results in undefined and probably undesirable
 +** behavior.
 +**
 +** ^The [sqlite3_preupdate_count(D)] interface returns the number of columns
 +** in the row that is being inserted, updated, or deleted.
 +**
 +** ^The [sqlite3_preupdate_old(D,N,P)] interface writes into P a pointer to
 +** a [protected sqlite3_value] that contains the value of the Nth column of
 +** the table row before it is updated.  The N parameter must be between 0
 +** and one less than the number of columns or the behavior will be
 +** undefined. This must only be used within SQLITE_UPDATE and SQLITE_DELETE
 +** preupdate callbacks; if it is used by an SQLITE_INSERT callback then the
 +** behavior is undefined.  The [sqlite3_value] that P points to
 +** will be destroyed when the preupdate callback returns.
 +**
 +** ^The [sqlite3_preupdate_new(D,N,P)] interface writes into P a pointer to
 +** a [protected sqlite3_value] that contains the value of the Nth column of
 +** the table row after it is updated.  The N parameter must be between 0
 +** and one less than the number of columns or the behavior will be
 +** undefined. This must only be used within SQLITE_INSERT and SQLITE_UPDATE
 +** preupdate callbacks; if it is used by an SQLITE_DELETE callback then the
 +** behavior is undefined.  The [sqlite3_value] that P points to
 +** will be destroyed when the preupdate callback returns.
 +**
 +** ^The [sqlite3_preupdate_depth(D)] interface returns 0 if the preupdate
 +** callback was invoked as a result of a direct insert, update, or delete
 +** operation; or 1 for inserts, updates, or deletes invoked by top-level 
 +** triggers; or 2 for changes resulting from triggers called by top-level
 +** triggers; and so forth.
 +**
 +** See also:  [sqlite3_update_hook()]
 +*/
 +SQLITE_EXPERIMENTAL void *sqlite3_preupdate_hook(
 +  sqlite3 *db,
 +  void(*xPreUpdate)(
 +    void *pCtx,                   /* Copy of third arg to preupdate_hook() */
 +    sqlite3 *db,                  /* Database handle */
 +    int op,                       /* SQLITE_UPDATE, DELETE or INSERT */
 +    char const *zDb,              /* Database name */
 +    char const *zName,            /* Table name */
 +    sqlite3_int64 iKey1,          /* Rowid of row about to be deleted/updated */
 +    sqlite3_int64 iKey2           /* New rowid value (for a rowid UPDATE) */
 +  ),
 +  void*
 +);
 +SQLITE_EXPERIMENTAL int sqlite3_preupdate_old(sqlite3 *, int, sqlite3_value **);
 +SQLITE_EXPERIMENTAL int sqlite3_preupdate_count(sqlite3 *);
 +SQLITE_EXPERIMENTAL int sqlite3_preupdate_depth(sqlite3 *);
 +SQLITE_EXPERIMENTAL int sqlite3_preupdate_new(sqlite3 *, int, sqlite3_value **);
 +
  /*
  ** Undo the hack that converts floating point types to integer for
  ** builds on processors without floating point support.
diff --cc src/sqliteInt.h
Simple merge
Simple merge
diff --cc src/update.c
Simple merge
diff --cc src/vdbe.c
Simple merge
diff --cc src/vdbe.h
index 0c9350d423b4b0324b852cfbeed5764645f335f1,68a4f6b2a89217a973d60cff81c5091e3d7d85a0..55c4f82cf152ce6a3117fb6d7f36560fb780d10b
@@@ -60,7 -60,9 +60,10 @@@ struct VdbeOp 
      KeyInfo *pKeyInfo;     /* Used when p4type is P4_KEYINFO */
      int *ai;               /* Used when p4type is P4_INTARRAY */
      SubProgram *pProgram;  /* Used when p4type is P4_SUBPROGRAM */
 +    Table *pTab;           /* Used when p4type is P4_TABLE */
+ #ifdef SQLITE_ENABLE_CURSOR_HINTS
+     Expr *pExpr;           /* Used when p4type is P4_EXPR */
+ #endif
      int (*xAdvance)(BtCursor *, int *);
    } p4;
  #ifdef SQLITE_ENABLE_EXPLAIN_COMMENTS
diff --cc src/vdbeInt.h
Simple merge
diff --cc src/vdbeaux.c
Simple merge
diff --cc src/vdbemem.c
Simple merge