From: drh Date: Mon, 21 Mar 2016 15:32:19 +0000 (+0000) Subject: Merge 3.12.0 beta changes from trunk. X-Git-Tag: version-3.13.0~148^2~3 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=dbf8a16cb3e18b4da9cf2345cd160c98c85afd77;p=thirdparty%2Fsqlite.git Merge 3.12.0 beta changes from trunk. FossilOrigin-Name: 3296a0ceedef43c2790f0b36471f91138a575243 --- dbf8a16cb3e18b4da9cf2345cd160c98c85afd77 diff --cc manifest index c10bdd869b,6c35067176..561e39edc2 --- a/manifest +++ b/manifest @@@ -1,8 -1,8 +1,8 @@@ - C Merge\sall\srecent\senhancements\sfrom\strunk. - D 2016-03-16T01:16:30.929 -C Add\sthe\ssqlite3_system_errno()\sinterface. -D 2016-03-21T14:46:37.265 -F Makefile.in f53429fb2f313c099283659d0df6f20f932c861f ++C Merge\s3.12.0\sbeta\schanges\sfrom\strunk. ++D 2016-03-21T15:32:19.793 +F Makefile.in e812bb732d7af01baa09f1278bd4f4a2e3a09449 F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434 -F Makefile.msc df0bf9ff7f8b3f4dd9fb4cc43f92fe58f6ec5c66 +F Makefile.msc e6ee58b849c116d5554024f524cbf61f064f6f01 F README.md 8ecc12493ff9f820cdea6520a9016001cb2e59b7 F VERSION c6b1f51809551d60ad001e6d87cf3ab2c7f54b6f F aclocal.m4 a5c22d164aff7ed549d53a90fa56d56955281f50 @@@ -323,19 -304,19 +324,19 @@@ F src/complete.c a3634ab1e687055cd002e1 F src/ctime.c 60e135af364d777a9ab41c97e5e89cd224da6198 F src/date.c 0b73e681c11fca867fec554750c07fe0d4e417c1 F src/dbstat.c c845548d4346e606e2f2b7d2e714ace2b8a7dd1b -F src/delete.c 48802aa3ee6339f576d074336d3ae1b5f40e240f +F src/delete.c eeac28b3d3d88e3541bdf93e91ea7492a7b67842 - F src/expr.c c329d581e5d631153456369684d7d4bcd94c907d + F src/expr.c 289ffac5240b60fee0a824d3d5ab2d7bd2630c94 F src/fault.c 160a0c015b6c2629d3899ed2daf63d75754a32bb -F src/fkey.c 5cb42d9a59e2a590776fd3fc8ff6f61d40df3c6e +F src/fkey.c 5da47ff524e2f687997a74737ce598f043e1342a F src/func.c 552d300265aed09eea21f68ac742a440550c0062 F src/global.c 884d4c7eba9f5fc25c96a23b21520da19b7713e2 F src/hash.c 4263fbc955f26c2e8cdc0cf214bc42435aa4e4f5 F src/hash.h c8f3c31722cf3277d03713909761e152a5b81094 F src/hwtime.h d32741c8f4df852c7d959236615444e2b1063b08 -F src/insert.c 723d5d708cdb61bdd47c00b9f07c75be45aefc09 +F src/insert.c 8f4e9fcbd8e95e85f15647ba8b413b18d556ec2b F src/legacy.c 75d3023be8f0d2b99d60f905090341a03358c58e - F src/loadext.c 9e2a41adcaff16ebc1ebff1f336cbf33de55396f - F src/main.c 0a3dc6c0bac5d4abdc74449f895e1599542acfca + F src/loadext.c e70f8f9e97624a232870ea5486e682c813ac3002 -F src/main.c f6c6e61bfd4cc9306a737d0c5c3f1e0eaf6086e0 ++F src/main.c 915aeae74e2526b8fa33f9b99b1ed13eab968ac2 F src/malloc.c 1443d1ad95d67c21d77af7ae3f44678252f0efec F src/mem0.c 6a55ebe57c46ca1a7d98da93aaa07f99f1059645 F src/mem1.c 6919bcf12f221868ea066eec27e579fed95ce98b @@@ -371,16 -352,16 +372,16 @@@ F src/random.c ba2679f80ec82c4190062d75 F src/resolve.c b8f7174e5f8c33c44ded3a25a973d0bb89228c20 F src/rowset.c 9fe4b3ad7cc00944386bb600233d8f523de07a6e F src/select.c 6dd2097bb158efe3b8d68683dcc3b4a49e907a34 -F src/shell.c 5e0ab1e708dc294330ccd8230536e1801f60822e -F src/sqlite.h.in e877f141b15ef68ef28f84714e69d7234f9a071e +F src/shell.c cd3f82fdc5c895b817a375b7ab8319cb41f447ce - F src/sqlite.h.in 86884a006a451c22d342da18d8e373aa70e65ec0 ++F src/sqlite.h.in a1d7a367997f80c7075303aaf73e5fc46261c11c F src/sqlite3.rc 5121c9e10c3964d5755191c80dd1180c122fc3a8 - F src/sqlite3ext.h dfbe62ffd95b99afe2140d8c35b180d11924072d - F src/sqliteInt.h a8838eed1eb20f794ce929597864d070944f15b7 + F src/sqlite3ext.h 98f72cbfe00169c39089115427d06ea05fe4b4a2 -F src/sqliteInt.h 4eb80a9b9a512180a9739f99d754915e03d8091a ++F src/sqliteInt.h f5cebbea5909189efbffd7a659195436f503ebb7 F src/sqliteLimit.h 7b28cf72cbd52f178bfc97ea266445e351f2cd24 F src/status.c 70912d7be68e9e2dbc4010c93d344af61d4c59ba F src/table.c 5226df15ab9179b9ed558d89575ea0ce37b03fc9 -F src/tclsqlite.c 4bf3bea9b03aeac176ac114700f35f76a1de4c8a +F src/tclsqlite.c 56569acc73d36e836b64aefecbbb709a92ba0077 - F src/test1.c 52965bd684ddcd7f22328ebd7d50fd0b6e51f0d4 + F src/test1.c 7187b7e924bfc97780e6fd2a40dad94a32bddca0 F src/test2.c 5586f43fcd9a1be0830793cf9d354082c261b25b F src/test3.c a8887dabbbee3059af338f20d290084a63ed1b0f F src/test4.c d168f83cc78d02e8d35567bb5630e40dcd85ac1e @@@ -395,7 -376,7 +396,7 @@@ F src/test_backup.c 2e6e6a081870150f20c F src/test_bestindex.c 29af3cc3b963ffe5760c85d142b9b3e5302c1e3d F src/test_blob.c b2551a9b5573232db5f66f292307c37067937239 F src/test_btree.c 2e9978eca99a9a4bfa8cae949efb00886860a64f - F src/test_config.c a0e8eeb86a7d9393f3bbf7315932c1cccd0e8010 -F src/test_config.c 0fb2571777ef43a8442be4f9c62a25f530872328 ++F src/test_config.c 7003f6f35134de6f19c6588f44783e43390ea277 F src/test_demovfs.c 0de72c2c89551629f58486fde5734b7d90758852 F src/test_devsym.c e7498904e72ba7491d142d5c83b476c4e76993bc F src/test_fs.c f10f840ca4f8c72e4837908bd8347ac4bcab074b @@@ -432,17 -413,17 +433,17 @@@ F src/threads.c 4ae07fa022a3dc7c5beb373 F src/tokenize.c 3d338cdd00d916ce8a05c397001d64ed58e6fe1c F src/treeview.c e4b41a37530a191579d3c53142cc44ee2eb99373 F src/trigger.c e14840ee0c3e549e758ec9bf3e4146e166002280 -F src/update.c 56b3db7edff0110360a12b76af97c39ebe3ea8b8 +F src/update.c 14c6916d0194a7f25ad429292f4831b8c31e93d9 F src/utf.c 699001c79f28e48e9bcdf8a463da029ea660540c - F src/util.c 34ef7be420f82415ec48131404995ddb6ee7502f + F src/util.c cf7dce85ab9af5280b8a45985df2591efbfefe56 F src/vacuum.c feb1eabb20987983d9350cad98299b21fa811f52 - F src/vdbe.c 8e9452b8bc241ae2031c35764b78ae8b4804effb - F src/vdbe.h 594aef1a7dcfc2944e2f266f148140c3427fd0f0 -F src/vdbe.c f19741f2d8b33e8f09cd2219570b6c9ed924c3f1 -F src/vdbe.h 6f44193e7be52fd5f7c308175a936555b1e6b101 -F src/vdbeInt.h f88d3115e9bde33b01d81f0dd26d8dd51f995991 -F src/vdbeapi.c 95b1f8e527240a18a9aea41a655b013bf07a7009 -F src/vdbeaux.c c8dd3e4e932bede6363b380519d05c0557ad27ce -F src/vdbeblob.c 3b570b730109e8f653d9d2081649f6e7015113db -F src/vdbemem.c fe76c1f866de362d9b8332e59d74aa44f6560d69 ++F src/vdbe.c 399bb1d353da8ce2e52e5182aabca18da0296749 ++F src/vdbe.h c16ba943d407baa1c7085eefea73a063fc631863 +F src/vdbeInt.h 9b704336a69f62ba189eafb06a46171e3463d27b +F src/vdbeapi.c ba85b78fe08dc4a9ce747e62c89a2b4a4547e74c - F src/vdbeaux.c 325dcf1b944e6d339a5c5210b7b8c5724a8496fb ++F src/vdbeaux.c 03b2a622bf7714153bf06f9a6789e94aad9a5f89 +F src/vdbeblob.c c9f2f494b911c6fa34efd9803f0a10807da80f77 - F src/vdbemem.c 0bcc4af472ebd36e57603d733a6501573a82b526 ++F src/vdbemem.c 5cfef60e60e19cab6275d1b975bf4c791d575beb F src/vdbesort.c 307460bfa4de4d1c3901fcd42089159131e34062 F src/vdbetrace.c f75c5455d8cf389ef86a8bfdfd3177e0e3692484 F src/vtab.c fd69fd398e23e57ea4ea377d8a44b6998fc569c7 @@@ -1106,7 -1086,7 +1107,7 @@@ F test/tclsqlite.test e1306001a0ca92250 F test/tempdb.test bd92eba8f20e16a9136e434e20b280794de3cdb6 F test/temptable.test d2c9b87a54147161bcd1822e30c1d1cd891e5b30 F test/temptrigger.test 8ec228b0db5d7ebc4ee9b458fc28cb9e7873f5e1 - F test/tester.tcl ac5f9558e2fbef44facc1639e3738394dc110852 -F test/tester.tcl f2b99e912d4da1e5755969b8614febd883885c8b ++F test/tester.tcl 7b740ee852c55e1e72b6ebe5044acee7aa4e5553 F test/thread001.test 9f22fd3525a307ff42a326b6bc7b0465be1745a5 F test/thread002.test e630504f8a06c00bf8bbe68528774dd96aeb2e58 F test/thread003.test ee4c9efc3b86a6a2767516a37bd64251272560a7 @@@ -1477,7 -1457,8 +1478,7 @@@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a9 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 - P 17fd8f3cf0ec565e08403dc8e10a1cffc2bbe165 45f7f0c80bd91a0c7ff859c27fd9e82e551bd83e - R 7b1ff29ad9cf7b5c8ae4f4645405d6a4 -P d6e2637df16764aa9723a30ea2eb8a631d28cb2b b4a1114f730c62e93623f889bc0e4fd8d0b31efa -R 6870e1f7d1e452978a882de2dd2b0506 -T +closed b4a1114f730c62e93623f889bc0e4fd8d0b31efa ++P 6a7ee04b0ddac36a87d5ed2ac89a53e537f4d5a3 4bd12b57ea177cfb1f44d54bfa7aedfb8a8c0c64 ++R 23117f3fb3eb670baa9fc58a11fb65fe U drh - Z 05e24502adf6b1cda5add372ab8596b8 -Z c933d47fc520e2ff9b51b35972ce646c ++Z 887267d056670df55047d1f847ebaae7 diff --cc manifest.uuid index d4116a6eca,f6b0ceae98..d75bc5442c --- a/manifest.uuid +++ b/manifest.uuid @@@ -1,1 -1,1 +1,1 @@@ - 6a7ee04b0ddac36a87d5ed2ac89a53e537f4d5a3 -4bd12b57ea177cfb1f44d54bfa7aedfb8a8c0c64 ++3296a0ceedef43c2790f0b36471f91138a575243 diff --cc src/sqlite.h.in index cce23aa225,04f4359ecf..c9b80d6567 --- a/src/sqlite.h.in +++ b/src/sqlite.h.in @@@ -7915,101 -7915,18 +7915,113 @@@ void sqlite3_stmt_scanstatus_reset(sqli */ 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 **); + + /* + ** CAPI3REF: Low-level system error code + ** + ** ^Attempt to return the underlying operating system error code or error + ** number that caused the most reason I/O error or failure to open a file. + ** The return value is OS-dependent. For example, on unix systems, after + ** [sqlite3_open_v2()] returns [SQLITE_CANTOPEN], this interface could be + ** called to get back the underlying "errno" that caused the problem, such + ** as ENOSPC, EAUTH, EISDIR, and so forth. + */ + int sqlite3_system_errno(sqlite3*); + /* ** CAPI3REF: Database Snapshot ** KEYWORDS: {snapshot}