sqlite3 db2 test.db2
}
-
-do_execsql_test 1.0 {
- CREATE TABLE t1(a PRIMARY KEY, b) WITHOUT ROWID;
-}
-
-do_iterator_test 1.1 t1 {
- INSERT INTO t1 VALUES('one', 'two');
+foreach {tn wo} {
+ 1 ""
+ 2 "WITHOUT ROWID"
} {
- {INSERT t1 0 X. {} {t one t two}}
-}
+ reset_db
-do_iterator_test 1.2 t1 {
- UPDATE t1 SET b='three'
-} {
- {UPDATE t1 0 X. {t one t two} {{} {} t three}}
+ do_execsql_test 1.$tn.0 "CREATE TABLE t1(a PRIMARY KEY, b) $wo ;"
+
+ do_iterator_test 1.$tn.1 t1 {
+ INSERT INTO t1 VALUES('one', 'two');
+ } {
+ {INSERT t1 0 X. {} {t one t two}}
+ }
+
+ do_iterator_test 1.$tn.2 t1 {
+ UPDATE t1 SET b='three'
+ } {
+ {UPDATE t1 0 X. {t one t two} {{} {} t three}}
+ }
+
+ do_iterator_test 1.$tn.3 t1 {
+ REPLACE INTO t1 VALUES('one', 'four');
+ } {
+ {UPDATE t1 0 X. {t one t three} {{} {} t four}}
+ }
+
+ do_iterator_test 1.$tn.4 t1 {
+ DELETE FROM t1;
+ } {
+ {DELETE t1 0 X. {t one t four} {}}
+ }
}
-do_iterator_test 1.3 t1 {
- DELETE FROM t1;
+foreach {tn wo} {
+ 1 ""
+ 2 "WITHOUT ROWID"
} {
- {DELETE t1 0 X. {t one t three} {}}
+ reset_db
+
+ do_execsql_test 2.$tn.0 "CREATE TABLE t1(a INTEGER PRIMARY KEY, b) $wo ;"
+
+ do_iterator_test 1.1 t1 {
+ INSERT INTO t1 VALUES(1, 'two');
+ } {
+ {INSERT t1 0 X. {} {i 1 t two}}
+ }
+
+ do_iterator_test 2.$tn.2 t1 {
+ UPDATE t1 SET b='three'
+ } {
+ {UPDATE t1 0 X. {i 1 t two} {{} {} t three}}
+ }
+
+ do_iterator_test 2.$tn.3 t1 {
+ REPLACE INTO t1 VALUES(1, 'four');
+ } {
+ {UPDATE t1 0 X. {i 1 t three} {{} {} t four}}
+ }
+
+ do_iterator_test 2.$tn.4 t1 {
+ DELETE FROM t1;
+ } {
+ {DELETE t1 0 X. {i 1 t four} {}}
+ }
}
finish_test
+
-C The\spage\ssize\sbecomes\sfixed\sas\ssoon\sas\spage1\sfrom\sa\snon-empty\sdatabase\sfile\nis\sread.
-D 2019-01-06T02:06:31.916
+C For\sSQLITE_ENABLE_PREUPDATE_HOOK\sbuilds,\sdisable\sthe\soptimization\sfor\sa\nREPLACE\scommand\son\sa\sWITHOUT\sROWID\stable\swith\sno\sindexes,\striggers\sor\sforeign\nkey\sconstraints\sthat\scauses\sSQLite\sto\sclobber\sany\sexisting\srow\swithout\nseparately\schecking\sfor\sit.\sThis\soptimization\scauses\sSQLite\sto\somit\sthe\nexpected\spre-update-hook\scallbacks.
+D 2019-01-07T15:57:35.664
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
F Makefile.in d8b254f8bb81bab43c340d70d17dc3babab40fcc8a348c8255881f780a45fee6
F ext/session/sessioninvert.test ae1a003a9ab1f8d64227dbb5c3a4c97e65b561b01e7b2953cf48683fb2724169
F ext/session/sessionrebase.test ccfa716b23bd1d3b03217ee58cfd90c78d4b99f53e6a9a2f05e82363b9142810
F ext/session/sessionstat1.test 218d351cf9fcd6648f125a26b607b140310160184723c2666091b54450a68fb5
-F ext/session/sessionwor.test 07f0b304dc4df5454906069140bf6ec67edcaa3c548f3683354003cf2c22b64a
+F ext/session/sessionwor.test 67b5ab91d4f93ce65ff1f58240ac5ddf73f8670facc1ffa49cef56293d52818d
F ext/session/sqlite3session.c f88c4bd0404da56246b08f5d584462f8979ba6aedf8c30762b553f7ae91f51cf
F ext/session/sqlite3session.h 54d6356f5769d3695e5f63d719c6ee27671b2614973a2b675a3ff4d30d574233
F ext/session/test_session.c 98797aba475a799376c9a42214f2d1debf2d0c3cb657d9c8bbf4f70bf3fb4aec
F src/hash.h ab34c5c54a9e9de2e790b24349ba5aab3dbb4fd4
F src/hwtime.h 747c1bbe9df21a92e9c50f3bbec1de841dc5e5da
F src/in-operator.md 10cd8f4bcd225a32518407c2fb2484089112fd71
-F src/insert.c 1660fca0a94e173cb63e509b241202bc2f41d3170bfd675b310e366747313d5c
+F src/insert.c ad8226b25dfe415ed4733a74c87b8d97515154b15efc8df54e13484851d34489
F src/legacy.c 134ab3e3fae00a0f67a5187981d6935b24b337bcf0f4b3e5c9fa5763da95bf4e
F src/loadext.c e6f10875d52aca3b7e57ce1ec174aeafc9b6c00b43000cd30d791f9cb490b7a6
F src/main.c 008f45dd39cdc7fb9e7e1f61d75a5c97397f8e07427a8879be23e27747d5f948
F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
-P a874c649960ba2e2b2fd380d08c02a45884a1060d3922be8847729008ca6766e
-R 80813d325e813398099f00570b3e6669
-U drh
-Z 17d05c9142605382fe42e262b919a21f
+P 6064584d578f0ac7aba3f67912a5d9eb1a3c6001469f6b9becbe68871131f887
+R 5891afb5fe0955414602e3a4eee5383a
+U dan
+Z 154017c0c603e5d693331eba5bef4a7a
-6064584d578f0ac7aba3f67912a5d9eb1a3c6001469f6b9becbe68871131f887
\ No newline at end of file
+6281ef974c0ac7a7133c9e1e04c09fdbd627c019c6ff3227293548caf8283864
\ No newline at end of file
** (3) There are no secondary indexes on the table
** (4) No delete triggers need to be fired if there is a conflict
** (5) No FK constraint counters need to be updated if a conflict occurs.
- */
+ **
+ ** This is not possible for ENABLE_PREUPDATE_HOOK builds, as the row
+ ** must be explicitly deleted in order to ensure any pre-update hook
+ ** is invoked. */
+#ifndef SQLITE_ENABLE_PREUPDATE_HOOK
if( (ix==0 && pIdx->pNext==0) /* Condition 3 */
&& pPk==pIdx /* Condition 2 */
&& onError==OE_Replace /* Condition 1 */
sqlite3VdbeResolveLabel(v, addrUniqueOk);
continue;
}
+#endif /* ifndef SQLITE_ENABLE_PREUPDATE_HOOK */
/* Check to see if the new index entry will be unique */
sqlite3VdbeVerifyAbortable(v, onError);