From f6bff3f5d6c2f49bdee0b4a15f7677856b513c28 Mon Sep 17 00:00:00 2001 From: drh Date: Fri, 17 Jul 2015 01:16:10 +0000 Subject: [PATCH 01/26] Avoid a harmless compiler warning. FossilOrigin-Name: 2288842b8f191ff05a157db7f77af867bfa83c4f --- manifest | 14 +++++++------- manifest.uuid | 2 +- src/wal.c | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/manifest b/manifest index 6a62491cb7..6cd163f25a 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Fix\scompiler\swarnings\sin\sfts5\scode. -D 2015-07-16T20:17:57.553 +C Avoid\sa\sharmless\scompiler\swarning. +D 2015-07-17T01:16:10.825 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 6e8af213d49e6325bf283ebed7662254f8e15bda F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -401,7 +401,7 @@ F src/vdbesort.c f5009e7a35e3065635d8918b9a31f498a499976b F src/vdbetrace.c 8befe829faff6d9e6f6e4dee5a7d3f85cc85f1a0 F src/vtab.c 082b35a25a26e3d36f365ca8cd73c1922532f05e F src/vxworks.h c18586c8edc1bddbc15c004fa16aeb1e1342b4fb -F src/wal.c 6c9354c72452ab5699a44381ae03004ee2893824 +F src/wal.c 590e85f3b24e8ed2f3263abd1f69f219a1f15ad2 F src/wal.h df01efe09c5cb8c8e391ff1715cca294f89668a4 F src/walker.c c253b95b4ee44b21c406e2a1052636c31ea27804 F src/where.c 909eba3b6db984eb2adfbca9de2c237ee7056adb @@ -1365,7 +1365,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh 48bd54594752d5be3337f12c72f28d2080cb630b F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 9a592cf91c74b369bacf6a0e69d45f3e73dfdbce -R 7a5b6f6204af419d579789c3ece1729c -U dan -Z a4633be21e523e4e841d0095eaa70845 +P e9bf275cd969eca6fb41384d3637528d6a19f819 +R 12f173b5d59b5ca59e2ddd738e75f068 +U drh +Z b458ca27129248b1d38d912e023bd41c diff --git a/manifest.uuid b/manifest.uuid index dbc4f5f578..76645404d7 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -e9bf275cd969eca6fb41384d3637528d6a19f819 \ No newline at end of file +2288842b8f191ff05a157db7f77af867bfa83c4f \ No newline at end of file diff --git a/src/wal.c b/src/wal.c index 69f335d792..7f252baf02 100644 --- a/src/wal.c +++ b/src/wal.c @@ -648,9 +648,9 @@ static void walIndexWriteHdr(Wal *pWal){ pWal->hdr.isInit = 1; pWal->hdr.iVersion = WALINDEX_MAX_VERSION; walChecksumBytes(1, (u8*)&pWal->hdr, nCksum, 0, pWal->hdr.aCksum); - memcpy((void *)&aHdr[1], (void *)&pWal->hdr, sizeof(WalIndexHdr)); + memcpy((void*)&aHdr[1], (const void*)&pWal->hdr, sizeof(WalIndexHdr)); walShmBarrier(pWal); - memcpy((void *)&aHdr[0], (void *)&pWal->hdr, sizeof(WalIndexHdr)); + memcpy((void*)&aHdr[0], (const void*)&pWal->hdr, sizeof(WalIndexHdr)); } /* From 63abdc59dd3476adbe917b6ddb50dbd9ae9ed51e Mon Sep 17 00:00:00 2001 From: drh Date: Fri, 17 Jul 2015 12:42:53 +0000 Subject: [PATCH 02/26] More adjustments to the malloc5.test module so that it works correctly with the new pcache1 bulk allocation. FossilOrigin-Name: 2a7b3a440f74019f154496b2f95aa852a46e04fc --- manifest | 12 ++++++------ manifest.uuid | 2 +- test/malloc5.test | 5 +++++ 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/manifest b/manifest index 6cd163f25a..7815d1bf1c 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Avoid\sa\sharmless\scompiler\swarning. -D 2015-07-17T01:16:10.825 +C More\sadjustments\sto\sthe\smalloc5.test\smodule\sso\sthat\sit\sworks\scorrectly\swith\nthe\snew\spcache1\sbulk\sallocation. +D 2015-07-17T12:42:53.567 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 6e8af213d49e6325bf283ebed7662254f8e15bda F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -823,7 +823,7 @@ F test/make-where7.tcl 05c16b5d4f5d6512881dfec560cb793915932ef9 F test/malloc.test 21c213365f2cca95ab2d7dc078dc8525f96065f8 F test/malloc3.test e3b32c724b5a124b57cb0ed177f675249ad0c66a F test/malloc4.test 957337613002b7058a85116493a262f679f3a261 -F test/malloc5.test 21f6552bacb9efe649e6ba10a52f2cedaecce242 +F test/malloc5.test 4e87e596a28908c034eb5777fc33dd921bb44fc3 F test/malloc6.test 2f039d9821927eacae43e1831f815e157659a151 F test/malloc7.test 7c68a32942858bc715284856c5507446bba88c3a F test/malloc8.test 9b7a3f8cb9cf0b12fff566e80a980b1767bd961d @@ -1365,7 +1365,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh 48bd54594752d5be3337f12c72f28d2080cb630b F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P e9bf275cd969eca6fb41384d3637528d6a19f819 -R 12f173b5d59b5ca59e2ddd738e75f068 +P 2288842b8f191ff05a157db7f77af867bfa83c4f +R b4855de59061718601ad3bfe72c98bbc U drh -Z b458ca27129248b1d38d912e023bd41c +Z 238f0465cd3dec3d05c76c19fe6e7116 diff --git a/manifest.uuid b/manifest.uuid index 76645404d7..f8163d578f 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -2288842b8f191ff05a157db7f77af867bfa83c4f \ No newline at end of file +2a7b3a440f74019f154496b2f95aa852a46e04fc \ No newline at end of file diff --git a/test/malloc5.test b/test/malloc5.test index c9ee5dbc7d..3f5208accd 100644 --- a/test/malloc5.test +++ b/test/malloc5.test @@ -20,6 +20,11 @@ # # $Id: malloc5.test,v 1.22 2009/04/11 19:09:54 drh Exp $ +sqlite3_shutdown +sqlite3_config_pagecache 0 100 +sqlite3_initialize +autoinstall_test_functions + set testdir [file dirname $argv0] source $testdir/tester.tcl source $testdir/malloc_common.tcl From 9edb5ceb1f6b782fcdcbe0c09444e34f98fda591 Mon Sep 17 00:00:00 2001 From: mistachkin Date: Sun, 19 Jul 2015 19:53:23 +0000 Subject: [PATCH 03/26] Cleanup the 'config.h' file in the appropriate distclean targets. FossilOrigin-Name: e0a9978077a1b4e5988681438e4efff93920e574 --- Makefile.in | 2 +- autoconf/tea/Makefile.in | 2 +- manifest | 16 ++++++++-------- manifest.uuid | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Makefile.in b/Makefile.in index 2c91b8252d..dcf5a0bf80 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1192,7 +1192,7 @@ clean: rm -f fts5.* fts5parse.* distclean: clean - rm -f config.log config.status libtool Makefile sqlite3.pc + rm -f config.h config.log config.status libtool Makefile sqlite3.pc # # Windows section diff --git a/autoconf/tea/Makefile.in b/autoconf/tea/Makefile.in index a8708974b0..3e481dadfe 100644 --- a/autoconf/tea/Makefile.in +++ b/autoconf/tea/Makefile.in @@ -348,7 +348,7 @@ clean: distclean: clean -rm -f *.tab.c -rm -f $(CONFIG_CLEAN_FILES) - -rm -f config.cache config.log config.status + -rm -f config.h config.cache config.log config.status #======================================================================== # Install binary object libraries. On Windows this includes both .dll and diff --git a/manifest b/manifest index 7815d1bf1c..3772070e8b 100644 --- a/manifest +++ b/manifest @@ -1,7 +1,7 @@ -C More\sadjustments\sto\sthe\smalloc5.test\smodule\sso\sthat\sit\sworks\scorrectly\swith\nthe\snew\spcache1\sbulk\sallocation. -D 2015-07-17T12:42:53.567 +C Cleanup\sthe\s'config.h'\sfile\sin\sthe\sappropriate\sdistclean\stargets. +D 2015-07-19T19:53:23.061 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f -F Makefile.in 6e8af213d49e6325bf283ebed7662254f8e15bda +F Makefile.in 6b439e21d6dabede337772b85959340d37bb17bb F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 F Makefile.msc efafcbf2be203b61dc7b6301703544753c513cb2 F Makefile.vxworks e1b65dea203f054e71653415bd8f96dcaed47858 @@ -23,7 +23,7 @@ F autoconf/depcomp 0b26f101e3bc9fd1ff0be1da9fb4a82371142f92 x F autoconf/install-sh 06ee6336e63bb845c8439d777c32eb2eccc4fbf1 x F autoconf/ltmain.sh 7a658a24028f02331c1d2446562758083c5eadd1 F autoconf/missing d7c9981a81af13370d4ed152b24c0a82b7028585 x -F autoconf/tea/Makefile.in d55bcc63832caf0309c2ff80358756116618cfca +F autoconf/tea/Makefile.in b438a7020446c8a8156e8d97c8914a04833da6fd F autoconf/tea/README 3e9a3c060f29a44344ab50aec506f4db903fb873 F autoconf/tea/aclocal.m4 52c47aac44ce0ddb1f918b6993e8beb8eee88f43 F autoconf/tea/configure.ac 93d43c79e936fb16556e22498177d7e8571efa04 @@ -1365,7 +1365,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh 48bd54594752d5be3337f12c72f28d2080cb630b F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 2288842b8f191ff05a157db7f77af867bfa83c4f -R b4855de59061718601ad3bfe72c98bbc -U drh -Z 238f0465cd3dec3d05c76c19fe6e7116 +P 2a7b3a440f74019f154496b2f95aa852a46e04fc +R 9ac1abb764f2df34d280651c8f2240d5 +U mistachkin +Z d4dbff2c0caaf5449789190171f9545d diff --git a/manifest.uuid b/manifest.uuid index f8163d578f..da24f20144 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -2a7b3a440f74019f154496b2f95aa852a46e04fc \ No newline at end of file +e0a9978077a1b4e5988681438e4efff93920e574 \ No newline at end of file From 6b67a8ae035b1e349d82055971180b9f2d3b1fde Mon Sep 17 00:00:00 2001 From: mistachkin Date: Tue, 21 Jul 2015 19:22:35 +0000 Subject: [PATCH 04/26] Fix harmless compiler warning in MSVC 2015. FossilOrigin-Name: 01c8b9ccfa0f336dfead7c004de3de571753f707 --- manifest | 12 ++++++------ manifest.uuid | 2 +- src/wal.c | 10 +++++----- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/manifest b/manifest index 3772070e8b..5ef27fc936 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Cleanup\sthe\s'config.h'\sfile\sin\sthe\sappropriate\sdistclean\stargets. -D 2015-07-19T19:53:23.061 +C Fix\sharmless\scompiler\swarning\sin\sMSVC\s2015. +D 2015-07-21T19:22:35.266 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 6b439e21d6dabede337772b85959340d37bb17bb F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -401,7 +401,7 @@ F src/vdbesort.c f5009e7a35e3065635d8918b9a31f498a499976b F src/vdbetrace.c 8befe829faff6d9e6f6e4dee5a7d3f85cc85f1a0 F src/vtab.c 082b35a25a26e3d36f365ca8cd73c1922532f05e F src/vxworks.h c18586c8edc1bddbc15c004fa16aeb1e1342b4fb -F src/wal.c 590e85f3b24e8ed2f3263abd1f69f219a1f15ad2 +F src/wal.c 6fb6b68969e4692593c2552c4e7bff5882de2cb8 F src/wal.h df01efe09c5cb8c8e391ff1715cca294f89668a4 F src/walker.c c253b95b4ee44b21c406e2a1052636c31ea27804 F src/where.c 909eba3b6db984eb2adfbca9de2c237ee7056adb @@ -1365,7 +1365,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh 48bd54594752d5be3337f12c72f28d2080cb630b F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 2a7b3a440f74019f154496b2f95aa852a46e04fc -R 9ac1abb764f2df34d280651c8f2240d5 +P e0a9978077a1b4e5988681438e4efff93920e574 +R cbf3f19f824b2b3f6f21c8e30bb2d4e0 U mistachkin -Z d4dbff2c0caaf5449789190171f9545d +Z 106701e31e609f92431b2c0ad60fc867 diff --git a/manifest.uuid b/manifest.uuid index da24f20144..cc221e9da1 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -e0a9978077a1b4e5988681438e4efff93920e574 \ No newline at end of file +01c8b9ccfa0f336dfead7c004de3de571753f707 \ No newline at end of file diff --git a/src/wal.c b/src/wal.c index 7f252baf02..f7e2594001 100644 --- a/src/wal.c +++ b/src/wal.c @@ -952,13 +952,13 @@ static void walCleanupHash(Wal *pWal){ ** via the hash table even after the cleanup. */ if( iLimit ){ - int i; /* Loop counter */ + int j; /* Loop counter */ int iKey; /* Hash key */ - for(i=1; i<=iLimit; i++){ - for(iKey=walHash(aPgno[i]); aHash[iKey]; iKey=walNextHash(iKey)){ - if( aHash[iKey]==i ) break; + for(j=1; j<=iLimit; j++){ + for(iKey=walHash(aPgno[j]); aHash[iKey]; iKey=walNextHash(iKey)){ + if( aHash[iKey]==j ) break; } - assert( aHash[iKey]==i ); + assert( aHash[iKey]==j ); } } #endif /* SQLITE_ENABLE_EXPENSIVE_ASSERT */ From d3e3f0b46e52789ef8310a94894c450ba94d84a3 Mon Sep 17 00:00:00 2001 From: drh Date: Thu, 23 Jul 2015 16:39:33 +0000 Subject: [PATCH 05/26] The sqlite3ExprCodeGetColumn() is not guaranteed to put the result in the register requested. Fix the skip-scan code generator for WITHOUT ROWID tables so that it always checks the register and copies the result if it lands in the wrong register. Fix for ticket [8fd39115d8f46ece70e7d4b3]. FossilOrigin-Name: 793e206f9032d9205bdb3f447b136bed9a25fa22 --- manifest | 16 ++++++++-------- manifest.uuid | 2 +- src/wherecode.c | 6 +++++- test/skipscan1.test | 30 ++++++++++++++++++++++++++++++ 4 files changed, 44 insertions(+), 10 deletions(-) diff --git a/manifest b/manifest index 5ef27fc936..d107ab01d1 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Fix\sharmless\scompiler\swarning\sin\sMSVC\s2015. -D 2015-07-21T19:22:35.266 +C The\ssqlite3ExprCodeGetColumn()\sis\snot\sguaranteed\sto\sput\sthe\sresult\sin\sthe\nregister\srequested.\s\s\sFix\sthe\sskip-scan\scode\sgenerator\sfor\sWITHOUT\sROWID\ntables\sso\sthat\sit\salways\schecks\sthe\sregister\sand\scopies\sthe\sresult\sif\sit\nlands\sin\sthe\swrong\sregister.\s\sFix\sfor\sticket\s[8fd39115d8f46ece70e7d4b3]. +D 2015-07-23T16:39:33.653 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 6b439e21d6dabede337772b85959340d37bb17bb F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -406,7 +406,7 @@ F src/wal.h df01efe09c5cb8c8e391ff1715cca294f89668a4 F src/walker.c c253b95b4ee44b21c406e2a1052636c31ea27804 F src/where.c 909eba3b6db984eb2adfbca9de2c237ee7056adb F src/whereInt.h 5f87e3c4b0551747d119730dfebddd3c54f04047 -F src/wherecode.c 0669481cabaf5caf934b6bb825df15bc57f60d40 +F src/wherecode.c 5da5049224f12db314931ae7e0919b4914a2a0b1 F src/whereexpr.c 9ce1c9cfedbf80c93c7d899497025ec8256ce652 F test/8_3_names.test ebbb5cd36741350040fd28b432ceadf495be25b2 F test/affinity2.test a6d901b436328bd67a79b41bb0ac2663918fe3bd @@ -985,7 +985,7 @@ F test/shortread1.test bb591ef20f0fd9ed26d0d12e80eee6d7ac8897a3 F test/show_speedtest1_rtree.tcl 32e6c5f073d7426148a6936a0408f4b5b169aba5 F test/shrink.test 06deac10d591186017466ce67d10645150bfdeec F test/sidedelete.test f0ad71abe6233e3b153100f3b8d679b19a488329 -F test/skipscan1.test 2ddfe5d168462170c4487f534e2a99fb006b2076 +F test/skipscan1.test d37a75b4be4eb9dedeb69b4f38b1d0a74b5021d7 F test/skipscan2.test d1d1450952b7275f0b0a3a981f0230532743951a F test/skipscan3.test ec5bab3f81c7038b43450e7b3062e04a198bdbb5 F test/skipscan5.test 67817a4b6857c47e0e33ba3e506da6f23ef68de2 @@ -1365,7 +1365,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh 48bd54594752d5be3337f12c72f28d2080cb630b F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P e0a9978077a1b4e5988681438e4efff93920e574 -R cbf3f19f824b2b3f6f21c8e30bb2d4e0 -U mistachkin -Z 106701e31e609f92431b2c0ad60fc867 +P 01c8b9ccfa0f336dfead7c004de3de571753f707 +R 23f175ee7b2eb2636faea6e0fbfacef1 +U drh +Z 1c321a77d86fb7457929725064e82b93 diff --git a/manifest.uuid b/manifest.uuid index cc221e9da1..f5c0256de7 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -01c8b9ccfa0f336dfead7c004de3de571753f707 \ No newline at end of file +793e206f9032d9205bdb3f447b136bed9a25fa22 \ No newline at end of file diff --git a/src/wherecode.c b/src/wherecode.c index e1f0f86615..9747f7f375 100644 --- a/src/wherecode.c +++ b/src/wherecode.c @@ -1296,7 +1296,11 @@ Bitmask sqlite3WhereCodeOneLoopStart( r = sqlite3GetTempRange(pParse, nPk); for(iPk=0; iPkaiColumn[iPk]; - sqlite3ExprCodeGetColumn(pParse, pTab, iCol, iCur, r+iPk, 0); + int rx; + rx = sqlite3ExprCodeGetColumn(pParse, pTab, iCol, iCur,r+iPk,0); + if( rx!=r+iPk ){ + sqlite3VdbeAddOp2(v, OP_SCopy, rx, r+iPk); + } } /* Check if the temp table already contains this key. If so, diff --git a/test/skipscan1.test b/test/skipscan1.test index 4f996df972..ac26711603 100644 --- a/test/skipscan1.test +++ b/test/skipscan1.test @@ -292,4 +292,34 @@ do_execsql_test skipscan1-7.3 { EXPLAIN QUERY PLAN SELECT * FROM t1 WHERE b=1; } {~/ANY/} +# Ticket 8fd39115d8f46ece70e7d4b3c481d1bd86194746 2015-07-23 +# Incorrect code generated for a skipscan within an OR optimization +# on a WITHOUT ROWID table. +# +do_execsql_test skipscan1-8.1 { + DROP TABLE IF EXISTS t1; + CREATE TABLE t1(x, y, PRIMARY KEY(x,y)) WITHOUT ROWID; + INSERT INTO t1(x,y) VALUES(1,'AB'); + INSERT INTO t1(x,y) VALUES(2,'CD'); + ANALYZE; + DROP TABLE IF EXISTS sqlite_stat4; + DELETE FROM sqlite_stat1; + INSERT INTO sqlite_stat1(tbl,idx,stat) VALUES('t1','t1','1000000 100 1'); + ANALYZE sqlite_master; + SELECT * FROM t1 + WHERE (y = 'AB' AND x <= 4) + OR (y = 'EF' AND x = 5); +} {1 AB} +do_execsql_test skipscan1-8.1eqp { + EXPLAIN QUERY PLAN + SELECT * FROM t1 + WHERE (y = 'AB' AND x <= 4) + OR (y = 'EF' AND x = 5); +} {/ANY/} +do_execsql_test skipscan1-8.2 { + SELECT * FROM t1 + WHERE y = 'AB' OR (y = 'CD' AND x = 2) + ORDER BY +x; +} {1 AB 2 CD} + finish_test From 7877d9afca7cf5627801d1b0b69790a7158d5699 Mon Sep 17 00:00:00 2001 From: drh Date: Thu, 23 Jul 2015 17:16:27 +0000 Subject: [PATCH 06/26] When SQLITE_OMIT_LOOKASIDE is set, do not allocate any lookaside memory since it will never be used. FossilOrigin-Name: 0ffd499f2374f2b191080b9952acfed56daf3335 --- manifest | 12 ++++++------ manifest.uuid | 2 +- src/main.c | 2 ++ 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/manifest b/manifest index d107ab01d1..0d1fddcfea 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C The\ssqlite3ExprCodeGetColumn()\sis\snot\sguaranteed\sto\sput\sthe\sresult\sin\sthe\nregister\srequested.\s\s\sFix\sthe\sskip-scan\scode\sgenerator\sfor\sWITHOUT\sROWID\ntables\sso\sthat\sit\salways\schecks\sthe\sregister\sand\scopies\sthe\sresult\sif\sit\nlands\sin\sthe\swrong\sregister.\s\sFix\sfor\sticket\s[8fd39115d8f46ece70e7d4b3]. -D 2015-07-23T16:39:33.653 +C When\sSQLITE_OMIT_LOOKASIDE\sis\sset,\sdo\snot\sallocate\sany\slookaside\smemory\ssince\nit\swill\snever\sbe\sused. +D 2015-07-23T17:16:27.642 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 6b439e21d6dabede337772b85959340d37bb17bb F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -292,7 +292,7 @@ F src/journal.c b4124532212b6952f42eb2c12fa3c25701d8ba8d F src/legacy.c ba1863ea58c4c840335a84ec276fc2b25e22bc4e F src/lempar.c 92bafa308607dd985ca389a788cd9e0a2b608712 F src/loadext.c e722f4b832f923744788365df5fb8515c0bc8a47 -F src/main.c 92d79bfa1a36c7c554700bb58eb8327abff1ac5c +F src/main.c 0a60b7ca8252c3a6f95438fa4ce8fe5b275c69f2 F src/malloc.c 19461e159bccf0e2cf06a50e867963d0a7b124a8 F src/mem0.c 6a55ebe57c46ca1a7d98da93aaa07f99f1059645 F src/mem1.c abe6ee469b6c5a35c7f22bfeb9c9bac664a1c987 @@ -1365,7 +1365,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh 48bd54594752d5be3337f12c72f28d2080cb630b F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 01c8b9ccfa0f336dfead7c004de3de571753f707 -R 23f175ee7b2eb2636faea6e0fbfacef1 +P 793e206f9032d9205bdb3f447b136bed9a25fa22 +R 9158ac1eaf08b6ce5d701ee4b9a1ddba U drh -Z 1c321a77d86fb7457929725064e82b93 +Z 6817e7006180b52519c297d18e3556cf diff --git a/manifest.uuid b/manifest.uuid index f5c0256de7..78d6663e99 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -793e206f9032d9205bdb3f447b136bed9a25fa22 \ No newline at end of file +0ffd499f2374f2b191080b9952acfed56daf3335 \ No newline at end of file diff --git a/src/main.c b/src/main.c index faeee6af2e..36206eec8c 100644 --- a/src/main.c +++ b/src/main.c @@ -642,6 +642,7 @@ int sqlite3_config(int op, ...){ ** the lookaside memory. */ static int setupLookaside(sqlite3 *db, void *pBuf, int sz, int cnt){ +#ifndef SQLITE_OMIT_LOOKASIDE void *pStart; if( db->lookaside.nOut ){ return SQLITE_BUSY; @@ -692,6 +693,7 @@ static int setupLookaside(sqlite3 *db, void *pBuf, int sz, int cnt){ db->lookaside.bEnabled = 0; db->lookaside.bMalloced = 0; } +#endif /* SQLITE_OMIT_LOOKASIDE */ return SQLITE_OK; } From cfb8f8d6a9073040e90f0bf502f4b108d7917433 Mon Sep 17 00:00:00 2001 From: drh Date: Thu, 23 Jul 2015 20:44:49 +0000 Subject: [PATCH 07/26] Change the name of the OTA extension to RBU: Resumable Bulk Update. FossilOrigin-Name: 017c5019e1ce042025d4f327e50ec50af49f9fa4 --- Makefile.in | 6 +- Makefile.msc | 6 +- ext/{ota/ota.c => rbu/rbu.c} | 50 +- ext/{ota/ota1.test => rbu/rbu1.test} | 272 +-- ext/{ota/ota10.test => rbu/rbu10.test} | 58 +- ext/{ota/ota11.test => rbu/rbu11.test} | 102 +- ext/{ota/ota12.test => rbu/rbu12.test} | 100 +- ext/{ota/ota13.test => rbu/rbu13.test} | 18 +- ext/{ota/ota3.test => rbu/rbu3.test} | 92 +- ext/{ota/ota5.test => rbu/rbu5.test} | 86 +- ext/{ota/ota6.test => rbu/rbu6.test} | 52 +- ext/{ota/ota7.test => rbu/rbu7.test} | 38 +- ext/{ota/ota8.test => rbu/rbu8.test} | 30 +- ext/{ota/ota9.test => rbu/rbu9.test} | 36 +- ext/{ota/otaA.test => rbu/rbuA.test} | 40 +- ext/{ota/otacrash.test => rbu/rbucrash.test} | 78 +- ext/{ota/otafault.test => rbu/rbufault.test} | 66 +- .../otafault2.test => rbu/rbufault2.test} | 22 +- ext/{ota/sqlite3ota.c => rbu/sqlite3rbu.c} | 1578 ++++++++--------- ext/{ota/sqlite3ota.h => rbu/sqlite3rbu.h} | 248 +-- ext/{ota/test_ota.c => rbu/test_rbu.c} | 75 +- main.mk | 16 +- manifest | 70 +- manifest.uuid | 2 +- src/sqlite.h.in | 8 +- src/tclsqlite.c | 4 +- src/test_config.c | 6 +- test/permutations.test | 8 +- test/{ota.test => rbu.test} | 7 +- test/releasetest.tcl | 2 +- test/speedtest1.c | 12 +- tool/mksqlite3c.tcl | 6 +- 32 files changed, 1596 insertions(+), 1598 deletions(-) rename ext/{ota/ota.c => rbu/rbu.c} (67%) rename ext/{ota/ota1.test => rbu/rbu1.test} (71%) rename ext/{ota/ota10.test => rbu/rbu10.test} (81%) rename ext/{ota/ota11.test => rbu/rbu11.test} (64%) rename ext/{ota/ota12.test => rbu/rbu12.test} (71%) rename ext/{ota/ota13.test => rbu/rbu13.test} (80%) rename ext/{ota/ota3.test => rbu/rbu3.test} (65%) rename ext/{ota/ota5.test => rbu/rbu5.test} (83%) rename ext/{ota/ota6.test => rbu/rbu6.test} (70%) rename ext/{ota/ota7.test => rbu/rbu7.test} (79%) rename ext/{ota/ota8.test => rbu/rbu8.test} (75%) rename ext/{ota/ota9.test => rbu/rbu9.test} (81%) rename ext/{ota/otaA.test => rbu/rbuA.test} (70%) rename ext/{ota/otacrash.test => rbu/rbucrash.test} (59%) rename ext/{ota/otafault.test => rbu/rbufault.test} (78%) rename ext/{ota/otafault2.test => rbu/rbufault2.test} (78%) rename ext/{ota/sqlite3ota.c => rbu/sqlite3rbu.c} (69%) rename ext/{ota/sqlite3ota.h => rbu/sqlite3rbu.h} (63%) rename ext/{ota/test_ota.c => rbu/test_rbu.c} (71%) rename test/{ota.test => rbu.test} (76%) diff --git a/Makefile.in b/Makefile.in index dcf5a0bf80..9886377a4b 100644 --- a/Makefile.in +++ b/Makefile.in @@ -345,8 +345,8 @@ SRC += \ $(TOP)/ext/rtree/rtree.h \ $(TOP)/ext/rtree/rtree.c SRC += \ - $(TOP)/ext/ota/sqlite3ota.h \ - $(TOP)/ext/ota/sqlite3ota.c + $(TOP)/ext/rbu/sqlite3rbu.h \ + $(TOP)/ext/rbu/sqlite3rbu.c # Generated source code files @@ -404,7 +404,7 @@ TESTSRC = \ $(TOP)/src/test_wsd.c \ $(TOP)/ext/fts3/fts3_term.c \ $(TOP)/ext/fts3/fts3_test.c \ - $(TOP)/ext/ota/test_ota.c + $(TOP)/ext/rbu/test_rbu.c # Statically linked extensions # diff --git a/Makefile.msc b/Makefile.msc index ed6e58e949..bec86b1bc9 100644 --- a/Makefile.msc +++ b/Makefile.msc @@ -1007,8 +1007,8 @@ SRC4 = \ $(TOP)\ext\icu\icu.c \ $(TOP)\ext\rtree\rtree.h \ $(TOP)\ext\rtree\rtree.c \ - $(TOP)\ext\ota\sqlite3ota.h \ - $(TOP)\ext\ota\sqlite3ota.c + $(TOP)\ext\rbu\sqlite3rbu.h \ + $(TOP)\ext\rbu\sqlite3rbu.c # Generated source code files @@ -1069,7 +1069,7 @@ TESTSRC = \ $(TOP)\src\test_wsd.c \ $(TOP)\ext\fts3\fts3_term.c \ $(TOP)\ext\fts3\fts3_test.c \ - $(TOP)\ext\ota\test_ota.c + $(TOP)\ext\rbu\test_rbu.c # Statically linked extensions # diff --git a/ext/ota/ota.c b/ext/rbu/rbu.c similarity index 67% rename from ext/ota/ota.c rename to ext/rbu/rbu.c index fffc1267bd..6e84bbdebe 100644 --- a/ext/ota/ota.c +++ b/ext/rbu/rbu.c @@ -10,11 +10,11 @@ ** ************************************************************************* ** -** This file contains a command-line application that uses the OTA +** This file contains a command-line application that uses the RBU ** extension. See the usage() function below for an explanation. */ -#include "sqlite3ota.h" +#include "sqlite3rbu.h" #include #include #include @@ -24,18 +24,18 @@ */ void usage(const char *zArgv0){ fprintf(stderr, -"Usage: %s [-step NSTEP] TARGET-DB OTA-DB\n" +"Usage: %s [-step NSTEP] TARGET-DB RBU-DB\n" "\n" -" Argument OTA-DB must be an OTA database containing an update suitable for\n" +" Argument RBU-DB must be an RBU database containing an update suitable for\n" " target database TARGET-DB. If NSTEP is set to less than or equal to zero\n" " (the default value), this program attempts to apply the entire update to\n" " the target database.\n" "\n" " If NSTEP is greater than zero, then a maximum of NSTEP calls are made\n" -" to sqlite3ota_step(). If the OTA update has not been completely applied\n" -" after the NSTEP'th call is made, the state is saved in the database OTA-DB\n" -" and the program exits. Subsequent invocations of this (or any other OTA)\n" -" application will use this state to resume applying the OTA update to the\n" +" to sqlite3rbu_step(). If the RBU update has not been completely applied\n" +" after the NSTEP'th call is made, the state is saved in the database RBU-DB\n" +" and the program exits. Subsequent invocations of this (or any other RBU)\n" +" application will use this state to resume applying the RBU update to the\n" " target db.\n" "\n" , zArgv0); @@ -47,8 +47,8 @@ void report_default_vfs(){ fprintf(stdout, "default vfs is \"%s\"\n", pVfs->zName); } -void report_ota_vfs(sqlite3ota *pOta){ - sqlite3 *db = sqlite3ota_db(pOta, 0); +void report_rbu_vfs(sqlite3rbu *pRbu){ + sqlite3 *db = sqlite3rbu_db(pRbu, 0); if( db ){ char *zName = 0; sqlite3_file_control(db, "main", SQLITE_FCNTL_VFSNAME, &zName); @@ -63,16 +63,16 @@ void report_ota_vfs(sqlite3ota *pOta){ int main(int argc, char **argv){ int i; - const char *zTarget; /* Target database to apply OTA to */ - const char *zOta; /* Database containing OTA */ + const char *zTarget; /* Target database to apply RBU to */ + const char *zRbu; /* Database containing RBU */ char *zErrmsg; /* Error message, if any */ - sqlite3ota *pOta; /* OTA handle */ + sqlite3rbu *pRbu; /* RBU handle */ int nStep = 0; /* Maximum number of step() calls */ int rc; sqlite3_int64 nProgress = 0; /* Process command line arguments. Following this block local variables - ** zTarget, zOta and nStep are all set. */ + ** zTarget, zRbu and nStep are all set. */ if( argc==5 ){ int nArg1 = strlen(argv[1]); if( nArg1>5 || nArg1<2 || memcmp("-step", argv[1], nArg1) ) usage(argv[0]); @@ -81,32 +81,32 @@ int main(int argc, char **argv){ usage(argv[0]); } zTarget = argv[argc-2]; - zOta = argv[argc-1]; + zRbu = argv[argc-1]; report_default_vfs(); - /* Open an OTA handle. If nStep is less than or equal to zero, call - ** sqlite3ota_step() until either the OTA has been completely applied + /* Open an RBU handle. If nStep is less than or equal to zero, call + ** sqlite3rbu_step() until either the RBU has been completely applied ** or an error occurs. Or, if nStep is greater than zero, call - ** sqlite3ota_step() a maximum of nStep times. */ - pOta = sqlite3ota_open(zTarget, zOta, 0); - report_ota_vfs(pOta); - for(i=0; (nStep<=0 || i