From 91618564955d2da0e70c795076f214b5cb974b40 Mon Sep 17 00:00:00 2001 From: drh Date: Fri, 19 Dec 2014 19:28:02 +0000 Subject: [PATCH 01/54] Experimental "PRAGMA data_version" command for detecting when another process has changed the database file. FossilOrigin-Name: 43db1f44bce5a0ee50197b95ab0d844540b69d86 --- manifest | 25 ++++++++++++++----------- manifest.uuid | 2 +- src/btree.c | 13 ++++++++++++- src/btree.h | 8 +++++++- src/pager.c | 12 +++++++++++- src/pager.h | 1 + src/pragma.c | 8 +++++++- tool/mkpragmatab.tcl | 6 ++++++ 8 files changed, 59 insertions(+), 16 deletions(-) diff --git a/manifest b/manifest index 940c131970..f22a0f1b43 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Simplify\sthe\simplementation\sof\sthe\s"header-value"\spragmas\s(schema_version,\nuser_version,\sfreelist_count,\sand\sapplication_id)\sby\smaking\sthem\smore\ntable-driven. -D 2014-12-19T18:49:55.326 +C Experimental\s"PRAGMA\sdata_version"\scommand\sfor\sdetecting\swhen\sanother\sprocess\nhas\schanged\sthe\sdatabase\sfile. +D 2014-12-19T19:28:02.465 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 6c4f961fa91d0b4fa121946a19f9e5eac2f2f809 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -173,8 +173,8 @@ F src/auth.c b56c78ebe40a2110fd361379f7e8162d23f92240 F src/backup.c 7ddee9c7d505e07e959a575b18498f17c71e53ea F src/bitvec.c 19a4ba637bd85f8f63fc8c9bae5ade9fb05ec1cb F src/btmutex.c 49ca66250c7dfa844a4d4cb8272b87420d27d3a5 -F src/btree.c 92f745ccd18099973beb28e25fce80148545429e -F src/btree.h e31a3a3ebdedb1caf9bda3ad5dbab3db9b780f6e +F src/btree.c b2b2bd0aa02430fe86bc891295db919fcafb0d64 +F src/btree.h 94277c1d30c0b75705974bcc8b0c05e79c03d474 F src/btreeInt.h 3363e18fd76f69a27a870b25221b2345b3fd4d21 F src/build.c 162d84e4833b03f9d07192ef06057b0226f6e543 F src/callback.c 7b44ce59674338ad48b0e84e7b72f935ea4f68b0 @@ -216,13 +216,13 @@ F src/os_setup.h c9d4553b5aaa6f73391448b265b89bed0b890faa F src/os_unix.c fb587121840f690101336879adfa6d0b2cd0e8c7 F src/os_win.c ecb04a0dad2fa6fa659931a9d8f0f3aca33f908a F src/os_win.h 09e751b20bbc107ffbd46e13555dc73576d88e21 -F src/pager.c 7a5c5bc0e29b9b16834f5558a9d5d22bbae59a08 -F src/pager.h d1eee3c3f741be247ce6d82752a178515fc8578b +F src/pager.c abe022cd72e112a05db5fd1d6d46f5ed93284247 +F src/pager.h c3476e7c89cdf1c6914e50a11f3714e30b4e0a77 F src/parse.y 5dfead8aed90cb0c7c1115898ee2266804daff45 F src/pcache.c ace1b67632deeaa84859b4c16c27711dfb7db3d4 F src/pcache.h b44658c9c932d203510279439d891a2a83e12ba8 F src/pcache1.c facbdd3ecc09c8f750089d941305694301328e98 -F src/pragma.c 7337e5d9f14664e987be3e6ed4d73fad16e48ad1 +F src/pragma.c bd33aa24456f043bb6f6d32a918bbeed41d8c591 F src/prepare.c 173a5a499138451b2561614ecb87d78f9f4644b9 F src/printf.c 9e75a6a0b55bf61cfff7d7e19d89834a1b938236 F src/random.c ba2679f80ec82c4190062d756f22d0c358180696 @@ -1197,7 +1197,7 @@ F tool/logest.c eef612f8adf4d0993dafed0416064cf50d5d33c6 F tool/mkautoconfamal.sh 5dc5010e2e748a9e1bba67baca5956a2c2deda7b F tool/mkkeywordhash.c dfff09dbbfaf950e89af294f48f902181b144670 F tool/mkopts.tcl 66ac10d240cc6e86abd37dc908d50382f84ff46e -F tool/mkpragmatab.tcl f7facbe8988ce61946f8069d34827ffc6af92521 +F tool/mkpragmatab.tcl 07a5124cf2dbafa1b375eefcf8ac4227028b0f8b F tool/mkspeedsql.tcl a1a334d288f7adfe6e996f2e712becf076745c97 F tool/mksqlite3c-noext.tcl 88a1e3b0c769773fb7a9ebb363ffc603a4ac21d8 F tool/mksqlite3c.tcl e72c0c97fe1a105fa9616483e652949be2199fe6 @@ -1233,7 +1233,10 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 8c5dd6cc259e0cdaaddaa52ccfa96fee6b166906 -R 8ba8633e296b4b7fe64ae8b30f249024 +P da27a09d1d991583b59997f6cc67efa28ffd9d6a +R df4854633d0919cb180185852b6a45b5 +T *branch * data_version_pragma +T *sym-data_version_pragma * +T -sym-trunk * U drh -Z d788c0d876adfa7410350841952e3917 +Z 81defb06f28b03737e8cb7607139b4d9 diff --git a/manifest.uuid b/manifest.uuid index e0e3164dca..92b0ead781 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -da27a09d1d991583b59997f6cc67efa28ffd9d6a \ No newline at end of file +43db1f44bce5a0ee50197b95ab0d844540b69d86 \ No newline at end of file diff --git a/src/btree.c b/src/btree.c index d24f6a876a..1223f78e48 100644 --- a/src/btree.c +++ b/src/btree.c @@ -8177,6 +8177,13 @@ int sqlite3BtreeDropTable(Btree *p, int iTable, int *piMoved){ ** The schema layer numbers meta values differently. At the schema ** layer (and the SetCookie and ReadCookie opcodes) the number of ** free pages is not visible. So Cookie[0] is the same as Meta[1]. +** +** This routine treats Meta[BTREE_DATA_VERSION] as a special case. Instead +** of reading the value out of the header, it instead loads the "DataVersion" +** from the pager. The BTREE_DATA_VERSION value is not actually stored in the +** database file. It is a number computed by the pager. But its access +** pattern is the same as header meta values, and so it is convenient to +** read it from this routine. */ void sqlite3BtreeGetMeta(Btree *p, int idx, u32 *pMeta){ BtShared *pBt = p->pBt; @@ -8187,7 +8194,11 @@ void sqlite3BtreeGetMeta(Btree *p, int idx, u32 *pMeta){ assert( pBt->pPage1 ); assert( idx>=0 && idx<=15 ); - *pMeta = get4byte(&pBt->pPage1->aData[36 + idx*4]); + if( idx==BTREE_DATA_VERSION ){ + *pMeta = sqlite3PagerDataVersion(pBt->pPager); + }else{ + *pMeta = get4byte(&pBt->pPage1->aData[36 + idx*4]); + } /* If auto-vacuum is disabled in this build and this is an auto-vacuum ** database, mark the database as read-only. */ diff --git a/src/btree.h b/src/btree.h index 281e57dafd..b57d500c77 100644 --- a/src/btree.h +++ b/src/btree.h @@ -19,7 +19,7 @@ /* TODO: This definition is just included so other modules compile. It ** needs to be revisited. */ -#define SQLITE_N_BTREE_META 10 +#define SQLITE_N_BTREE_META 16 /* ** If defined as non-zero, auto-vacuum is enabled by default. Otherwise @@ -134,6 +134,11 @@ int sqlite3BtreeNewDb(Btree *p); ** For example, the free-page-count field is located at byte offset 36 of ** the database file header. The incr-vacuum-flag field is located at ** byte offset 64 (== 36+4*7). +** +** The BTREE_DATA_VERSION value is not really a value stored in the header. +** It is a read-only number computed by the pager. But we merge it with +** the header value access routines since its access pattern is the same. +** Call it a "virtual meta value". */ #define BTREE_FREE_PAGE_COUNT 0 #define BTREE_SCHEMA_VERSION 1 @@ -144,6 +149,7 @@ int sqlite3BtreeNewDb(Btree *p); #define BTREE_USER_VERSION 6 #define BTREE_INCR_VACUUM 7 #define BTREE_APPLICATION_ID 8 +#define BTREE_DATA_VERSION 15 /* A virtual meta-value */ /* ** Values that may be OR'd together to form the second argument of an diff --git a/src/pager.c b/src/pager.c index a2ae9cc410..97dd78e35b 100644 --- a/src/pager.c +++ b/src/pager.c @@ -646,6 +646,7 @@ struct Pager { u8 setMaster; /* True if a m-j name has been written to jrnl */ u8 doNotSpill; /* Do not spill the cache when non-zero */ u8 subjInMemory; /* True to use in-memory sub-journals */ + u8 bUseFetch; /* True to use xFetch() */ Pgno dbSize; /* Number of pages in the database */ Pgno dbOrigSize; /* dbSize before the current transaction */ Pgno dbFileSize; /* Number of pages in the database file */ @@ -663,9 +664,9 @@ struct Pager { sqlite3_backup *pBackup; /* Pointer to list of ongoing backup processes */ PagerSavepoint *aSavepoint; /* Array of active savepoints */ int nSavepoint; /* Number of elements in aSavepoint[] */ + u32 nReset; /* Number of calls to pager_reset() */ char dbFileVers[16]; /* Changes whenever database file changes */ - u8 bUseFetch; /* True to use xFetch() */ int nMmapOut; /* Number of mmap pages currently outstanding */ sqlite3_int64 szMmap; /* Desired maximum mmap size */ PgHdr *pMmapFreelist; /* List of free mmap page headers (pDirty) */ @@ -1681,10 +1682,19 @@ static int writeMasterJournal(Pager *pPager, const char *zMaster){ ** Discard the entire contents of the in-memory page-cache. */ static void pager_reset(Pager *pPager){ + pPager->nReset++; sqlite3BackupRestart(pPager->pBackup); sqlite3PcacheClear(pPager->pPCache); } +/* +** Return the pPager->nReset value +*/ +u32 sqlite3PagerDataVersion(Pager *pPager){ + assert( pPager->eState>PAGER_OPEN ); + return pPager->nReset; +} + /* ** Free all structures in the Pager.aSavepoint[] array and set both ** Pager.aSavepoint and Pager.nSavepoint to zero. Close the sub-journal diff --git a/src/pager.h b/src/pager.h index 764c7bd197..e07fa88fc5 100644 --- a/src/pager.h +++ b/src/pager.h @@ -172,6 +172,7 @@ int sqlite3PagerSharedLock(Pager *pPager); /* Functions used to query pager state and configuration. */ u8 sqlite3PagerIsreadonly(Pager*); +u32 sqlite3PagerDataVersion(Pager*); int sqlite3PagerRefcount(Pager*); int sqlite3PagerMemUsed(Pager*); const char *sqlite3PagerFilename(Pager*, int); diff --git a/src/pragma.c b/src/pragma.c index cbeb81eee6..1312beef04 100644 --- a/src/pragma.c +++ b/src/pragma.c @@ -154,6 +154,12 @@ static const struct sPragmaNames { /* ePragFlag: */ 0, /* iArg: */ 0 }, #endif +#if !defined(SQLITE_OMIT_SCHEMA_VERSION_PRAGMAS) + { /* zName: */ "data_version", + /* ePragTyp: */ PragTyp_HEADER_VALUE, + /* ePragFlag: */ PragFlag_ReadOnly, + /* iArg: */ BTREE_DATA_VERSION }, +#endif #if !defined(SQLITE_OMIT_SCHEMA_PRAGMAS) { /* zName: */ "database_list", /* ePragTyp: */ PragTyp_DATABASE_LIST, @@ -471,7 +477,7 @@ static const struct sPragmaNames { /* iArg: */ SQLITE_WriteSchema|SQLITE_RecoveryMode }, #endif }; -/* Number of pragmas: 57 on by default, 70 total. */ +/* Number of pragmas: 58 on by default, 71 total. */ /* End of the automatically generated pragma table. ***************************************************************************/ diff --git a/tool/mkpragmatab.tcl b/tool/mkpragmatab.tcl index 2c9b84b735..21503d16ee 100644 --- a/tool/mkpragmatab.tcl +++ b/tool/mkpragmatab.tcl @@ -254,6 +254,12 @@ set pragma_def { ARG: BTREE_USER_VERSION IF: !defined(SQLITE_OMIT_SCHEMA_VERSION_PRAGMAS) + NAME: data_version + TYPE: HEADER_VALUE + ARG: BTREE_DATA_VERSION + FLAG: ReadOnly + IF: !defined(SQLITE_OMIT_SCHEMA_VERSION_PRAGMAS) + NAME: freelist_count TYPE: HEADER_VALUE ARG: BTREE_FREE_PAGE_COUNT From 0d339e44a0fa01a8f99ca2bda5971aecbd860922 Mon Sep 17 00:00:00 2001 From: drh Date: Fri, 19 Dec 2014 20:27:02 +0000 Subject: [PATCH 02/54] Adding test cases for the "PRAGMA data_version" command. FossilOrigin-Name: c5fb7d6a106d46f10e71abe3a6d4243b21ed02a5 --- manifest | 14 ++++------ manifest.uuid | 2 +- test/pragma3.test | 70 +++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 77 insertions(+), 9 deletions(-) create mode 100644 test/pragma3.test diff --git a/manifest b/manifest index f22a0f1b43..221ed91de4 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Experimental\s"PRAGMA\sdata_version"\scommand\sfor\sdetecting\swhen\sanother\sprocess\nhas\schanged\sthe\sdatabase\sfile. -D 2014-12-19T19:28:02.465 +C Adding\stest\scases\sfor\sthe\s"PRAGMA\sdata_version"\scommand. +D 2014-12-19T20:27:02.112 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 6c4f961fa91d0b4fa121946a19f9e5eac2f2f809 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -785,6 +785,7 @@ F test/percentile.test b98fc868d71eb5619d42a1702e9ab91718cbed54 F test/permutations.test 4e12d43f4639ea8a0e366d9c64e0009afe2eb544 F test/pragma.test aa16dedfe01c02c8895169012f7dfde9c163f0d5 F test/pragma2.test aea7b3d82c76034a2df2b38a13745172ddc0bc13 +F test/pragma3.test 117ef9768f6c8d11823de7bbe3231b35c426b013 F test/printf.test ec9870c4dce8686a37818e0bf1aba6e6a1863552 F test/printf2.test b4acd4bf8734243257f01ddefa17c4fb090acc8a F test/progress.test a282973d1d17f08071bc58a77d6b80f2a81c354d @@ -1233,10 +1234,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P da27a09d1d991583b59997f6cc67efa28ffd9d6a -R df4854633d0919cb180185852b6a45b5 -T *branch * data_version_pragma -T *sym-data_version_pragma * -T -sym-trunk * +P 43db1f44bce5a0ee50197b95ab0d844540b69d86 +R 2feb9c2cda6af5a5f57185acec7e4041 U drh -Z 81defb06f28b03737e8cb7607139b4d9 +Z 8c3ff0ee7ae569dc5dbcf90ed4307270 diff --git a/manifest.uuid b/manifest.uuid index 92b0ead781..bcdaad2219 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -43db1f44bce5a0ee50197b95ab0d844540b69d86 \ No newline at end of file +c5fb7d6a106d46f10e71abe3a6d4243b21ed02a5 \ No newline at end of file diff --git a/test/pragma3.test b/test/pragma3.test new file mode 100644 index 0000000000..f3229ee528 --- /dev/null +++ b/test/pragma3.test @@ -0,0 +1,70 @@ +# 2014-12-19 +# +# The author disclaims copyright to this source code. In place of +# a legal notice, here is a blessing: +# +# May you do good and not evil. +# May you find forgiveness for yourself and forgive others. +# May you share freely, never taking more than you give. +# +#*********************************************************************** +# This file implements regression tests for SQLite library. +# +# This file implements tests for PRAGMA data_version command. +# + +set testdir [file dirname $argv0] +source $testdir/tester.tcl + +do_execsql_test pragma3-100 { + PRAGMA data_version; +} {1} +do_execsql_test pragma3-101 { + PRAGMA temp.data_version; +} {1} + +# Writing is a no-op +do_execsql_test pragma3-102 { + PRAGMA main.data_version=1234; + PRAGMA main.data_version; +} {1 1} + +do_execsql_test pragma3-110 { + CREATE TABLE t1(a); + INSERT INTO t1 VALUES(100),(200),(300); + SELECT * FROM t1; + PRAGMA data_version; +} {100 200 300 1} + +sqlite3 db2 test.db +do_test pragma3-120 { + db2 eval { + SELECT * FROM t1; + PRAGMA data_version; + } +} {100 200 300 1} + +do_execsql_test pragma3-130 { + INSERT INTO t1 VALUES(400),(500); + SELECT * FROM t1; + PRAGMA data_version; +} {100 200 300 400 500 1} + +do_test pragma3-140 { + db2 eval { + SELECT * FROM t1; + PRAGMA data_version; + UPDATE t1 SET a=a+1; + SELECT * FROM t1; + PRAGMA data_version; + } +} {100 200 300 400 500 2 101 201 301 401 501 2} + +do_execsql_test pragma3-150 { + SELECT * FROM t1; + PRAGMA data_version; +} {101 201 301 401 501 2} + + +db2 close +finish_test From d7107b3852793d77c7e5e4ac679ec99300a42507 Mon Sep 17 00:00:00 2001 From: drh Date: Sat, 20 Dec 2014 14:34:02 +0000 Subject: [PATCH 03/54] Update the PRAGMA data_version command so that it reponse to changes made by a shared-cache database connection, and also to changes made by the same database connection. Add test cases to verify the new behavior. FossilOrigin-Name: 44ee538374940c50198949f2cbb9213ba2375b6a --- manifest | 14 +++---- manifest.uuid | 2 +- src/pager.c | 9 ++-- test/pragma3.test | 102 ++++++++++++++++++++++++++++++++++++++++++---- 4 files changed, 108 insertions(+), 19 deletions(-) diff --git a/manifest b/manifest index 221ed91de4..affc6751c4 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Adding\stest\scases\sfor\sthe\s"PRAGMA\sdata_version"\scommand. -D 2014-12-19T20:27:02.112 +C Update\sthe\sPRAGMA\sdata_version\scommand\sso\sthat\sit\sreponse\sto\schanges\smade\nby\sa\sshared-cache\sdatabase\sconnection,\sand\salso\sto\schanges\smade\sby\sthe\ssame\ndatabase\sconnection.\s\sAdd\stest\scases\sto\sverify\sthe\snew\sbehavior. +D 2014-12-20T14:34:02.508 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 6c4f961fa91d0b4fa121946a19f9e5eac2f2f809 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -216,7 +216,7 @@ F src/os_setup.h c9d4553b5aaa6f73391448b265b89bed0b890faa F src/os_unix.c fb587121840f690101336879adfa6d0b2cd0e8c7 F src/os_win.c ecb04a0dad2fa6fa659931a9d8f0f3aca33f908a F src/os_win.h 09e751b20bbc107ffbd46e13555dc73576d88e21 -F src/pager.c abe022cd72e112a05db5fd1d6d46f5ed93284247 +F src/pager.c 2cbaf886a6157c53a8061ea7e677f81620ff46eb F src/pager.h c3476e7c89cdf1c6914e50a11f3714e30b4e0a77 F src/parse.y 5dfead8aed90cb0c7c1115898ee2266804daff45 F src/pcache.c ace1b67632deeaa84859b4c16c27711dfb7db3d4 @@ -785,7 +785,7 @@ F test/percentile.test b98fc868d71eb5619d42a1702e9ab91718cbed54 F test/permutations.test 4e12d43f4639ea8a0e366d9c64e0009afe2eb544 F test/pragma.test aa16dedfe01c02c8895169012f7dfde9c163f0d5 F test/pragma2.test aea7b3d82c76034a2df2b38a13745172ddc0bc13 -F test/pragma3.test 117ef9768f6c8d11823de7bbe3231b35c426b013 +F test/pragma3.test af097524ab7fdac11d3a37a5bab4f947f2d5d16c F test/printf.test ec9870c4dce8686a37818e0bf1aba6e6a1863552 F test/printf2.test b4acd4bf8734243257f01ddefa17c4fb090acc8a F test/progress.test a282973d1d17f08071bc58a77d6b80f2a81c354d @@ -1234,7 +1234,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 43db1f44bce5a0ee50197b95ab0d844540b69d86 -R 2feb9c2cda6af5a5f57185acec7e4041 +P c5fb7d6a106d46f10e71abe3a6d4243b21ed02a5 +R 4d00079d15bfd5a1a2ef4485d7808f56 U drh -Z 8c3ff0ee7ae569dc5dbcf90ed4307270 +Z 7090cd431f3e847d9d9c987c1e3b054c diff --git a/manifest.uuid b/manifest.uuid index bcdaad2219..5bbac1f6ef 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -c5fb7d6a106d46f10e71abe3a6d4243b21ed02a5 \ No newline at end of file +44ee538374940c50198949f2cbb9213ba2375b6a \ No newline at end of file diff --git a/src/pager.c b/src/pager.c index 97dd78e35b..67b95f7186 100644 --- a/src/pager.c +++ b/src/pager.c @@ -664,7 +664,7 @@ struct Pager { sqlite3_backup *pBackup; /* Pointer to list of ongoing backup processes */ PagerSavepoint *aSavepoint; /* Array of active savepoints */ int nSavepoint; /* Number of elements in aSavepoint[] */ - u32 nReset; /* Number of calls to pager_reset() */ + u32 iDataVersion; /* Changes whenever database content changes */ char dbFileVers[16]; /* Changes whenever database file changes */ int nMmapOut; /* Number of mmap pages currently outstanding */ @@ -1682,17 +1682,17 @@ static int writeMasterJournal(Pager *pPager, const char *zMaster){ ** Discard the entire contents of the in-memory page-cache. */ static void pager_reset(Pager *pPager){ - pPager->nReset++; + pPager->iDataVersion++; sqlite3BackupRestart(pPager->pBackup); sqlite3PcacheClear(pPager->pPCache); } /* -** Return the pPager->nReset value +** Return the pPager->iDataVersion value */ u32 sqlite3PagerDataVersion(Pager *pPager){ assert( pPager->eState>PAGER_OPEN ); - return pPager->nReset; + return pPager->iDataVersion; } /* @@ -6317,6 +6317,7 @@ int sqlite3PagerCommitPhaseTwo(Pager *pPager){ } PAGERTRACE(("COMMIT %d\n", PAGERID(pPager))); + pPager->iDataVersion++; rc = pager_end_transaction(pPager, pPager->setMaster, 1); return pager_error(pPager, rc); } diff --git a/test/pragma3.test b/test/pragma3.test index f3229ee528..a070c9b42c 100644 --- a/test/pragma3.test +++ b/test/pragma3.test @@ -23,18 +23,34 @@ do_execsql_test pragma3-101 { PRAGMA temp.data_version; } {1} -# Writing is a no-op +# Writing to the pragma is a no-op do_execsql_test pragma3-102 { PRAGMA main.data_version=1234; PRAGMA main.data_version; } {1 1} +# EVIDENCE-OF: R-27726-60934 The "PRAGMA data_version" command provides +# an indication that the database file has been modified. +# +# EVIDENCE-OF: R-30058-27547 The integer values returned by two +# invocations of "PRAGMA data_version" will be different if changes +# where committed to that database in between the two invocations. +# +# EVIDENCE-OF: R-10201-09349 The "PRAGMA data_version" command responses +# to changes committed by the same database connection, by database +# connections sharing a cache in shared cache mode, and by completely +# independent database connections including connections in separate +# threads and processes. +# +# In this test, it response to two separate changes on the same database +# connection. +# do_execsql_test pragma3-110 { CREATE TABLE t1(a); INSERT INTO t1 VALUES(100),(200),(300); SELECT * FROM t1; PRAGMA data_version; -} {100 200 300 1} +} {100 200 300 3} sqlite3 db2 test.db do_test pragma3-120 { @@ -48,8 +64,17 @@ do_execsql_test pragma3-130 { INSERT INTO t1 VALUES(400),(500); SELECT * FROM t1; PRAGMA data_version; -} {100 200 300 400 500 1} +} {100 200 300 400 500 4} +# EVIDENCE-OF: R-10201-09349 The "PRAGMA data_version" command responses +# to changes committed by the same database connection, by database +# connections sharing a cache in shared cache mode, and by completely +# independent database connections including connections in separate +# threads and processes. +# +# In these test, it response to changes in a different database connection +# part of the same process. +# do_test pragma3-140 { db2 eval { SELECT * FROM t1; @@ -58,13 +83,76 @@ do_test pragma3-140 { SELECT * FROM t1; PRAGMA data_version; } -} {100 200 300 400 500 2 101 201 301 401 501 2} - +} {100 200 300 400 500 2 101 201 301 401 501 3} do_execsql_test pragma3-150 { SELECT * FROM t1; PRAGMA data_version; -} {101 201 301 401 501 2} - +} {101 201 301 401 501 5} +# EVIDENCE-OF: R-10201-09349 The "PRAGMA data_version" command responses +# to changes committed by the same database connection, by database +# connections sharing a cache in shared cache mode, and by completely +# independent database connections including connections in separate +# threads and processes. +# +# This test verifies behavior when a separate process changes the database +# file. +# +do_test pragma3-200 { + set fd [open pragma3.txt wb] + puts $fd { + sqlite3 db test.db; + db eval {DELETE FROM t1 WHERE a>300}; + db close; + exit; + } + close $fd + exec [info nameofexec] pragma3.txt + forcedelete pragma3.txt + db eval { + PRAGMA data_version; + SELECT * FROM t1; + } +} {6 101 201} db2 close +db close + +# EVIDENCE-OF: R-10201-09349 The "PRAGMA data_version" command responses +# to changes committed by the same database connection, by database +# connections sharing a cache in shared cache mode, and by completely +# independent database connections including connections in separate +# threads and processes. +# +# The next series of tests verifies the behavior for shared-cache +# database connections. +# +ifcapable shared_cache { + set ::enable_shared_cache [sqlite3_enable_shared_cache 1] + sqlite3 db test.db + sqlite3 db2 test.db + do_test pragma3-300 { + db eval { + PRAGMA data_version; + CREATE TABLE t3(a,b,c); + PRAGMA data_version; + } + } {1 2} + do_test pragma3-310 { + db2 eval { + PRAGMA data_version; + INSERT INTO t3(a,b,c) VALUES('abc','def','ghi'); + SELECT * FROM t3; + PRAGMA data_version; + } + } {2 abc def ghi 3} + do_test pragma3-320 { + db eval { + PRAGMA data_version; + SELECT * FROM t3; + } + } {3 abc def ghi} + db2 close + sqlite3_enable_shared_cache $::enable_shared_cache +} + finish_test From cd54bab6fe5946c641979abfe7e16c42cf9436f1 Mon Sep 17 00:00:00 2001 From: mistachkin Date: Sat, 20 Dec 2014 21:14:14 +0000 Subject: [PATCH 04/54] Minor fixes and enhancements to the SQLITE_ENABLE_API_ARMOR functionality. FossilOrigin-Name: cb3e4219ac9560d2773b85453aafda54b7c9346f --- Makefile.msc | 38 ++++++++++++++++++++++---------------- manifest | 25 ++++++++++++------------- manifest.uuid | 2 +- src/complete.c | 14 +++++++------- src/main.c | 6 ++++-- src/mutex_w32.c | 6 ++++++ src/table.c | 2 +- src/tokenize.c | 3 +++ 8 files changed, 56 insertions(+), 40 deletions(-) diff --git a/Makefile.msc b/Makefile.msc index 64175a0679..3fc675ee4f 100644 --- a/Makefile.msc +++ b/Makefile.msc @@ -108,11 +108,12 @@ WIN32HEAP = 0 # levels. Currently, the recognized values for DEBUG are: # # 0 == NDEBUG: Disables assert() and other runtime diagnostics. -# 1 == Disables NDEBUG and all optimizations and then enables PDBs. -# 2 == SQLITE_DEBUG: Enables various diagnostics messages and code. -# 3 == SQLITE_WIN32_MALLOC_VALIDATE: Validate the Win32 native heap per call. -# 4 == SQLITE_DEBUG_OS_TRACE: Enables output from the OSTRACE() macros. -# 5 == SQLITE_ENABLE_IOTRACE: Enables output from the IOTRACE() macros. +# 1 == SQLITE_ENABLE_API_ARMOR: extra attempts to detect misuse of the API. +# 2 == Disables NDEBUG and all optimizations and then enables PDBs. +# 3 == SQLITE_DEBUG: Enables various diagnostics messages and code. +# 4 == SQLITE_WIN32_MALLOC_VALIDATE: Validate the Win32 native heap per call. +# 5 == SQLITE_DEBUG_OS_TRACE: Enables output from the OSTRACE() macros. +# 6 == SQLITE_ENABLE_IOTRACE: Enables output from the IOTRACE() macros. # !IFNDEF DEBUG DEBUG = 0 @@ -280,7 +281,7 @@ RCC = $(RCC) -DWINAPI_FAMILY=WINAPI_FAMILY_APP # MSVC runtime library. # !IF $(FOR_WINRT)!=0 || $(USE_CRT_DLL)!=0 -!IF $(DEBUG)>0 +!IF $(DEBUG)>1 TCC = $(TCC) -MDd BCC = $(BCC) -MDd !ELSE @@ -288,7 +289,7 @@ TCC = $(TCC) -MD BCC = $(BCC) -MD !ENDIF !ELSE -!IF $(DEBUG)>0 +!IF $(DEBUG)>1 TCC = $(TCC) -MTd BCC = $(BCC) -MTd !ELSE @@ -313,7 +314,7 @@ RCC = $(RCC) -I$(TOP)\ext\rtree # options are necessary in order to allow debugging symbols to # work correctly with Visual Studio when using the amalgamation. # -!IF $(DEBUG)>0 +!IF $(DEBUG)>1 MKSQLITE3C_ARGS = --linemacros !ELSE MKSQLITE3C_ARGS = @@ -329,17 +330,22 @@ BCC = $(BCC) -DNDEBUG RCC = $(RCC) -DNDEBUG !ENDIF -!IF $(DEBUG)>1 +!IF $(DEBUG)>0 +TCC = $(TCC) -DSQLITE_ENABLE_API_ARMOR +RCC = $(RCC) -DSQLITE_ENABLE_API_ARMOR +!ENDIF + +!IF $(DEBUG)>2 TCC = $(TCC) -DSQLITE_DEBUG RCC = $(RCC) -DSQLITE_DEBUG !ENDIF -!IF $(DEBUG)>3 +!IF $(DEBUG)>4 TCC = $(TCC) -DSQLITE_DEBUG_OS_TRACE=1 RCC = $(RCC) -DSQLITE_DEBUG_OS_TRACE=1 !ENDIF -!IF $(DEBUG)>4 +!IF $(DEBUG)>5 TCC = $(TCC) -DSQLITE_ENABLE_IOTRACE RCC = $(RCC) -DSQLITE_ENABLE_IOTRACE !ENDIF @@ -371,7 +377,7 @@ RCC = $(RCC) -DSQLITE_WIN32_MALLOC=1 # Validate the heap on every call into the native Win32 heap subsystem? # -!IF $(DEBUG)>2 +!IF $(DEBUG)>3 TCC = $(TCC) -DSQLITE_WIN32_MALLOC_VALIDATE=1 RCC = $(RCC) -DSQLITE_WIN32_MALLOC_VALIDATE=1 !ENDIF @@ -482,7 +488,7 @@ RCC = $(RCC) $(OPTS) # If compiling for debugging, add some defines. # -!IF $(DEBUG)>0 +!IF $(DEBUG)>1 TCC = $(TCC) -D_DEBUG BCC = $(BCC) -D_DEBUG RCC = $(RCC) -D_DEBUG @@ -491,7 +497,7 @@ RCC = $(RCC) -D_DEBUG # If optimizations are enabled or disabled (either implicitly or # explicitly), add the necessary flags. # -!IF $(DEBUG)>0 || $(OPTIMIZATIONS)==0 +!IF $(DEBUG)>1 || $(OPTIMIZATIONS)==0 TCC = $(TCC) -Od BCC = $(BCC) -Od !ELSEIF $(OPTIMIZATIONS)>=3 @@ -507,7 +513,7 @@ BCC = $(BCC) -O1 # If symbols are enabled (or compiling for debugging), enable PDBs. # -!IF $(DEBUG)>0 || $(SYMBOLS)!=0 +!IF $(DEBUG)>1 || $(SYMBOLS)!=0 TCC = $(TCC) -Zi BCC = $(BCC) -Zi !ENDIF @@ -592,7 +598,7 @@ LTLINKOPTS = $(LTLINKOPTS) /NODEFAULTLIB:kernel32.lib /NODEFAULTLIB:ole32.lib # If either debugging or symbols are enabled, enable PDBs. # -!IF $(DEBUG)>0 || $(SYMBOLS)!=0 +!IF $(DEBUG)>1 || $(SYMBOLS)!=0 LDFLAGS = /DEBUG !ENDIF diff --git a/manifest b/manifest index b4b2c48ca5..6353c101f7 100644 --- a/manifest +++ b/manifest @@ -1,9 +1,9 @@ -C Add\sthe\s"PRAGMA\sdata_version"\scommand\sfor\schecking\sto\ssee\sif\sa\sdatabase\shas\nbeen\smodified. -D 2014-12-20T14:50:28.363 +C Minor\sfixes\sand\senhancements\sto\sthe\sSQLITE_ENABLE_API_ARMOR\sfunctionality. +D 2014-12-20T21:14:14.374 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 6c4f961fa91d0b4fa121946a19f9e5eac2f2f809 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 -F Makefile.msc 10720782f88648bf2b5dcedf4c1524b067d43e47 +F Makefile.msc b363b90fe1bfc3b87d190f2f728a126c00d9ce09 F Makefile.vxworks 034289efa9d591b04b1a73598623119c306cbba0 F README.md 64f270c43c38c46de749e419c22f0ae2f4499fe8 F VERSION d846487aff892625eb8e75960234e7285f0462fe @@ -178,7 +178,7 @@ F src/btree.h 94277c1d30c0b75705974bcc8b0c05e79c03d474 F src/btreeInt.h 3363e18fd76f69a27a870b25221b2345b3fd4d21 F src/build.c 162d84e4833b03f9d07192ef06057b0226f6e543 F src/callback.c 7b44ce59674338ad48b0e84e7b72f935ea4f68b0 -F src/complete.c c4ba6e0626bb94bc77a0861735f3382fcf7cc818 +F src/complete.c 198a0066ba60ab06fc00fba1998d870a4d575463 F src/ctime.c df19848891c8a553c80e6f5a035e768280952d1a F src/date.c 93594514aae68de117ca4a2a0d6cc63eddf26744 F src/delete.c 0750b1eb4d96cd3fb2c798599a3a7c85e92f1417 @@ -195,7 +195,7 @@ F src/journal.c b4124532212b6952f42eb2c12fa3c25701d8ba8d F src/legacy.c ba1863ea58c4c840335a84ec276fc2b25e22bc4e F src/lempar.c 7274c97d24bb46631e504332ccd3bd1b37841770 F src/loadext.c 86bd4e2fccd520b748cba52492ab60c4a770f660 -F src/main.c 48e0410a661c629471ca9061d4153245cc9f853b +F src/main.c ee498c89735ba7b581fbd58d2ad2e7679a0475b2 F src/malloc.c 740db54387204c9a2eb67c6d98e68b08e9ef4eab F src/mem0.c 6a55ebe57c46ca1a7d98da93aaa07f99f1059645 F src/mem1.c faf615aafd8be74a71494dfa027c113ea5c6615f @@ -207,7 +207,7 @@ F src/mutex.c 19bf9acba69ca2f367c3761080f8a9f0cf4670a8 F src/mutex.h 779d588e3b7756ec3ecf7d78cde1d84aba414f85 F src/mutex_noop.c f3f09fd7a2eb4287cfc799753ffc30380e7b71a1 F src/mutex_unix.c 551e2f25f0fa0ee8fd7a43f50fc3d8be00e95dde -F src/mutex_w32.c 06bfff9a3a83b53389a51a967643db3967032e1e +F src/mutex_w32.c df48fe07562a45c5c927c45b8d5873a27f98bbb0 F src/notify.c 9711a7575036f0d3040ba61bc6e217f13a9888e7 F src/os.c 8fd25588eeba74068d41102d26810e216999b6c8 F src/os.h 3e57a24e2794a94d3cf2342c6d9a884888cd96bf @@ -236,7 +236,7 @@ F src/sqlite3ext.h 17d487c3c91b0b8c584a32fbeb393f6f795eea7d F src/sqliteInt.h d36da9a07130cae13cbfee0986bf20028cb01465 F src/sqliteLimit.h 164b0e6749d31e0daa1a4589a169d31c0dec7b3d F src/status.c 81712116e826b0089bb221b018929536b2b5406f -F src/table.c f142bba7903e93ca8d113a5b8877a108ad1a27dc +F src/table.c e7a09215315a978057fb42c640f890160dbcc45e F src/tclsqlite.c c6a21c64da1490e14d53cdc2062d1e2e57942622 F src/test1.c 56e33bf6b1827c6ca7520c189131ddd778fb2267 F src/test2.c 98049e51a17dc62606a99a9eb95ee477f9996712 @@ -285,7 +285,7 @@ F src/test_vfs.c f84075a388527892ff184988f43b69ce69b8083c F src/test_vfstrace.c bab9594adc976cbe696ff3970728830b4c5ed698 F src/test_wsd.c 41cadfd9d97fe8e3e4e44f61a4a8ccd6f7ca8fe9 F src/threads.c 6de09362b657f19ba83e5fa521ee715787ce9fee -F src/tokenize.c cc9016e5007fc5e76789079616d2f26741bcc689 +F src/tokenize.c e00458c9938072b0ea711c850b8dcf4ddcb5fe18 F src/trigger.c 25571661fdeae8c7f975ff40ffec205520a3f92f F src/update.c 3c4ecc282accf12d39edb8d524cf089645e55a13 F src/utf.c fc6b889ba0779b7722634cdeaa25f1930d93820c @@ -1234,8 +1234,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P da27a09d1d991583b59997f6cc67efa28ffd9d6a 44ee538374940c50198949f2cbb9213ba2375b6a -R 6a9e76520ab206bdf596f781a2c88e65 -T +closed 44ee538374940c50198949f2cbb9213ba2375b6a -U drh -Z 9a9f87b94c56980445c2924a0392e880 +P de50f25ce3226fa4929b8236c72c88b739859d5f +R c123b89e18af5f5ce6fabce3b17d012e +U mistachkin +Z 086c85a234ecd6ff163dc839ee55f963 diff --git a/manifest.uuid b/manifest.uuid index 59533b96a3..31b35da2d7 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -de50f25ce3226fa4929b8236c72c88b739859d5f \ No newline at end of file +cb3e4219ac9560d2773b85453aafda54b7c9346f \ No newline at end of file diff --git a/src/complete.c b/src/complete.c index c439cfe181..f7a35cc6f3 100644 --- a/src/complete.c +++ b/src/complete.c @@ -105,13 +105,6 @@ int sqlite3_complete(const char *zSql){ u8 state = 0; /* Current state, using numbers defined in header comment */ u8 token; /* Value of the next token */ -#ifdef SQLITE_ENABLE_API_ARMOR - if( zSql==0 ){ - (void)SQLITE_MISUSE_BKPT; - return 0; - } -#endif - #ifndef SQLITE_OMIT_TRIGGER /* A complex statement machine used to detect the end of a CREATE TRIGGER ** statement. This is the normal case. @@ -141,6 +134,13 @@ int sqlite3_complete(const char *zSql){ }; #endif /* SQLITE_OMIT_TRIGGER */ +#ifdef SQLITE_ENABLE_API_ARMOR + if( zSql==0 ){ + (void)SQLITE_MISUSE_BKPT; + return 0; + } +#endif + while( *zSql ){ switch( *zSql ){ case ';': { /* A semicolon */ diff --git a/src/main.c b/src/main.c index c89ccbd55d..76af9a2e95 100644 --- a/src/main.c +++ b/src/main.c @@ -3659,13 +3659,14 @@ Btree *sqlite3DbNameToBtree(sqlite3 *db, const char *zDbName){ ** connection. */ const char *sqlite3_db_filename(sqlite3 *db, const char *zDbName){ + Btree *pBt; #ifdef SQLITE_ENABLE_API_ARMOR if( !sqlite3SafetyCheckOk(db) ){ (void)SQLITE_MISUSE_BKPT; return 0; } #endif - Btree *pBt = sqlite3DbNameToBtree(db, zDbName); + pBt = sqlite3DbNameToBtree(db, zDbName); return pBt ? sqlite3BtreeGetFilename(pBt) : 0; } @@ -3674,12 +3675,13 @@ const char *sqlite3_db_filename(sqlite3 *db, const char *zDbName){ ** no such database exists. */ int sqlite3_db_readonly(sqlite3 *db, const char *zDbName){ + Btree *pBt; #ifdef SQLITE_ENABLE_API_ARMOR if( !sqlite3SafetyCheckOk(db) ){ (void)SQLITE_MISUSE_BKPT; return -1; } #endif - Btree *pBt = sqlite3DbNameToBtree(db, zDbName); + pBt = sqlite3DbNameToBtree(db, zDbName); return pBt ? sqlite3BtreeIsReadonly(pBt) : -1; } diff --git a/src/mutex_w32.c b/src/mutex_w32.c index da7d73f7c5..a799c86159 100644 --- a/src/mutex_w32.c +++ b/src/mutex_w32.c @@ -209,6 +209,12 @@ static sqlite3_mutex *winMutexAlloc(int iType){ break; } default: { +#ifdef SQLITE_ENABLE_API_ARMOR + if( iType-2<0 || iType-2>=ArraySize(winMutex_staticMutexes) ){ + (void)SQLITE_MISUSE_BKPT; + return 0; + } +#endif assert( iType-2 >= 0 ); assert( iType-2 < ArraySize(winMutex_staticMutexes) ); assert( winMutex_isInit==1 ); diff --git a/src/table.c b/src/table.c index 6e1df30643..235d8dd3df 100644 --- a/src/table.c +++ b/src/table.c @@ -127,7 +127,7 @@ int sqlite3_get_table( TabResult res; #ifdef SQLITE_ENABLE_API_ARMOR - if( pazResult==0 ) return SQLITE_MISUSE_BKPT; + if( !sqlite3SafetyCheckOk(db) || pazResult==0 ) return SQLITE_MISUSE_BKPT; #endif *pazResult = 0; if( pnColumn ) *pnColumn = 0; diff --git a/src/tokenize.c b/src/tokenize.c index 5bb9155460..f0360eef61 100644 --- a/src/tokenize.c +++ b/src/tokenize.c @@ -391,6 +391,9 @@ int sqlite3RunParser(Parse *pParse, const char *zSql, char **pzErrMsg){ int mxSqlLen; /* Max length of an SQL string */ +#ifdef SQLITE_ENABLE_API_ARMOR + if( zSql==0 || pzErrMsg==0 ) return SQLITE_MISUSE_BKPT; +#endif mxSqlLen = db->aLimit[SQLITE_LIMIT_SQL_LENGTH]; if( db->nVdbeActive==0 ){ db->u1.isInterrupted = 0; From d9d812fc3878495b7435d6c25b64209b04330f2c Mon Sep 17 00:00:00 2001 From: mistachkin Date: Sat, 20 Dec 2014 22:21:49 +0000 Subject: [PATCH 05/54] Support manually disabling overlapped file I/O for Windows sub-platforms other than Windows CE. FossilOrigin-Name: b9330b887cc8bed2b6b3e6c1b269788e08ccf50d --- manifest | 12 ++++++------ manifest.uuid | 2 +- src/os_win.c | 14 +++++++------- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/manifest b/manifest index 6353c101f7..24ba3c7b0a 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Minor\sfixes\sand\senhancements\sto\sthe\sSQLITE_ENABLE_API_ARMOR\sfunctionality. -D 2014-12-20T21:14:14.374 +C Support\smanually\sdisabling\soverlapped\sfile\sI/O\sfor\sWindows\ssub-platforms\sother\sthan\sWindows\sCE. +D 2014-12-20T22:21:49.905 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 6c4f961fa91d0b4fa121946a19f9e5eac2f2f809 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -214,7 +214,7 @@ F src/os.h 3e57a24e2794a94d3cf2342c6d9a884888cd96bf F src/os_common.h 92815ed65f805560b66166e3583470ff94478f04 F src/os_setup.h c9d4553b5aaa6f73391448b265b89bed0b890faa F src/os_unix.c fb587121840f690101336879adfa6d0b2cd0e8c7 -F src/os_win.c ecb04a0dad2fa6fa659931a9d8f0f3aca33f908a +F src/os_win.c 91d3d08e33ec0258d180d4c8255492f47d15e007 F src/os_win.h 09e751b20bbc107ffbd46e13555dc73576d88e21 F src/pager.c 2cbaf886a6157c53a8061ea7e677f81620ff46eb F src/pager.h c3476e7c89cdf1c6914e50a11f3714e30b4e0a77 @@ -1234,7 +1234,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P de50f25ce3226fa4929b8236c72c88b739859d5f -R c123b89e18af5f5ce6fabce3b17d012e +P cb3e4219ac9560d2773b85453aafda54b7c9346f +R ac9484154ad6b155e9718a0c54a2f6d5 U mistachkin -Z 086c85a234ecd6ff163dc839ee55f963 +Z f0b985b941d4fc82caba937840400408 diff --git a/manifest.uuid b/manifest.uuid index 31b35da2d7..b62cc74d7e 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -cb3e4219ac9560d2773b85453aafda54b7c9346f \ No newline at end of file +b9330b887cc8bed2b6b3e6c1b269788e08ccf50d \ No newline at end of file diff --git a/src/os_win.c b/src/os_win.c index 80ce97a6cd..e2f9aecac6 100644 --- a/src/os_win.c +++ b/src/os_win.c @@ -2479,7 +2479,7 @@ static int winRead( int amt, /* Number of bytes to read */ sqlite3_int64 offset /* Begin reading at this offset */ ){ -#if !SQLITE_OS_WINCE +#if !SQLITE_OS_WINCE && !defined(SQLITE_WIN32_NO_OVERLAPPED) OVERLAPPED overlapped; /* The offset for ReadFile. */ #endif winFile *pFile = (winFile*)id; /* file handle */ @@ -2511,7 +2511,7 @@ static int winRead( } #endif -#if SQLITE_OS_WINCE +#if SQLITE_OS_WINCE || defined(SQLITE_WIN32_NO_OVERLAPPED) if( winSeekFile(pFile, offset) ){ OSTRACE(("READ file=%p, rc=SQLITE_FULL\n", pFile->h)); return SQLITE_FULL; @@ -2583,13 +2583,13 @@ static int winWrite( } #endif -#if SQLITE_OS_WINCE +#if SQLITE_OS_WINCE || defined(SQLITE_WIN32_NO_OVERLAPPED) rc = winSeekFile(pFile, offset); if( rc==0 ){ #else { #endif -#if !SQLITE_OS_WINCE +#if !SQLITE_OS_WINCE && !defined(SQLITE_WIN32_NO_OVERLAPPED) OVERLAPPED overlapped; /* The offset for WriteFile. */ #endif u8 *aRem = (u8 *)pBuf; /* Data yet to be written */ @@ -2597,14 +2597,14 @@ static int winWrite( DWORD nWrite; /* Bytes written by each WriteFile() call */ DWORD lastErrno = NO_ERROR; /* Value returned by GetLastError() */ -#if !SQLITE_OS_WINCE +#if !SQLITE_OS_WINCE && !defined(SQLITE_WIN32_NO_OVERLAPPED) memset(&overlapped, 0, sizeof(OVERLAPPED)); overlapped.Offset = (LONG)(offset & 0xffffffff); overlapped.OffsetHigh = (LONG)((offset>>32) & 0x7fffffff); #endif while( nRem>0 ){ -#if SQLITE_OS_WINCE +#if SQLITE_OS_WINCE || defined(SQLITE_WIN32_NO_OVERLAPPED) if( !osWriteFile(pFile->h, aRem, nRem, &nWrite, 0) ){ #else if( !osWriteFile(pFile->h, aRem, nRem, &nWrite, &overlapped) ){ @@ -2617,7 +2617,7 @@ static int winWrite( lastErrno = osGetLastError(); break; } -#if !SQLITE_OS_WINCE +#if !SQLITE_OS_WINCE && !defined(SQLITE_WIN32_NO_OVERLAPPED) offset += nWrite; overlapped.Offset = (LONG)(offset & 0xffffffff); overlapped.OffsetHigh = (LONG)((offset>>32) & 0x7fffffff); From dd31b4e709b65916083061a60f6bc055c5122cac Mon Sep 17 00:00:00 2001 From: drh Date: Sun, 21 Dec 2014 11:56:02 +0000 Subject: [PATCH 06/54] Fixes to the README.md file. No changes to code. FossilOrigin-Name: ef4b734d1ff3dbb9c802c60dc1384033fdfd87e5 --- README.md | 24 ++++++++++++------------ manifest | 14 +++++++------- manifest.uuid | 2 +- 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index 5e52dea507..ff8dc34aef 100644 --- a/README.md +++ b/README.md @@ -53,10 +53,10 @@ to the "sqlite3.dll" command line above. When debugging into the SQLite code, adding the "DEBUG=1" argument to one of the above command lines is recommended. -SQLite does not require Tcl to run, but a Tcl installation is required -by the makefiles (including those for MSVC). SQLite contains a lot of -generated code and Tcl is used to do much of that code generation. The -makefiles also require AWK. +SQLite does not require [Tcl](http://www.tcl.tk/) to run, but a Tcl installation +is required by the makefiles (including those for MSVC). SQLite contains +a lot of generated code and Tcl is used to do much of that code generation. +The makefiles also require AWK. ## Source Code Tour @@ -95,14 +95,14 @@ manually-edited files and automatically-generated files. The SQLite interface is defined by the **sqlite3.h** header file, which is generated from src/sqlite.h.in, ./manifest.uuid, and ./VERSION. The -Tcl script at tool/mksqlite3h.tcl does the conversion. The manifest.uuid -file contains the SHA1 hash of the particular check-in and is used to generate -the SQLITE_SOURCE_ID macro. The VERSION file contains the current SQLite -version number. The sqlite3.h header is really just a copy of src/sqlite.h.in -with the source-id and version number inserted at just the right spots. -Note that comment text in the sqlite3.h file is used to generate much of -the SQLite API documentation. The Tcl scripts used to generate that -documentation are in a separate source repository. +[Tcl script](http://www.tcl.tk) at tool/mksqlite3h.tcl does the conversion. +The manifest.uuid file contains the SHA1 hash of the particular check-in +and is used to generate the SQLITE\_SOURCE\_ID macro. The VERSION file +contains the current SQLite version number. The sqlite3.h header is really +just a copy of src/sqlite.h.in with the source-id and version number inserted +at just the right spots. Note that comment text in the sqlite3.h file is +used to generate much of the SQLite API documentation. The Tcl scripts +used to generate that documentation are in a separate source repository. The SQL language parser is **parse.c** which is generate from a grammar in the src/parse.y file. The conversion of "parse.y" into "parse.c" is done diff --git a/manifest b/manifest index 24ba3c7b0a..d7e15132e7 100644 --- a/manifest +++ b/manifest @@ -1,11 +1,11 @@ -C Support\smanually\sdisabling\soverlapped\sfile\sI/O\sfor\sWindows\ssub-platforms\sother\sthan\sWindows\sCE. -D 2014-12-20T22:21:49.905 +C Fixes\sto\sthe\sREADME.md\sfile.\s\sNo\schanges\sto\scode. +D 2014-12-21T11:56:02.079 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 6c4f961fa91d0b4fa121946a19f9e5eac2f2f809 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 F Makefile.msc b363b90fe1bfc3b87d190f2f728a126c00d9ce09 F Makefile.vxworks 034289efa9d591b04b1a73598623119c306cbba0 -F README.md 64f270c43c38c46de749e419c22f0ae2f4499fe8 +F README.md d58e3bebc0a4145e0f2a87994015fdb575a8e866 F VERSION d846487aff892625eb8e75960234e7285f0462fe F aclocal.m4 a5c22d164aff7ed549d53a90fa56d56955281f50 F addopcodes.awk 9eb448a552d5c0185cf62c463f9c173cedae3811 @@ -1234,7 +1234,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P cb3e4219ac9560d2773b85453aafda54b7c9346f -R ac9484154ad6b155e9718a0c54a2f6d5 -U mistachkin -Z f0b985b941d4fc82caba937840400408 +P b9330b887cc8bed2b6b3e6c1b269788e08ccf50d +R 92e5107af7d9564747f56fe6b5bf8f20 +U drh +Z 2bbd439edb2e1185c83f3c807f675b2f diff --git a/manifest.uuid b/manifest.uuid index b62cc74d7e..08ca74492b 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -b9330b887cc8bed2b6b3e6c1b269788e08ccf50d \ No newline at end of file +ef4b734d1ff3dbb9c802c60dc1384033fdfd87e5 \ No newline at end of file From 3da9c04712ed96e74427c8168fcfac5527413e1c Mon Sep 17 00:00:00 2001 From: drh Date: Mon, 22 Dec 2014 18:41:21 +0000 Subject: [PATCH 07/54] Redefine the way PRAGMA data_version works: It continues to change when any other connection commits, including shared-cache connections, but does not change if the local connection commits. FossilOrigin-Name: 7a97826f33460f3b4f3890c9cf97116c3355eeda --- manifest | 16 ++--- manifest.uuid | 2 +- src/btree.c | 3 +- src/btreeInt.h | 1 + test/pragma3.test | 146 ++++++++++++++++++++++++++++++++-------------- 5 files changed, 114 insertions(+), 54 deletions(-) diff --git a/manifest b/manifest index d7e15132e7..8ae7e71d4a 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Fixes\sto\sthe\sREADME.md\sfile.\s\sNo\schanges\sto\scode. -D 2014-12-21T11:56:02.079 +C Redefine\sthe\sway\sPRAGMA\sdata_version\sworks:\s\sIt\scontinues\sto\schange\swhen\nany\sother\sconnection\scommits,\sincluding\sshared-cache\sconnections,\sbut\sdoes\snot\nchange\sif\sthe\slocal\sconnection\scommits. +D 2014-12-22T18:41:21.243 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 6c4f961fa91d0b4fa121946a19f9e5eac2f2f809 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -173,9 +173,9 @@ F src/auth.c b56c78ebe40a2110fd361379f7e8162d23f92240 F src/backup.c 7ddee9c7d505e07e959a575b18498f17c71e53ea F src/bitvec.c 19a4ba637bd85f8f63fc8c9bae5ade9fb05ec1cb F src/btmutex.c 49ca66250c7dfa844a4d4cb8272b87420d27d3a5 -F src/btree.c b2b2bd0aa02430fe86bc891295db919fcafb0d64 +F src/btree.c 1de0560426ecde85ff3ea95d7c94261d7652e284 F src/btree.h 94277c1d30c0b75705974bcc8b0c05e79c03d474 -F src/btreeInt.h 3363e18fd76f69a27a870b25221b2345b3fd4d21 +F src/btreeInt.h a3d0ae1d511365e1a2b76ad10960dbe55c286f34 F src/build.c 162d84e4833b03f9d07192ef06057b0226f6e543 F src/callback.c 7b44ce59674338ad48b0e84e7b72f935ea4f68b0 F src/complete.c 198a0066ba60ab06fc00fba1998d870a4d575463 @@ -785,7 +785,7 @@ F test/percentile.test b98fc868d71eb5619d42a1702e9ab91718cbed54 F test/permutations.test 4e12d43f4639ea8a0e366d9c64e0009afe2eb544 F test/pragma.test aa16dedfe01c02c8895169012f7dfde9c163f0d5 F test/pragma2.test aea7b3d82c76034a2df2b38a13745172ddc0bc13 -F test/pragma3.test 1935dfdd0082250df4cf4caed52bdfef527c34ff +F test/pragma3.test 3da08d907ba027c50ede8d6e95418f32898971a5 F test/printf.test ec9870c4dce8686a37818e0bf1aba6e6a1863552 F test/printf2.test b4acd4bf8734243257f01ddefa17c4fb090acc8a F test/progress.test a282973d1d17f08071bc58a77d6b80f2a81c354d @@ -1234,7 +1234,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P b9330b887cc8bed2b6b3e6c1b269788e08ccf50d -R 92e5107af7d9564747f56fe6b5bf8f20 +P ef4b734d1ff3dbb9c802c60dc1384033fdfd87e5 +R 717423e0d3aaa97f5eb5c0e7357ce13c U drh -Z 2bbd439edb2e1185c83f3c807f675b2f +Z 78337e4052167193689952903ddb287b diff --git a/manifest.uuid b/manifest.uuid index 08ca74492b..327aa0952b 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -ef4b734d1ff3dbb9c802c60dc1384033fdfd87e5 \ No newline at end of file +7a97826f33460f3b4f3890c9cf97116c3355eeda \ No newline at end of file diff --git a/src/btree.c b/src/btree.c index 1223f78e48..e6a7e2c2b9 100644 --- a/src/btree.c +++ b/src/btree.c @@ -3550,6 +3550,7 @@ int sqlite3BtreeCommitPhaseTwo(Btree *p, int bCleanup){ sqlite3BtreeLeave(p); return rc; } + p->iDataVersion--; /* Compensate for pPager->iDataVersion++; */ pBt->inTransaction = TRANS_READ; btreeClearHasContent(pBt); } @@ -8195,7 +8196,7 @@ void sqlite3BtreeGetMeta(Btree *p, int idx, u32 *pMeta){ assert( idx>=0 && idx<=15 ); if( idx==BTREE_DATA_VERSION ){ - *pMeta = sqlite3PagerDataVersion(pBt->pPager); + *pMeta = sqlite3PagerDataVersion(pBt->pPager) + p->iDataVersion; }else{ *pMeta = get4byte(&pBt->pPage1->aData[36 + idx*4]); } diff --git a/src/btreeInt.h b/src/btreeInt.h index a28a6a297e..ed4d75ee9f 100644 --- a/src/btreeInt.h +++ b/src/btreeInt.h @@ -351,6 +351,7 @@ struct Btree { u8 locked; /* True if db currently has pBt locked */ int wantToLock; /* Number of nested calls to sqlite3BtreeEnter() */ int nBackup; /* Number of backup operations reading this btree */ + u32 iDataVersion; /* Combines with pBt->pPager->iDataVersion */ Btree *pNext; /* List of other sharable Btrees from the same db */ Btree *pPrev; /* Back pointer of the same list */ #ifndef SQLITE_OMIT_SHARED_CACHE diff --git a/test/pragma3.test b/test/pragma3.test index 5918d0f0ed..e6069f6e53 100644 --- a/test/pragma3.test +++ b/test/pragma3.test @@ -32,25 +32,20 @@ do_execsql_test pragma3-102 { # EVIDENCE-OF: R-27726-60934 The "PRAGMA data_version" command provides # an indication that the database file has been modified. # -# EVIDENCE-OF: R-30058-27547 The integer values returned by two -# invocations of "PRAGMA data_version" will be different if changes -# where committed to that database in between the two invocations. -# -# EVIDENCE-OF: R-10201-09349 The "PRAGMA data_version" command responses -# to changes committed by the same database connection, by database -# connections sharing a cache in shared cache mode, and by completely -# independent database connections including connections in separate -# threads and processes. -# -# In this test, it response to two separate changes on the same database -# connection. +# EVIDENCE-OF: R-25838-33704 The "PRAGMA data_version" value is +# unchanced for commits made on the same database connection. # do_execsql_test pragma3-110 { + PRAGMA data_version; + BEGIN IMMEDIATE; + PRAGMA data_version; CREATE TABLE t1(a); INSERT INTO t1 VALUES(100),(200),(300); + PRAGMA data_version; + COMMIT; SELECT * FROM t1; PRAGMA data_version; -} {100 200 300 3} +} {1 1 1 100 200 300 1} sqlite3 db2 test.db do_test pragma3-120 { @@ -61,44 +56,88 @@ do_test pragma3-120 { } {100 200 300 1} do_execsql_test pragma3-130 { + PRAGMA data_version; + BEGIN IMMEDIATE; + PRAGMA data_version; INSERT INTO t1 VALUES(400),(500); + PRAGMA data_version; + COMMIT; SELECT * FROM t1; PRAGMA data_version; -} {100 200 300 400 500 4} +} {1 1 1 100 200 300 400 500 1} -# EVIDENCE-OF: R-10201-09349 The "PRAGMA data_version" command responses -# to changes committed by the same database connection, by database -# connections sharing a cache in shared cache mode, and by completely -# independent database connections including connections in separate -# threads and processes. +# EVIDENCE-OF: R-63005-41812 The integer values returned by two +# invocations of "PRAGMA data_version" from the same connection will be +# different if changes were committed to the database by any other +# connection in the interim. # -# In these test, it response to changes in a different database connection -# part of the same process. +# Value went from 1 in pragma3-120 to 2 here. # do_test pragma3-140 { db2 eval { SELECT * FROM t1; PRAGMA data_version; + BEGIN IMMEDIATE; + PRAGMA data_version; UPDATE t1 SET a=a+1; + COMMIT; SELECT * FROM t1; PRAGMA data_version; } -} {100 200 300 400 500 2 101 201 301 401 501 3} +} {100 200 300 400 500 2 2 101 201 301 401 501 2} do_execsql_test pragma3-150 { SELECT * FROM t1; PRAGMA data_version; -} {101 201 301 401 501 5} +} {101 201 301 401 501 2} -# EVIDENCE-OF: R-10201-09349 The "PRAGMA data_version" command responses -# to changes committed by the same database connection, by database -# connections sharing a cache in shared cache mode, and by completely -# independent database connections including connections in separate -# threads and processes. # -# This test verifies behavior when a separate process changes the database -# file. +do_test pragma3-160 { + db eval { + BEGIN; + PRAGMA data_version; + UPDATE t1 SET a=555 WHERE a=501; + PRAGMA data_version; + SELECT * FROM t1 ORDER BY a; + PRAGMA data_version; + } +} {2 2 101 201 301 401 555 2} +do_test pragma3-170 { + db2 eval { + PRAGMA data_version; + } +} {2} +do_test pragma3-180 { + db eval { + COMMIT; + PRAGMA data_version; + } +} {2} +do_test pragma3-190 { + db2 eval { + PRAGMA data_version; + } +} {3} + +# EVIDENCE-OF: R-19326-44825 The "PRAGMA data_version" value is a local +# property of each database connection and so values returned by two +# concurrent invocations of "PRAGMA data_version" on separate database +# connections are often different even though the underlying database is +# identical. +# +do_test pragma3-195 { + expr {[db eval {PRAGMA data_version}]!=[db2 eval {PRAGMA data_version}]} +} {1} + +# EVIDENCE-OF: R-54562-06892 The behavior of "PRAGMA data_version" is +# the same for all database connections, including database connections +# in separate processes and shared cache database connections. +# +# The next block checks the behavior for separate processes. # do_test pragma3-200 { + db eval {PRAGMA data_version; SELECT * FROM t1;} +} {2 101 201 301 401 555} +do_test pragma3-201 { set fd [open pragma3.txt wb] puts $fd { sqlite3 db test.db; @@ -113,18 +152,15 @@ do_test pragma3-200 { PRAGMA data_version; SELECT * FROM t1; } -} {6 101 201} +} {3 101 201} db2 close db close -# EVIDENCE-OF: R-10201-09349 The "PRAGMA data_version" command responses -# to changes committed by the same database connection, by database -# connections sharing a cache in shared cache mode, and by completely -# independent database connections including connections in separate -# threads and processes. +# EVIDENCE-OF: R-54562-06892 The behavior of "PRAGMA data_version" is +# the same for all database connections, including database connections +# in separate processes and shared cache database connections. # -# The next series of tests verifies the behavior for shared-cache -# database connections. +# The next block checks that behavior is the same for shared-cache. # ifcapable shared_cache { set ::enable_shared_cache [sqlite3_enable_shared_cache 1] @@ -133,24 +169,46 @@ ifcapable shared_cache { do_test pragma3-300 { db eval { PRAGMA data_version; + BEGIN; CREATE TABLE t3(a,b,c); + CREATE TABLE t4(x,y,z); + INSERT INTO t4 VALUES(123,456,789); + PRAGMA data_version; + COMMIT; PRAGMA data_version; } - } {1 2} + } {1 1 1} do_test pragma3-310 { db2 eval { PRAGMA data_version; + BEGIN; INSERT INTO t3(a,b,c) VALUES('abc','def','ghi'); SELECT * FROM t3; PRAGMA data_version; } - } {2 abc def ghi 3} + } {2 abc def ghi 2} + # The transaction in db2 has not yet committed, so the data_version in + # db is unchanged. do_test pragma3-320 { db eval { PRAGMA data_version; - SELECT * FROM t3; + SELECT * FROM t4; } - } {3 abc def ghi} + } {1 123 456 789} + do_test pragma3-330 { + db2 eval { + COMMIT; + PRAGMA data_version; + SELECT * FROM t4; + } + } {2 123 456 789} + do_test pragma3-340 { + db eval { + PRAGMA data_version; + SELECT * FROM t3; + SELECT * FROM t4; + } + } {2 abc def ghi 123 456 789} db2 close db close sqlite3_enable_shared_cache $::enable_shared_cache @@ -168,7 +226,7 @@ ifcapable wal { PRAGMA journal_mode; SELECT * FROM t1; } - } {3 wal 101 201} + } {2 wal 101 201} do_test pragma3-410 { db2 eval { PRAGMA data_version; @@ -178,7 +236,7 @@ ifcapable wal { } {2 wal 101 201} do_test pragma3-420 { db eval {UPDATE t1 SET a=111*(a/100); PRAGMA data_version; SELECT * FROM t1} - } {4 111 222} + } {2 111 222} do_test pragma3-430 { db2 eval {PRAGMA data_version; SELECT * FROM t1;} } {3 111 222} From 4a86d0016225d78abd3bb170c29d6e9ffbd0985e Mon Sep 17 00:00:00 2001 From: drh Date: Mon, 22 Dec 2014 22:02:20 +0000 Subject: [PATCH 08/54] Fix a typo in an evidence mark on a test script. No changes to code. FossilOrigin-Name: a08b0c7512287ce5ae3fffe02c092d0eb25b3a25 --- manifest | 12 ++++++------ manifest.uuid | 2 +- test/pragma3.test | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/manifest b/manifest index 8ae7e71d4a..545fed12be 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Redefine\sthe\sway\sPRAGMA\sdata_version\sworks:\s\sIt\scontinues\sto\schange\swhen\nany\sother\sconnection\scommits,\sincluding\sshared-cache\sconnections,\sbut\sdoes\snot\nchange\sif\sthe\slocal\sconnection\scommits. -D 2014-12-22T18:41:21.243 +C Fix\sa\stypo\sin\san\sevidence\smark\son\sa\stest\sscript.\s\sNo\schanges\sto\scode. +D 2014-12-22T22:02:20.146 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 6c4f961fa91d0b4fa121946a19f9e5eac2f2f809 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -785,7 +785,7 @@ F test/percentile.test b98fc868d71eb5619d42a1702e9ab91718cbed54 F test/permutations.test 4e12d43f4639ea8a0e366d9c64e0009afe2eb544 F test/pragma.test aa16dedfe01c02c8895169012f7dfde9c163f0d5 F test/pragma2.test aea7b3d82c76034a2df2b38a13745172ddc0bc13 -F test/pragma3.test 3da08d907ba027c50ede8d6e95418f32898971a5 +F test/pragma3.test 4f141da233358783ba443eb685e6739ce0eb1d90 F test/printf.test ec9870c4dce8686a37818e0bf1aba6e6a1863552 F test/printf2.test b4acd4bf8734243257f01ddefa17c4fb090acc8a F test/progress.test a282973d1d17f08071bc58a77d6b80f2a81c354d @@ -1234,7 +1234,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P ef4b734d1ff3dbb9c802c60dc1384033fdfd87e5 -R 717423e0d3aaa97f5eb5c0e7357ce13c +P 7a97826f33460f3b4f3890c9cf97116c3355eeda +R 75921305dcdb8922f71566b00cf9fa0c U drh -Z 78337e4052167193689952903ddb287b +Z 6c9fa3fa92317b5bccccc5c856a1593a diff --git a/manifest.uuid b/manifest.uuid index 327aa0952b..9504503c19 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -7a97826f33460f3b4f3890c9cf97116c3355eeda \ No newline at end of file +a08b0c7512287ce5ae3fffe02c092d0eb25b3a25 \ No newline at end of file diff --git a/test/pragma3.test b/test/pragma3.test index e6069f6e53..f3d531164b 100644 --- a/test/pragma3.test +++ b/test/pragma3.test @@ -32,8 +32,8 @@ do_execsql_test pragma3-102 { # EVIDENCE-OF: R-27726-60934 The "PRAGMA data_version" command provides # an indication that the database file has been modified. # -# EVIDENCE-OF: R-25838-33704 The "PRAGMA data_version" value is -# unchanced for commits made on the same database connection. +# EVIDENCE-OF: R-47505-58569 The "PRAGMA data_version" value is +# unchanged for commits made on the same database connection. # do_execsql_test pragma3-110 { PRAGMA data_version; From d477eee312abf8de89426949976fab10fbcb6e1e Mon Sep 17 00:00:00 2001 From: drh Date: Tue, 23 Dec 2014 19:40:51 +0000 Subject: [PATCH 09/54] Rework the test/releasetest.tcl script so that it uses the autoconf makefile instead of the test/releasetest.mk makefile. Also add options like --dryrun and --buildonly. Omit the --makefile option and replace it with --srcdir with the default computed relative to the releasetest.tcl script itself. FossilOrigin-Name: 7c85e831153f9aef2afaf981d53db38a28091be5 --- manifest | 16 ++-- manifest.uuid | 2 +- test/releasetest.mk | 14 ---- test/releasetest.tcl | 185 +++++++++++++++++++++++++------------------ 4 files changed, 118 insertions(+), 99 deletions(-) delete mode 100644 test/releasetest.mk diff --git a/manifest b/manifest index 545fed12be..63ed4c71f6 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Fix\sa\stypo\sin\san\sevidence\smark\son\sa\stest\sscript.\s\sNo\schanges\sto\scode. -D 2014-12-22T22:02:20.146 +C Rework\sthe\stest/releasetest.tcl\sscript\sso\sthat\sit\suses\sthe\sautoconf\smakefile\ninstead\sof\sthe\stest/releasetest.mk\smakefile.\s\sAlso\sadd\soptions\slike\s--dryrun\nand\s--buildonly.\s\sOmit\sthe\s--makefile\soption\sand\sreplace\sit\swith\s--srcdir\nwith\sthe\sdefault\scomputed\srelative\sto\sthe\sreleasetest.tcl\sscript\sitself. +D 2014-12-23T19:40:51.746 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 6c4f961fa91d0b4fa121946a19f9e5eac2f2f809 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -801,8 +801,7 @@ F test/randexpr1.test eda062a97e60f9c38ae8d806b03b0ddf23d796df F test/rdonly.test dd30a4858d8e0fbad2304c2bd74a33d4df36412a F test/regexp1.test 497ea812f264d12b6198d6e50a76be4a1973a9d8 F test/reindex.test 44edd3966b474468b823d481eafef0c305022254 -F test/releasetest.mk 2eced2f9ae701fd0a29e714a241760503ccba25a -F test/releasetest.tcl a4279c890698584feb2ffc86735857a4e4474180 +F test/releasetest.tcl b57a20ccc7aa64be8b52906d211b1ed4c0998cc2 F test/resolver01.test 33abf37ff8335e6bf98f2b45a0af3e06996ccd9a F test/rollback.test 458fe73eb3ffdfdf9f6ba3e9b7350a6220414dea F test/rollback2.test fc14cf6d1a2b250d2735ef16124b971bce152f14 @@ -1234,7 +1233,10 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 7a97826f33460f3b4f3890c9cf97116c3355eeda -R 75921305dcdb8922f71566b00cf9fa0c +P a08b0c7512287ce5ae3fffe02c092d0eb25b3a25 +R d1cf8fd2536e09346a06ad4dd6ebb5ea +T *branch * releasetest-refactor +T *sym-releasetest-refactor * +T -sym-trunk * U drh -Z 6c9fa3fa92317b5bccccc5c856a1593a +Z 1d662dddfc70aa251729f355b7103297 diff --git a/manifest.uuid b/manifest.uuid index 9504503c19..f2873c82b4 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -a08b0c7512287ce5ae3fffe02c092d0eb25b3a25 \ No newline at end of file +7c85e831153f9aef2afaf981d53db38a28091be5 \ No newline at end of file diff --git a/test/releasetest.mk b/test/releasetest.mk deleted file mode 100644 index 5d217c645b..0000000000 --- a/test/releasetest.mk +++ /dev/null @@ -1,14 +0,0 @@ -######################################################## -TOP=/home/drh/sqlite/sqlite - -TCL_FLAGS=-I/home/drh/tcltk/86linux -LIBTCL=/home/drh/tcltk/86linux/libtcl8.6.a -lm -ldl -lpthread - -BCC = gcc -TCC = gcc -ansi -g $(CFLAGS) -NAWK = awk -AR = ar cr -RANLIB = ranlib -THREADLIB = -lpthread -ldl -lz -include $(TOP)/main.mk -######################################################## diff --git a/test/releasetest.tcl b/test/releasetest.tcl index d2a1bd2bb0..fae7d3c8f6 100644 --- a/test/releasetest.tcl +++ b/test/releasetest.tcl @@ -1,6 +1,5 @@ - -set rcsid {$Id: $} - +#!/usr/bin/tclsh +# # Documentation for this script. This may be output to stderr # if the script is invoked incorrectly. See the [process_options] # proc below. @@ -10,51 +9,23 @@ This Tcl script is used to test the various configurations required before releasing a new version. Supported command line options (all optional) are: - -makefile PATH-TO-MAKEFILE (default "releasetest.mk") - -platform PLATFORM (see below) - -quick BOOLEAN (default "0") - -config CONFIGNAME (Run only CONFIGNAME) + --srcdir TOP-OF-SQLITE-TREE (see below) + --platform PLATFORM (see below) + --config CONFIGNAME (Run only CONFIGNAME) + --quick (Run "veryquick.test" only) + --buildonly (Just build testfixture - do not run) + --dryrun (Print what would have happened) + --info (Show diagnostic info) -The default value for -makefile is "./releasetest.mk". +The default value for --srcdir is the parent of the directory holding +this script. -The script determines the default value for -platform using the +The script determines the default value for --platform using the $tcl_platform(os) and $tcl_platform(machine) variables. Supported platforms are "Linux-x86", "Linux-x86_64" and "Darwin-i386". -If the -quick option is set to true, then the "veryquick.test" script -is run for all compilation configurations. Otherwise, sometimes "all.test" -is run, sometimes "veryquick.test". - -Almost any SQLite makefile (except those generated by configure - see below) -should work. The following properties are required: - - * The makefile should support the "fulltest" target. - * The makefile should support the variable "OPTS" as a way to pass - options from the make command line to lemon and the C compiler. - -More precisely, the following invocation must be supported: - - make -f $::MAKEFILE fulltest OPTS="-DSQLITE_SECURE_DELETE=1 -DSQLITE_DEBUG=1" - -Makefiles generated by the sqlite configure program cannot be used as -they do not respect the OPTS variable. - -Example Makefile contents: - - ######################################################## - TOP=/home/dan/work/sqlite/sqlite - - TCL_FLAGS=-I/home/dan/tcl/include - LIBTCL=-L/home/dan/tcl/lib -ltcl - - BCC = gcc - TCC = gcc -ansi -g $(CFLAGS) - NAWK = awk - AR = ar cr - RANLIB = ranlib - THREADLIB = -lpthread -ldl - include $(TOP)/main.mk - ######################################################## +Every test begins with a fresh run of the configure script at the top +of the SQLite source tree. } array set ::Configs { @@ -228,13 +199,12 @@ foreach {key value} [array get ::Platforms] { } proc run_test_suite {name testtarget config} { - # Tcl variable $opts is used to build up the value used to set the # OPTS Makefile variable. Variable $cflags holds the value for # CFLAGS. The makefile will pass OPTS to both gcc and lemon, but # CFLAGS is only passed to gcc. # - set cflags "" + set cflags "-g" set opts "" foreach arg $config { if {[string match -D* $arg]} { @@ -258,30 +228,46 @@ proc run_test_suite {name testtarget config} { append opts " -DSQLITE_OS_UNIX=1" } - # Run the test. - # - set makefile [file normalize $::MAKEFILE] - file mkdir $dir - puts -nonewline "Testing configuration \"$name\" (logfile=$dir/test.log)..." - flush stdout + dryrun file mkdir $dir + if {!$::DRYRUN} { + set n [string length $name] + puts -nonewline "${name}[string repeat . [expr {40-$n}]]" + flush stdout + } - set makecmd [concat \ - [list exec make -C $dir -f $makefile clean] \ - $testtarget \ - [list CFLAGS=$cflags OPTS=$opts >& $dir/test.log] \ - ] - - set tm1 [clock seconds] - set rc [catch $makecmd] + set tm1 [clock seconds] + set origdir [pwd] + dryrun cd $dir + set rc [catch [list dryrun exec $::SRCDIR/configure >& test.log]] + if {!$rc} { + set rc [catch [list dryrun exec make clean $testtarget \ + CFLAGS=$cflags OPTS=$opts >>& test.log]] + } set tm2 [clock seconds] + dryrun cd $origdir - set minutes [expr {($tm2-$tm1)/60}] - set seconds [expr {($tm2-$tm1)%60}] - puts -nonewline [format " (%d:%.2d) " $minutes $seconds] - if {$rc} { - puts "FAILED." + if {!$::DRYRUN} { + set minutes [expr {($tm2-$tm1)/60}] + set seconds [expr {($tm2-$tm1)%60}] + set tm [format (%02d:%02d) $minutes $seconds] + if {$rc} { + puts " FAIL $tm" + incr ::NERR + } else { + puts " Ok $tm" + } + } +} + +# The following procedure either prints its arguments (if ::DRYRUN is true) +# or executes the command of its arguments in the calling context +# (if ::DRYRUN is false). +# +proc dryrun {args} { + if {$::DRYRUN} { + puts $args } else { - puts "Ok." + uplevel 1 $args } } @@ -292,16 +278,21 @@ proc run_test_suite {name testtarget config} { # option. # proc process_options {argv} { - set ::MAKEFILE releasetest.mk ;# Default value - set ::QUICK 0 ;# Default value + set ::SRCDIR [file normalize [file dirname [file dirname $::argv0]]] + set ::QUICK 0 + set ::BUILDONLY 0 + set ::DRYRUN 0 + set ::EXEC exec set config {} set platform $::tcl_platform(os)-$::tcl_platform(machine) for {set i 0} {$i < [llength $argv]} {incr i} { - switch -- [lindex $argv $i] { - -makefile { + set x [lindex $argv $i] + if {[regexp {^--[a-z]} $x]} {set x [string range $x 1 end]} + switch -- $x { + -srcdir { incr i - set ::MAKEFILE [lindex $argv $i] + set ::SRCDIR [file normalize [lindex $argv $i]] } -platform { @@ -310,14 +301,40 @@ proc process_options {argv} { } -quick { - incr i - set ::QUICK [lindex $argv $i] + set ::QUICK 1 } -config { incr i set config [lindex $argv $i] } + + -buildonly { + set ::BUILDONLY 1 + } + + -dryrun { + set ::DRYRUN 1 + } + + -info { + puts "Command-line Options:" + puts " --srcdir $::SRCDIR" + puts " --platform [list $platform]" + puts " --config [list $config]" + if {$::QUICK} {puts " --quick"} + if {$::BUILDONLY} {puts " --buildonly"} + if {$::DRYRUN} {puts " --dryrun"} + puts "\nAvailable --platform options:" + foreach y [lsort [array names ::Platforms]] { + puts " [list $y]" + } + puts "\nAvailable --config options:" + foreach y [lsort [array names ::Configs]] { + puts " [list $y]" + } + exit + } default { puts stderr "" @@ -327,8 +344,6 @@ proc process_options {argv} { } } - set ::MAKEFILE [file normalize $::MAKEFILE] - if {0==[info exists ::Platforms($platform)]} { puts "Unknown platform: $platform" puts -nonewline "Set the -platform option to " @@ -347,8 +362,13 @@ proc process_options {argv} { } else { set ::CONFIGLIST $::Platforms($platform) } - puts "Running the following configurations for $platform:" + puts "Running the following test configurations for $platform:" puts " [string trim $::CONFIGLIST]" + puts -nonewline "Flags:" + if {$::DRYRUN} {puts -nonewline " --dryrun"} + if {$::BUILDONLY} {puts -nonewline " --buildonly"} + if {$::QUICK} {puts -nonewline " --quick"} + puts "" } # Main routine. @@ -357,30 +377,41 @@ proc main {argv} { # Process any command line options. process_options $argv + puts [string repeat * 70] + set NERR 0 + set NTEST 0 + set STARTTIME [clock seconds] foreach {zConfig target} $::CONFIGLIST { if {$::QUICK} {set target test} + if {$::BUILDONLY} {set target testfixture} set config_options $::Configs($zConfig) + incr NTEST run_test_suite $zConfig $target $config_options # If the configuration included the SQLITE_DEBUG option, then remove # it and run veryquick.test. If it did not include the SQLITE_DEBUG option # add it and run veryquick.test. - if {$target!="checksymbols"} { + if {$target!="checksymbols" && !$::BUILDONLY} { set debug_idx [lsearch -glob $config_options -DSQLITE_DEBUG*] if {$debug_idx < 0} { + incr NTEST run_test_suite "${zConfig}_debug" test [ concat $config_options -DSQLITE_DEBUG=1 ] } else { + incr NTEST run_test_suite "${zConfig}_ndebug" test [ lreplace $config_options $debug_idx $debug_idx ] } } - } + + set elapsetime [expr {[clock seconds]-$STARTTIME}] + puts [string repeat * 70] + puts "$NERR failures of $NTEST test suites run in $elapsetime seconds" } main $argv From 00fa334a0b698bb6fb197961d9312e05c67ae5f1 Mon Sep 17 00:00:00 2001 From: drh Date: Tue, 23 Dec 2014 19:52:26 +0000 Subject: [PATCH 10/54] Add the "checksymbols" target to Makefile.in FossilOrigin-Name: 5bd73dba5e278db81f7d728c75e3142c02d37ff7 --- Makefile.in | 7 +++++++ manifest | 15 ++++++--------- manifest.uuid | 2 +- 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/Makefile.in b/Makefile.in index 4929ce313c..db4c23b5bd 100644 --- a/Makefile.in +++ b/Makefile.in @@ -969,6 +969,13 @@ wordcount$(TEXE): $(TOP)/test/wordcount.c sqlite3.c speedtest1$(TEXE): $(TOP)/test/wordcount.c sqlite3.lo $(LTLINK) -o $@ $(TOP)/test/speedtest1.c sqlite3.lo $(TLIBS) +# This target will fail if the SQLite amalgamation contains any exported +# symbols that do not begin with "sqlite3_". It is run as part of the +# releasetest.tcl script. +# +checksymbols: sqlite3.o + nm -g --defined-only sqlite3.o | grep -v " sqlite3_" ; test $$? -ne 0 + # Standard install and cleanup targets # lib_install: libsqlite3.la diff --git a/manifest b/manifest index 63ed4c71f6..d608fa8851 100644 --- a/manifest +++ b/manifest @@ -1,7 +1,7 @@ -C Rework\sthe\stest/releasetest.tcl\sscript\sso\sthat\sit\suses\sthe\sautoconf\smakefile\ninstead\sof\sthe\stest/releasetest.mk\smakefile.\s\sAlso\sadd\soptions\slike\s--dryrun\nand\s--buildonly.\s\sOmit\sthe\s--makefile\soption\sand\sreplace\sit\swith\s--srcdir\nwith\sthe\sdefault\scomputed\srelative\sto\sthe\sreleasetest.tcl\sscript\sitself. -D 2014-12-23T19:40:51.746 +C Add\sthe\s"checksymbols"\starget\sto\sMakefile.in +D 2014-12-23T19:52:26.814 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f -F Makefile.in 6c4f961fa91d0b4fa121946a19f9e5eac2f2f809 +F Makefile.in 37aec21b4fbb469ba42985a4454adf424c84f8e4 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 F Makefile.msc b363b90fe1bfc3b87d190f2f728a126c00d9ce09 F Makefile.vxworks 034289efa9d591b04b1a73598623119c306cbba0 @@ -1233,10 +1233,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P a08b0c7512287ce5ae3fffe02c092d0eb25b3a25 -R d1cf8fd2536e09346a06ad4dd6ebb5ea -T *branch * releasetest-refactor -T *sym-releasetest-refactor * -T -sym-trunk * +P 7c85e831153f9aef2afaf981d53db38a28091be5 +R c05ea3aeb104c4afb51e4fdc443cf2a6 U drh -Z 1d662dddfc70aa251729f355b7103297 +Z 02c9f8fd295b123fa2397cb2b2094ed6 diff --git a/manifest.uuid b/manifest.uuid index f2873c82b4..47558f25fb 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -7c85e831153f9aef2afaf981d53db38a28091be5 \ No newline at end of file +5bd73dba5e278db81f7d728c75e3142c02d37ff7 \ No newline at end of file From e5d7bf1e4c0f20277b5d98227dcc8461919f7853 Mon Sep 17 00:00:00 2001 From: drh Date: Tue, 23 Dec 2014 20:05:19 +0000 Subject: [PATCH 11/54] Fix a potential segfault following OOM error in the test harness. The SQLite core itself is not at fault. FossilOrigin-Name: 1bb26695ff28a96d740752e327c2e0a0da1d067e --- manifest | 12 ++++++------ manifest.uuid | 2 +- src/test1.c | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/manifest b/manifest index 545fed12be..eb52499b91 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Fix\sa\stypo\sin\san\sevidence\smark\son\sa\stest\sscript.\s\sNo\schanges\sto\scode. -D 2014-12-22T22:02:20.146 +C Fix\sa\spotential\ssegfault\sfollowing\sOOM\serror\sin\sthe\stest\sharness.\s\sThe\nSQLite\score\sitself\sis\snot\sat\sfault. +D 2014-12-23T20:05:19.241 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 6c4f961fa91d0b4fa121946a19f9e5eac2f2f809 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -238,7 +238,7 @@ F src/sqliteLimit.h 164b0e6749d31e0daa1a4589a169d31c0dec7b3d F src/status.c 81712116e826b0089bb221b018929536b2b5406f F src/table.c e7a09215315a978057fb42c640f890160dbcc45e F src/tclsqlite.c c6a21c64da1490e14d53cdc2062d1e2e57942622 -F src/test1.c 56e33bf6b1827c6ca7520c189131ddd778fb2267 +F src/test1.c 041c4edf2f9c49a329add297e26ee86a83852f51 F src/test2.c 98049e51a17dc62606a99a9eb95ee477f9996712 F src/test3.c 1c0e5d6f080b8e33c1ce8b3078e7013fdbcd560c F src/test4.c 9b32d22f5f150abe23c1830e2057c4037c45b3df @@ -1234,7 +1234,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 7a97826f33460f3b4f3890c9cf97116c3355eeda -R 75921305dcdb8922f71566b00cf9fa0c +P a08b0c7512287ce5ae3fffe02c092d0eb25b3a25 +R 6f17c6ca29a22c9a696402dcec6c7766 U drh -Z 6c9fa3fa92317b5bccccc5c856a1593a +Z 3a6a677c416cfd077a0efd463f488c83 diff --git a/manifest.uuid b/manifest.uuid index 9504503c19..83787366b0 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -a08b0c7512287ce5ae3fffe02c092d0eb25b3a25 \ No newline at end of file +1bb26695ff28a96d740752e327c2e0a0da1d067e \ No newline at end of file diff --git a/src/test1.c b/src/test1.c index 40acac8360..032e3f338c 100644 --- a/src/test1.c +++ b/src/test1.c @@ -3670,7 +3670,7 @@ static int test_prepare_v2( assert(rc==SQLITE_OK || pStmt==0); Tcl_ResetResult(interp); if( sqlite3TestErrCode(interp, db, rc) ) return TCL_ERROR; - if( zTail && objc>=5 ){ + if( rc==SQLITE_OK && zTail && objc>=5 ){ if( bytes>=0 ){ bytes = bytes - (int)(zTail-zSql); } From 7284056ad665013f991eaa74e6c23bcd69bab68f Mon Sep 17 00:00:00 2001 From: mistachkin Date: Tue, 23 Dec 2014 20:22:57 +0000 Subject: [PATCH 12/54] Draft of changes necessary to make releasetest work on Windows via MinGW. FossilOrigin-Name: af166c5c64216d845269410d1ac2493310694b86 --- manifest | 14 +++++++------- manifest.uuid | 2 +- test/releasetest.tcl | 44 ++++++++++++++++++++++++++++++++++---------- 3 files changed, 42 insertions(+), 18 deletions(-) diff --git a/manifest b/manifest index d608fa8851..ac6be8ffcb 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Add\sthe\s"checksymbols"\starget\sto\sMakefile.in -D 2014-12-23T19:52:26.814 +C Draft\sof\schanges\snecessary\sto\smake\sreleasetest\swork\son\sWindows\svia\sMinGW. +D 2014-12-23T20:22:57.094 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 37aec21b4fbb469ba42985a4454adf424c84f8e4 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -801,7 +801,7 @@ F test/randexpr1.test eda062a97e60f9c38ae8d806b03b0ddf23d796df F test/rdonly.test dd30a4858d8e0fbad2304c2bd74a33d4df36412a F test/regexp1.test 497ea812f264d12b6198d6e50a76be4a1973a9d8 F test/reindex.test 44edd3966b474468b823d481eafef0c305022254 -F test/releasetest.tcl b57a20ccc7aa64be8b52906d211b1ed4c0998cc2 +F test/releasetest.tcl ed2f3293c318e0c80f6dfd099dde529f60e6d048 F test/resolver01.test 33abf37ff8335e6bf98f2b45a0af3e06996ccd9a F test/rollback.test 458fe73eb3ffdfdf9f6ba3e9b7350a6220414dea F test/rollback2.test fc14cf6d1a2b250d2735ef16124b971bce152f14 @@ -1233,7 +1233,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 7c85e831153f9aef2afaf981d53db38a28091be5 -R c05ea3aeb104c4afb51e4fdc443cf2a6 -U drh -Z 02c9f8fd295b123fa2397cb2b2094ed6 +P 5bd73dba5e278db81f7d728c75e3142c02d37ff7 +R 9f40447b09389fdd147e8f95f68f235c +U mistachkin +Z 2d56af309587de973049953da48ad3d0 diff --git a/manifest.uuid b/manifest.uuid index 47558f25fb..5a8726daed 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -5bd73dba5e278db81f7d728c75e3142c02d37ff7 \ No newline at end of file +af166c5c64216d845269410d1ac2493310694b86 \ No newline at end of file diff --git a/test/releasetest.tcl b/test/releasetest.tcl index fae7d3c8f6..e0738d9c4f 100644 --- a/test/releasetest.tcl +++ b/test/releasetest.tcl @@ -6,7 +6,7 @@ # set ::USAGE_MESSAGE { This Tcl script is used to test the various configurations required -before releasing a new version. Supported command line options (all +before releasing a new version. Supported command line options (all optional) are: --srcdir TOP-OF-SQLITE-TREE (see below) @@ -14,14 +14,14 @@ optional) are: --config CONFIGNAME (Run only CONFIGNAME) --quick (Run "veryquick.test" only) --buildonly (Just build testfixture - do not run) - --dryrun (Print what would have happened) + --dryrun (Print what would have happened) --info (Show diagnostic info) The default value for --srcdir is the parent of the directory holding this script. The script determines the default value for --platform using the -$tcl_platform(os) and $tcl_platform(machine) variables. Supported +$tcl_platform(os) and $tcl_platform(machine) variables. Supported platforms are "Linux-x86", "Linux-x86_64" and "Darwin-i386". Every test begins with a fresh run of the configure script at the top @@ -132,7 +132,7 @@ array set ::Configs { -DSQLITE_DEFAULT_CACHE_SIZE=1000 -DSQLITE_MAX_LENGTH=2147483645 -DSQLITE_MAX_VARIABLE_NUMBER=500000 - -DSQLITE_DEBUG=1 + -DSQLITE_DEBUG=1 -DSQLITE_PREFER_PROXY_LOCKING=1 } "Extra-Robustness" { @@ -182,6 +182,9 @@ array set ::Platforms { "Locking-Style" test "OS-X" "threadtest fulltest" } + "Windows NT-intel" { + "Default" "threadtest fulltest" + } } @@ -199,7 +202,7 @@ foreach {key value} [array get ::Platforms] { } proc run_test_suite {name testtarget config} { - # Tcl variable $opts is used to build up the value used to set the + # Tcl variable $opts is used to build up the value used to set the # OPTS Makefile variable. Variable $cflags holds the value for # CFLAGS. The makefile will pass OPTS to both gcc and lemon, but # CFLAGS is only passed to gcc. @@ -238,10 +241,9 @@ proc run_test_suite {name testtarget config} { set tm1 [clock seconds] set origdir [pwd] dryrun cd $dir - set rc [catch [list dryrun exec $::SRCDIR/configure >& test.log]] + set rc [catch [configureCommand]] if {!$rc} { - set rc [catch [list dryrun exec make clean $testtarget \ - CFLAGS=$cflags OPTS=$opts >>& test.log]] + set rc [catch [makeCommand $testtarget $cflags $opts]] } set tm2 [clock seconds] dryrun cd $origdir @@ -259,8 +261,30 @@ proc run_test_suite {name testtarget config} { } } +# The following procedure returns the "configure" command to be exectued for +# the current platform, which may be Windows (via MinGW, etc). +# +proc configureCommand {} { + set result [list dryrun exec] + if {$::tcl_platform(platform)=="windows"} { + lappend result sh + } + lappend result $::SRCDIR/configure >& test.log +} + +# The following procedure returns the "make" command to be executed for the +# specified targets, compiler flags, and options. +# +proc makeCommand { targets cflags opts } { + set result [list dryrun exec make clean] + foreach target $targets { + lappend result $target + } + lappend result CFLAGS=$cflags OPTS=$opts >>& test.log +} + # The following procedure either prints its arguments (if ::DRYRUN is true) -# or executes the command of its arguments in the calling context +# or executes the command of its arguments in the calling context # (if ::DRYRUN is false). # proc dryrun {args} { @@ -335,7 +359,7 @@ proc process_options {argv} { } exit } - + default { puts stderr "" puts stderr [string trim $::USAGE_MESSAGE] From 069b8f2cb3623b9b0905673433b1ada1325fbcb5 Mon Sep 17 00:00:00 2001 From: drh Date: Tue, 23 Dec 2014 20:31:43 +0000 Subject: [PATCH 13/54] Add the threadtest target to Makefile.in. Add --enable-load-extension to the configure issued by releasetest.tcl. FossilOrigin-Name: cb128067faabf0503dff1298ed29934f484f71bb --- Makefile.in | 17 +++++++++++++++++ manifest | 16 ++++++++-------- manifest.uuid | 2 +- test/releasetest.tcl | 2 +- 4 files changed, 27 insertions(+), 10 deletions(-) diff --git a/Makefile.in b/Makefile.in index db4c23b5bd..04305350be 100644 --- a/Makefile.in +++ b/Makefile.in @@ -976,6 +976,23 @@ speedtest1$(TEXE): $(TOP)/test/wordcount.c sqlite3.lo checksymbols: sqlite3.o nm -g --defined-only sqlite3.o | grep -v " sqlite3_" ; test $$? -ne 0 +# The next two rules are used to support the "threadtest" target. Building +# threadtest runs a few thread-safety tests that are implemented in C. This +# target is invoked by the releasetest.tcl script. +# +THREADTEST3_SRC = $(TOP)/test/threadtest3.c \ + $(TOP)/test/tt3_checkpoint.c \ + $(TOP)/test/tt3_index.c \ + $(TOP)/test/tt3_vacuum.c \ + $(TOP)/test/tt3_stress.c \ + $(TOP)/test/tt3_lookaside1.c + +threadtest3$(TEXE): sqlite3.o $(THREADTEST3_SRC) + $(LTLINK) $(TOP)/test/threadtest3.c sqlite3.o -o $@ $(TLIBS) + +threadtest: threadtest3$(TEXE) + ./threadtest3$(TEXE) + # Standard install and cleanup targets # lib_install: libsqlite3.la diff --git a/manifest b/manifest index ac6be8ffcb..36c6416518 100644 --- a/manifest +++ b/manifest @@ -1,7 +1,7 @@ -C Draft\sof\schanges\snecessary\sto\smake\sreleasetest\swork\son\sWindows\svia\sMinGW. -D 2014-12-23T20:22:57.094 +C Add\sthe\sthreadtest\starget\sto\sMakefile.in.\s\sAdd\s--enable-load-extension\sto\nthe\sconfigure\sissued\sby\sreleasetest.tcl. +D 2014-12-23T20:31:43.428 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f -F Makefile.in 37aec21b4fbb469ba42985a4454adf424c84f8e4 +F Makefile.in c5bad35715abe0ffcb6a11fbafb157de7405d51a F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 F Makefile.msc b363b90fe1bfc3b87d190f2f728a126c00d9ce09 F Makefile.vxworks 034289efa9d591b04b1a73598623119c306cbba0 @@ -801,7 +801,7 @@ F test/randexpr1.test eda062a97e60f9c38ae8d806b03b0ddf23d796df F test/rdonly.test dd30a4858d8e0fbad2304c2bd74a33d4df36412a F test/regexp1.test 497ea812f264d12b6198d6e50a76be4a1973a9d8 F test/reindex.test 44edd3966b474468b823d481eafef0c305022254 -F test/releasetest.tcl ed2f3293c318e0c80f6dfd099dde529f60e6d048 +F test/releasetest.tcl 8563ba7df4b8cb9a9ee9ccd042f14f0553e62f63 F test/resolver01.test 33abf37ff8335e6bf98f2b45a0af3e06996ccd9a F test/rollback.test 458fe73eb3ffdfdf9f6ba3e9b7350a6220414dea F test/rollback2.test fc14cf6d1a2b250d2735ef16124b971bce152f14 @@ -1233,7 +1233,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 5bd73dba5e278db81f7d728c75e3142c02d37ff7 -R 9f40447b09389fdd147e8f95f68f235c -U mistachkin -Z 2d56af309587de973049953da48ad3d0 +P af166c5c64216d845269410d1ac2493310694b86 +R 84b62c16990cff93a3eab955a0ae7d8d +U drh +Z 40c138478ca76e8e420aceec7c5661be diff --git a/manifest.uuid b/manifest.uuid index 5a8726daed..5424c8d2ee 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -af166c5c64216d845269410d1ac2493310694b86 \ No newline at end of file +cb128067faabf0503dff1298ed29934f484f71bb \ No newline at end of file diff --git a/test/releasetest.tcl b/test/releasetest.tcl index e0738d9c4f..f7aef83c1c 100644 --- a/test/releasetest.tcl +++ b/test/releasetest.tcl @@ -269,7 +269,7 @@ proc configureCommand {} { if {$::tcl_platform(platform)=="windows"} { lappend result sh } - lappend result $::SRCDIR/configure >& test.log + lappend result $::SRCDIR/configure -enable-load-extension >& test.log } # The following procedure returns the "make" command to be executed for the From e43ff920ceeac2fb2c2127e639cbde892d7033bf Mon Sep 17 00:00:00 2001 From: drh Date: Tue, 23 Dec 2014 20:41:13 +0000 Subject: [PATCH 14/54] In the releasetest.tcl script, show the test target for each configuration that is run. And show the time in HH:MM:SS. FossilOrigin-Name: 2295e9e0a22220ccb1b9cc2b031c1d8e702a1888 --- manifest | 12 ++++++------ manifest.uuid | 2 +- test/releasetest.tcl | 10 ++++++---- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/manifest b/manifest index 36c6416518..e882294d9d 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Add\sthe\sthreadtest\starget\sto\sMakefile.in.\s\sAdd\s--enable-load-extension\sto\nthe\sconfigure\sissued\sby\sreleasetest.tcl. -D 2014-12-23T20:31:43.428 +C In\sthe\sreleasetest.tcl\sscript,\sshow\sthe\stest\starget\sfor\seach\sconfiguration\nthat\sis\srun.\s\sAnd\sshow\sthe\stime\sin\sHH:MM:SS. +D 2014-12-23T20:41:13.506 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in c5bad35715abe0ffcb6a11fbafb157de7405d51a F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -801,7 +801,7 @@ F test/randexpr1.test eda062a97e60f9c38ae8d806b03b0ddf23d796df F test/rdonly.test dd30a4858d8e0fbad2304c2bd74a33d4df36412a F test/regexp1.test 497ea812f264d12b6198d6e50a76be4a1973a9d8 F test/reindex.test 44edd3966b474468b823d481eafef0c305022254 -F test/releasetest.tcl 8563ba7df4b8cb9a9ee9ccd042f14f0553e62f63 +F test/releasetest.tcl 84b224e46e8d31c26591518ff91daf88c602decb F test/resolver01.test 33abf37ff8335e6bf98f2b45a0af3e06996ccd9a F test/rollback.test 458fe73eb3ffdfdf9f6ba3e9b7350a6220414dea F test/rollback2.test fc14cf6d1a2b250d2735ef16124b971bce152f14 @@ -1233,7 +1233,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P af166c5c64216d845269410d1ac2493310694b86 -R 84b62c16990cff93a3eab955a0ae7d8d +P cb128067faabf0503dff1298ed29934f484f71bb +R e47d011ee548c05856b81e40855ed9d3 U drh -Z 40c138478ca76e8e420aceec7c5661be +Z 930cf73b25702ad0596e5aa07bf5b1dd diff --git a/manifest.uuid b/manifest.uuid index 5424c8d2ee..8208554d56 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -cb128067faabf0503dff1298ed29934f484f71bb \ No newline at end of file +2295e9e0a22220ccb1b9cc2b031c1d8e702a1888 \ No newline at end of file diff --git a/test/releasetest.tcl b/test/releasetest.tcl index f7aef83c1c..b7090143cc 100644 --- a/test/releasetest.tcl +++ b/test/releasetest.tcl @@ -233,8 +233,9 @@ proc run_test_suite {name testtarget config} { dryrun file mkdir $dir if {!$::DRYRUN} { - set n [string length $name] - puts -nonewline "${name}[string repeat . [expr {40-$n}]]" + set title ${name}($testtarget) + set n [string length $title] + puts -nonewline "${title}[string repeat . [expr {54-$n}]]" flush stdout } @@ -249,9 +250,10 @@ proc run_test_suite {name testtarget config} { dryrun cd $origdir if {!$::DRYRUN} { - set minutes [expr {($tm2-$tm1)/60}] + set hours [expr {($tm2-$tm2)/3600}] + set minutes [expr {(($tm2-$tm1)/60)%60}] set seconds [expr {($tm2-$tm1)%60}] - set tm [format (%02d:%02d) $minutes $seconds] + set tm [format (%02d:%02d:%02d) $hours $minutes $seconds] if {$rc} { puts " FAIL $tm" incr ::NERR From 054450f0bdc3bdae1da45281d96659a60aaebac8 Mon Sep 17 00:00:00 2001 From: mistachkin Date: Tue, 23 Dec 2014 20:42:48 +0000 Subject: [PATCH 15/54] Permit sqlite3_shutdown() to be called with OMIT_WSD enabled and without having called sqlite3_initialize() first. FossilOrigin-Name: 3f7dbdb5df38bd4b8cd49d22a23b8412b8d506e5 --- manifest | 14 +++++++------- manifest.uuid | 2 +- src/main.c | 7 +++++++ 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/manifest b/manifest index eb52499b91..46ba432235 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Fix\sa\spotential\ssegfault\sfollowing\sOOM\serror\sin\sthe\stest\sharness.\s\sThe\nSQLite\score\sitself\sis\snot\sat\sfault. -D 2014-12-23T20:05:19.241 +C Permit\ssqlite3_shutdown()\sto\sbe\scalled\swith\sOMIT_WSD\senabled\sand\swithout\shaving\scalled\ssqlite3_initialize()\sfirst. +D 2014-12-23T20:42:48.779 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 6c4f961fa91d0b4fa121946a19f9e5eac2f2f809 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -195,7 +195,7 @@ F src/journal.c b4124532212b6952f42eb2c12fa3c25701d8ba8d F src/legacy.c ba1863ea58c4c840335a84ec276fc2b25e22bc4e F src/lempar.c 7274c97d24bb46631e504332ccd3bd1b37841770 F src/loadext.c 86bd4e2fccd520b748cba52492ab60c4a770f660 -F src/main.c ee498c89735ba7b581fbd58d2ad2e7679a0475b2 +F src/main.c 784f3d613f08d8bfba238a5baa7398770a641de2 F src/malloc.c 740db54387204c9a2eb67c6d98e68b08e9ef4eab F src/mem0.c 6a55ebe57c46ca1a7d98da93aaa07f99f1059645 F src/mem1.c faf615aafd8be74a71494dfa027c113ea5c6615f @@ -1234,7 +1234,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P a08b0c7512287ce5ae3fffe02c092d0eb25b3a25 -R 6f17c6ca29a22c9a696402dcec6c7766 -U drh -Z 3a6a677c416cfd077a0efd463f488c83 +P 1bb26695ff28a96d740752e327c2e0a0da1d067e +R 69846a8eed33bdc4ac13d4f2cdf5a199 +U mistachkin +Z c9331cbf8b5ecd4eca34d95e3015ec1f diff --git a/manifest.uuid b/manifest.uuid index 83787366b0..5e20eb47ce 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -1bb26695ff28a96d740752e327c2e0a0da1d067e \ No newline at end of file +3f7dbdb5df38bd4b8cd49d22a23b8412b8d506e5 \ No newline at end of file diff --git a/src/main.c b/src/main.c index 76af9a2e95..16e9a1babb 100644 --- a/src/main.c +++ b/src/main.c @@ -271,6 +271,13 @@ int sqlite3_initialize(void){ ** when this routine is invoked, then this routine is a harmless no-op. */ int sqlite3_shutdown(void){ +#ifdef SQLITE_OMIT_WSD + int rc = sqlite3_wsd_init(4096, 24); + if( rc!=SQLITE_OK ){ + return rc; + } +#endif + if( sqlite3GlobalConfig.isInit ){ #ifdef SQLITE_EXTRA_SHUTDOWN void SQLITE_EXTRA_SHUTDOWN(void); From 4d03a381f82dd43250686939d88501fbafefedf9 Mon Sep 17 00:00:00 2001 From: mistachkin Date: Tue, 23 Dec 2014 21:03:09 +0000 Subject: [PATCH 16/54] Fix typo in library object file name. FossilOrigin-Name: f49566a79d05e630a86ea7b2acc04672d76d6337 --- Makefile.in | 8 ++++---- manifest | 14 +++++++------- manifest.uuid | 2 +- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Makefile.in b/Makefile.in index 04305350be..6a944fdded 100644 --- a/Makefile.in +++ b/Makefile.in @@ -973,8 +973,8 @@ speedtest1$(TEXE): $(TOP)/test/wordcount.c sqlite3.lo # symbols that do not begin with "sqlite3_". It is run as part of the # releasetest.tcl script. # -checksymbols: sqlite3.o - nm -g --defined-only sqlite3.o | grep -v " sqlite3_" ; test $$? -ne 0 +checksymbols: sqlite3.lo + nm -g --defined-only sqlite3.lo | grep -v " sqlite3_" ; test $$? -ne 0 # The next two rules are used to support the "threadtest" target. Building # threadtest runs a few thread-safety tests that are implemented in C. This @@ -987,8 +987,8 @@ THREADTEST3_SRC = $(TOP)/test/threadtest3.c \ $(TOP)/test/tt3_stress.c \ $(TOP)/test/tt3_lookaside1.c -threadtest3$(TEXE): sqlite3.o $(THREADTEST3_SRC) - $(LTLINK) $(TOP)/test/threadtest3.c sqlite3.o -o $@ $(TLIBS) +threadtest3$(TEXE): sqlite3.lo $(THREADTEST3_SRC) + $(LTLINK) $(TOP)/test/threadtest3.c sqlite3.lo -o $@ $(TLIBS) threadtest: threadtest3$(TEXE) ./threadtest3$(TEXE) diff --git a/manifest b/manifest index e882294d9d..90187d60b9 100644 --- a/manifest +++ b/manifest @@ -1,7 +1,7 @@ -C In\sthe\sreleasetest.tcl\sscript,\sshow\sthe\stest\starget\sfor\seach\sconfiguration\nthat\sis\srun.\s\sAnd\sshow\sthe\stime\sin\sHH:MM:SS. -D 2014-12-23T20:41:13.506 +C Fix\stypo\sin\slibrary\sobject\sfile\sname. +D 2014-12-23T21:03:09.146 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f -F Makefile.in c5bad35715abe0ffcb6a11fbafb157de7405d51a +F Makefile.in 9aaaaf6b5b0e4b42aa909db5165dc042db9bfcd5 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 F Makefile.msc b363b90fe1bfc3b87d190f2f728a126c00d9ce09 F Makefile.vxworks 034289efa9d591b04b1a73598623119c306cbba0 @@ -1233,7 +1233,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P cb128067faabf0503dff1298ed29934f484f71bb -R e47d011ee548c05856b81e40855ed9d3 -U drh -Z 930cf73b25702ad0596e5aa07bf5b1dd +P 2295e9e0a22220ccb1b9cc2b031c1d8e702a1888 +R a6e41f52bbcb02764e8ea99c7fc0d456 +U mistachkin +Z 6ab7423cea251d6a6862aa20cc19aa93 diff --git a/manifest.uuid b/manifest.uuid index 8208554d56..60a6c38f0f 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -2295e9e0a22220ccb1b9cc2b031c1d8e702a1888 \ No newline at end of file +f49566a79d05e630a86ea7b2acc04672d76d6337 \ No newline at end of file From 29f98f307764438cef900bfe76b74c2aedab102a Mon Sep 17 00:00:00 2001 From: mistachkin Date: Tue, 23 Dec 2014 21:10:38 +0000 Subject: [PATCH 17/54] Remove 'threadtest' as a target on Windows, due to lack of pthreads. Also, change 'fulltest' to 'fulltestonly'. FossilOrigin-Name: a010c404b5140104b68087dcbb0698b7a85eef65 --- manifest | 12 ++++++------ manifest.uuid | 2 +- test/releasetest.tcl | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/manifest b/manifest index 90187d60b9..89f8b08461 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Fix\stypo\sin\slibrary\sobject\sfile\sname. -D 2014-12-23T21:03:09.146 +C Remove\s'threadtest'\sas\sa\starget\son\sWindows,\sdue\sto\slack\sof\spthreads.\s\sAlso,\schange\s'fulltest'\sto\s'fulltestonly'. +D 2014-12-23T21:10:38.485 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 9aaaaf6b5b0e4b42aa909db5165dc042db9bfcd5 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -801,7 +801,7 @@ F test/randexpr1.test eda062a97e60f9c38ae8d806b03b0ddf23d796df F test/rdonly.test dd30a4858d8e0fbad2304c2bd74a33d4df36412a F test/regexp1.test 497ea812f264d12b6198d6e50a76be4a1973a9d8 F test/reindex.test 44edd3966b474468b823d481eafef0c305022254 -F test/releasetest.tcl 84b224e46e8d31c26591518ff91daf88c602decb +F test/releasetest.tcl ba6e760aed00b829bd0718d61d9e605d56b0bd8d F test/resolver01.test 33abf37ff8335e6bf98f2b45a0af3e06996ccd9a F test/rollback.test 458fe73eb3ffdfdf9f6ba3e9b7350a6220414dea F test/rollback2.test fc14cf6d1a2b250d2735ef16124b971bce152f14 @@ -1233,7 +1233,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 2295e9e0a22220ccb1b9cc2b031c1d8e702a1888 -R a6e41f52bbcb02764e8ea99c7fc0d456 +P f49566a79d05e630a86ea7b2acc04672d76d6337 +R 333eb3cbf92231ab2930505109652a4c U mistachkin -Z 6ab7423cea251d6a6862aa20cc19aa93 +Z 00b07e8b2b9d92ea23f97a4876d4552f diff --git a/manifest.uuid b/manifest.uuid index 60a6c38f0f..89f5792bcc 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -f49566a79d05e630a86ea7b2acc04672d76d6337 \ No newline at end of file +a010c404b5140104b68087dcbb0698b7a85eef65 \ No newline at end of file diff --git a/test/releasetest.tcl b/test/releasetest.tcl index b7090143cc..2459422c5e 100644 --- a/test/releasetest.tcl +++ b/test/releasetest.tcl @@ -183,7 +183,7 @@ array set ::Platforms { "OS-X" "threadtest fulltest" } "Windows NT-intel" { - "Default" "threadtest fulltest" + "Default" "fulltestonly" } } From 8038953c15707754a842ce4f1e9b8bc9d69ce58d Mon Sep 17 00:00:00 2001 From: dan Date: Wed, 24 Dec 2014 17:17:30 +0000 Subject: [PATCH 18/54] When building the amalgamation with SQLITE_ENABLE_IOTRACE defined, do not mark symbol sqlite3IoTrace as static. FossilOrigin-Name: 5b7ca013b7171a6807b15b128e140ce160f526d3 --- manifest | 17 ++++++++--------- manifest.uuid | 2 +- src/main.c | 2 +- tool/mksqlite3c.tcl | 2 +- 4 files changed, 11 insertions(+), 12 deletions(-) diff --git a/manifest b/manifest index 7175c91a50..cb39ca6035 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Merge\sthe\snew\sand\simproved\sreleasetest.tcl\sscript\sinto\strunk.\s\sAdd\sa\n"make\sreleasetest"\starget\sto\sthe\sautoconf\smakefile. -D 2014-12-23T21:17:58.595 +C When\sbuilding\sthe\samalgamation\swith\sSQLITE_ENABLE_IOTRACE\sdefined,\sdo\snot\smark\ssymbol\ssqlite3IoTrace\sas\sstatic. +D 2014-12-24T17:17:30.707 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in c20e37499a3d664a3732257ed042352eba777a4d F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -195,7 +195,7 @@ F src/journal.c b4124532212b6952f42eb2c12fa3c25701d8ba8d F src/legacy.c ba1863ea58c4c840335a84ec276fc2b25e22bc4e F src/lempar.c 7274c97d24bb46631e504332ccd3bd1b37841770 F src/loadext.c 86bd4e2fccd520b748cba52492ab60c4a770f660 -F src/main.c 784f3d613f08d8bfba238a5baa7398770a641de2 +F src/main.c fa2128ef7d6a3dcd6770b2b1f3c284b696f11a2a F src/malloc.c 740db54387204c9a2eb67c6d98e68b08e9ef4eab F src/mem0.c 6a55ebe57c46ca1a7d98da93aaa07f99f1059645 F src/mem1.c faf615aafd8be74a71494dfa027c113ea5c6615f @@ -1200,7 +1200,7 @@ F tool/mkopts.tcl 66ac10d240cc6e86abd37dc908d50382f84ff46e F tool/mkpragmatab.tcl 07a5124cf2dbafa1b375eefcf8ac4227028b0f8b F tool/mkspeedsql.tcl a1a334d288f7adfe6e996f2e712becf076745c97 F tool/mksqlite3c-noext.tcl 88a1e3b0c769773fb7a9ebb363ffc603a4ac21d8 -F tool/mksqlite3c.tcl e72c0c97fe1a105fa9616483e652949be2199fe6 +F tool/mksqlite3c.tcl e94bdc37b531bba50d421e82efbe3738d0c1e950 F tool/mksqlite3h.tcl ba24038056f51fde07c0079c41885ab85e2cff12 F tool/mksqlite3internalh.tcl b6514145a7d5321b47e64e19b8116cc44f973eb1 F tool/mkvsix.tcl 52a4c613707ac34ae9c226e5ccc69cb948556105 @@ -1233,8 +1233,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 3f7dbdb5df38bd4b8cd49d22a23b8412b8d506e5 a010c404b5140104b68087dcbb0698b7a85eef65 -R c03b15cfdf1585f3588eb5fb232886aa -T +closed a010c404b5140104b68087dcbb0698b7a85eef65 -U drh -Z 23d8a858cc383cd4bc2fa2df9f7a8bc3 +P 1deb00ec758c6d213da71ef64294cc816e204338 +R 94b7be58e117bbe257a3aeec77eff05b +U dan +Z 725f19b25ac60ae68e0c4f9942138bfa diff --git a/manifest.uuid b/manifest.uuid index 9aa2bbe3dc..0b171fb5d1 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -1deb00ec758c6d213da71ef64294cc816e204338 \ No newline at end of file +5b7ca013b7171a6807b15b128e140ce160f526d3 \ No newline at end of file diff --git a/src/main.c b/src/main.c index 16e9a1babb..3220cfe8f6 100644 --- a/src/main.c +++ b/src/main.c @@ -62,7 +62,7 @@ int sqlite3_threadsafe(void){ return SQLITE_THREADSAFE; } ** I/O active are written using this function. These messages ** are intended for debugging activity only. */ -void (*sqlite3IoTrace)(const char*, ...) = 0; +/* not-private */ void (*sqlite3IoTrace)(const char*, ...) = 0; #endif /* diff --git a/tool/mksqlite3c.tcl b/tool/mksqlite3c.tcl index 0e979234f3..72098c7357 100644 --- a/tool/mksqlite3c.tcl +++ b/tool/mksqlite3c.tcl @@ -212,7 +212,7 @@ proc copy_file {filename} { } } elseif {[regexp {^(SQLITE_EXTERN )?void \(\*sqlite3IoTrace\)} $line]} { regsub {^SQLITE_EXTERN } $line {} line - puts $out "SQLITE_PRIVATE $line" + puts $out $line } elseif {[regexp {^void \(\*sqlite3Os} $line]} { puts $out "SQLITE_PRIVATE $line" } else { From ee7172f12ad51ee528da22fa5ea72073c23dd5f4 Mon Sep 17 00:00:00 2001 From: dan Date: Wed, 24 Dec 2014 18:11:50 +0000 Subject: [PATCH 19/54] Fix a failing assert() in balance_nonroot(). FossilOrigin-Name: e2e323145f66cca31babe1a979db6ef97038b879 --- manifest | 12 ++++++------ manifest.uuid | 2 +- src/btree.c | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/manifest b/manifest index cb39ca6035..d97e03238b 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C When\sbuilding\sthe\samalgamation\swith\sSQLITE_ENABLE_IOTRACE\sdefined,\sdo\snot\smark\ssymbol\ssqlite3IoTrace\sas\sstatic. -D 2014-12-24T17:17:30.707 +C Fix\sa\sfailing\sassert()\sin\sbalance_nonroot(). +D 2014-12-24T18:11:50.466 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in c20e37499a3d664a3732257ed042352eba777a4d F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -173,7 +173,7 @@ F src/auth.c b56c78ebe40a2110fd361379f7e8162d23f92240 F src/backup.c 7ddee9c7d505e07e959a575b18498f17c71e53ea F src/bitvec.c 19a4ba637bd85f8f63fc8c9bae5ade9fb05ec1cb F src/btmutex.c 49ca66250c7dfa844a4d4cb8272b87420d27d3a5 -F src/btree.c 1de0560426ecde85ff3ea95d7c94261d7652e284 +F src/btree.c 904d30478685fe0723ad9092fc800a655544c69a F src/btree.h 94277c1d30c0b75705974bcc8b0c05e79c03d474 F src/btreeInt.h a3d0ae1d511365e1a2b76ad10960dbe55c286f34 F src/build.c 162d84e4833b03f9d07192ef06057b0226f6e543 @@ -1233,7 +1233,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 1deb00ec758c6d213da71ef64294cc816e204338 -R 94b7be58e117bbe257a3aeec77eff05b +P 5b7ca013b7171a6807b15b128e140ce160f526d3 +R b11f421779b35c3a19d382d5b3ba189c U dan -Z 725f19b25ac60ae68e0c4f9942138bfa +Z 0b37a721b79ad0d2f596c72e79efffa8 diff --git a/manifest.uuid b/manifest.uuid index 0b171fb5d1..8989984104 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -5b7ca013b7171a6807b15b128e140ce160f526d3 \ No newline at end of file +e2e323145f66cca31babe1a979db6ef97038b879 \ No newline at end of file diff --git a/src/btree.c b/src/btree.c index e6a7e2c2b9..0554f3fa3c 100644 --- a/src/btree.c +++ b/src/btree.c @@ -6865,8 +6865,8 @@ static int balance_nonroot( /* Do not allow any cells smaller than 4 bytes. If a smaller cell ** does exist, pad it with 0x00 bytes. */ assert( szCell[nCell]==3 ); - assert( apCell[nCell]==&pTemp[iSpace1-3] ); - pTemp[iSpace1++] = 0x00; + assert( apCell[nCell]==&aSpace1[iSpace1-3] ); + aSpace1[iSpace1++] = 0x00; szCell[nCell] = 4; } } From 97876ee666274615c4034cc3658a52b976aa2493 Mon Sep 17 00:00:00 2001 From: drh Date: Wed, 24 Dec 2014 23:35:36 +0000 Subject: [PATCH 20/54] Fix the error counter in releasetest.tcl. And report the total time in HH:MM:SS instead of just seconds. FossilOrigin-Name: 6396f8046242286298fecd1748a6e8e786e6794e --- manifest | 14 +++++++------- manifest.uuid | 2 +- test/releasetest.tcl | 10 +++++++--- 3 files changed, 15 insertions(+), 11 deletions(-) diff --git a/manifest b/manifest index d97e03238b..f5b01362a2 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Fix\sa\sfailing\sassert()\sin\sbalance_nonroot(). -D 2014-12-24T18:11:50.466 +C Fix\sthe\serror\scounter\sin\sreleasetest.tcl.\s\sAnd\sreport\sthe\stotal\stime\sin\nHH:MM:SS\sinstead\sof\sjust\sseconds. +D 2014-12-24T23:35:36.745 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in c20e37499a3d664a3732257ed042352eba777a4d F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -801,7 +801,7 @@ F test/randexpr1.test eda062a97e60f9c38ae8d806b03b0ddf23d796df F test/rdonly.test dd30a4858d8e0fbad2304c2bd74a33d4df36412a F test/regexp1.test 497ea812f264d12b6198d6e50a76be4a1973a9d8 F test/reindex.test 44edd3966b474468b823d481eafef0c305022254 -F test/releasetest.tcl ba6e760aed00b829bd0718d61d9e605d56b0bd8d +F test/releasetest.tcl 80d10f058667e6d0c8ab379d6e5bb0a60ecb40e2 F test/resolver01.test 33abf37ff8335e6bf98f2b45a0af3e06996ccd9a F test/rollback.test 458fe73eb3ffdfdf9f6ba3e9b7350a6220414dea F test/rollback2.test fc14cf6d1a2b250d2735ef16124b971bce152f14 @@ -1233,7 +1233,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 5b7ca013b7171a6807b15b128e140ce160f526d3 -R b11f421779b35c3a19d382d5b3ba189c -U dan -Z 0b37a721b79ad0d2f596c72e79efffa8 +P e2e323145f66cca31babe1a979db6ef97038b879 +R 5d68ae4c7a1de514625f0040c5883c44 +U drh +Z 5948198e5a17f619d6c7388ef4763f03 diff --git a/manifest.uuid b/manifest.uuid index 8989984104..70b92936b1 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -e2e323145f66cca31babe1a979db6ef97038b879 \ No newline at end of file +6396f8046242286298fecd1748a6e8e786e6794e \ No newline at end of file diff --git a/test/releasetest.tcl b/test/releasetest.tcl index 2459422c5e..879b7f8fb9 100644 --- a/test/releasetest.tcl +++ b/test/releasetest.tcl @@ -405,8 +405,8 @@ proc main {argv} { process_options $argv puts [string repeat * 70] - set NERR 0 - set NTEST 0 + set ::NERR 0 + set ::NTEST 0 set STARTTIME [clock seconds] foreach {zConfig target} $::CONFIGLIST { if {$::QUICK} {set target test} @@ -436,8 +436,12 @@ proc main {argv} { } set elapsetime [expr {[clock seconds]-$STARTTIME}] + set hr [expr {$elapsetime/3600}] + set min [expr {($elapsetime/60)%60}] + set sec [expr {$elapsetime%60}] + set etime [format (%02d:%02d:%02d) $hr $min $sec] puts [string repeat * 70] - puts "$NERR failures of $NTEST test suites run in $elapsetime seconds" + puts "$::NERR failures of $::NTEST test suites run in $etime" } main $argv From 0ab0e05c6b3b5eee7f16bd76f8a59f397449c4d8 Mon Sep 17 00:00:00 2001 From: drh Date: Thu, 25 Dec 2014 12:19:56 +0000 Subject: [PATCH 21/54] Update the SQLITE_CONFIG_PAGECACHE documentation so that the maximum page size is correctly stated to be 65536. FossilOrigin-Name: 3286424b4d30035de69b88ef0b2897365ff848f9 --- manifest | 12 ++++++------ manifest.uuid | 2 +- src/sqlite.h.in | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/manifest b/manifest index f5b01362a2..50e33c046d 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Fix\sthe\serror\scounter\sin\sreleasetest.tcl.\s\sAnd\sreport\sthe\stotal\stime\sin\nHH:MM:SS\sinstead\sof\sjust\sseconds. -D 2014-12-24T23:35:36.745 +C Update\sthe\sSQLITE_CONFIG_PAGECACHE\sdocumentation\sso\sthat\sthe\smaximum\spage\nsize\sis\scorrectly\sstated\sto\sbe\s65536. +D 2014-12-25T12:19:56.744 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in c20e37499a3d664a3732257ed042352eba777a4d F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -230,7 +230,7 @@ F src/resolve.c f6c46d3434439ab2084618d603e6d6dbeb0d6ada F src/rowset.c eccf6af6d620aaa4579bd3b72c1b6395d9e9fa1e F src/select.c f377fb8a5c73c10678ea74f3400f7913943e3d75 F src/shell.c 45d9c9bd7cde07845af957f2d849933b990773cf -F src/sqlite.h.in 116dc731361549ee3fc79dcebace11b57d24dcfd +F src/sqlite.h.in 47cb601ed2b2ea7f01119e2763185c809d8e82fa F src/sqlite3.rc 992c9f5fb8285ae285d6be28240a7e8d3a7f2bad F src/sqlite3ext.h 17d487c3c91b0b8c584a32fbeb393f6f795eea7d F src/sqliteInt.h d36da9a07130cae13cbfee0986bf20028cb01465 @@ -1233,7 +1233,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P e2e323145f66cca31babe1a979db6ef97038b879 -R 5d68ae4c7a1de514625f0040c5883c44 +P 6396f8046242286298fecd1748a6e8e786e6794e +R 6fef442856f5d39a46d82b3795b528e7 U drh -Z 5948198e5a17f619d6c7388ef4763f03 +Z 07073e8eb87986ae3ece689929973238 diff --git a/manifest.uuid b/manifest.uuid index 70b92936b1..e53bf043df 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -6396f8046242286298fecd1748a6e8e786e6794e \ No newline at end of file +3286424b4d30035de69b88ef0b2897365ff848f9 \ No newline at end of file diff --git a/src/sqlite.h.in b/src/sqlite.h.in index 701e6de2e3..b525b396f4 100644 --- a/src/sqlite.h.in +++ b/src/sqlite.h.in @@ -1565,7 +1565,7 @@ struct sqlite3_mem_methods { ** 8-byte aligned ** memory, the size of each page buffer (sz), and the number of pages (N). ** The sz argument should be the size of the largest database page -** (a power of two between 512 and 32768) plus some extra bytes for each +** (a power of two between 512 and 65536) plus some extra bytes for each ** page header. ^The number of extra bytes needed by the page header ** can be determined using the [SQLITE_CONFIG_PCACHE_HDRSZ] option ** to [sqlite3_config()]. From e385d8876e86b8b8e615f2437112f10560ac427c Mon Sep 17 00:00:00 2001 From: drh Date: Sun, 28 Dec 2014 22:10:51 +0000 Subject: [PATCH 22/54] Fix WITHOUT ROWID tables so that they correctly deal with PRIMARY KEYs that contain redundant columns. FossilOrigin-Name: 0dfef6757056ef0bdea8f049f7469ccf6960e2cb --- manifest | 13 +++++++------ manifest.uuid | 2 +- src/build.c | 13 +++++++++++++ test/without_rowid6.test | 41 ++++++++++++++++++++++++++++++++++++++++ 4 files changed, 62 insertions(+), 7 deletions(-) create mode 100644 test/without_rowid6.test diff --git a/manifest b/manifest index 50e33c046d..ab14a67a57 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Update\sthe\sSQLITE_CONFIG_PAGECACHE\sdocumentation\sso\sthat\sthe\smaximum\spage\nsize\sis\scorrectly\sstated\sto\sbe\s65536. -D 2014-12-25T12:19:56.744 +C Fix\sWITHOUT\sROWID\stables\sso\sthat\sthey\scorrectly\sdeal\swith\sPRIMARY\sKEYs\sthat\ncontain\sredundant\scolumns. +D 2014-12-28T22:10:51.114 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in c20e37499a3d664a3732257ed042352eba777a4d F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -176,7 +176,7 @@ F src/btmutex.c 49ca66250c7dfa844a4d4cb8272b87420d27d3a5 F src/btree.c 904d30478685fe0723ad9092fc800a655544c69a F src/btree.h 94277c1d30c0b75705974bcc8b0c05e79c03d474 F src/btreeInt.h a3d0ae1d511365e1a2b76ad10960dbe55c286f34 -F src/build.c 162d84e4833b03f9d07192ef06057b0226f6e543 +F src/build.c f5cfd7b32216f695b995bbc7c1a395f6d451d11f F src/callback.c 7b44ce59674338ad48b0e84e7b72f935ea4f68b0 F src/complete.c 198a0066ba60ab06fc00fba1998d870a4d575463 F src/ctime.c df19848891c8a553c80e6f5a035e768280952d1a @@ -1178,6 +1178,7 @@ F test/without_rowid2.test af260339f79d13cb220288b67cd287fbcf81ad99 F test/without_rowid3.test 1081aabf60a1e1123b7f9a8f6ae19954351843b0 F test/without_rowid4.test 4e08bcbaee0399f35d58b5581881e7a6243d458a F test/without_rowid5.test 61256715b686359df48ca1742db50cc7e3e7b862 +F test/without_rowid6.test deddb78ef539c355bddec00cdfaea6c56efd8b3f F test/wordcount.c 9915e06cb33d8ca8109b8700791afe80d305afda F test/zeroblob.test caaecfb4f908f7bc086ed238668049f96774d688 F test/zerodamage.test cf6748bad89553cc1632be51a6f54e487e4039ac @@ -1233,7 +1234,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 6396f8046242286298fecd1748a6e8e786e6794e -R 6fef442856f5d39a46d82b3795b528e7 +P 3286424b4d30035de69b88ef0b2897365ff848f9 +R fdb1da8fdb04c896d0536c98941bdfa0 U drh -Z 07073e8eb87986ae3ece689929973238 +Z ccbcde8f60a3b3f04760cafd27073216 diff --git a/manifest.uuid b/manifest.uuid index e53bf043df..e8065acc31 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -3286424b4d30035de69b88ef0b2897365ff848f9 \ No newline at end of file +0dfef6757056ef0bdea8f049f7469ccf6960e2cb \ No newline at end of file diff --git a/src/build.c b/src/build.c index db954647cc..f02989bffe 100644 --- a/src/build.c +++ b/src/build.c @@ -1713,6 +1713,19 @@ static void convertToWithoutRowidTable(Parse *pParse, Table *pTab){ pTab->iPKey = -1; }else{ pPk = sqlite3PrimaryKeyIndex(pTab); + /* + ** Remove all redundant columns from the PRIMARY KEY. For example, change + ** "PRIMARY KEY(a,b,a,b,c,b,c,d)" into just "PRIMARY KEY(a,b,c,d)". Later + ** code assumes the PRIMARY KEY contains no repeated columns. + */ + for(i=j=1; inKeyCol; i++){ + if( hasColumn(pPk->aiColumn, j, pPk->aiColumn[i]) ){ + pPk->nColumn--; + }else{ + pPk->aiColumn[j++] = pPk->aiColumn[i]; + } + } + pPk->nKeyCol = j; } pPk->isCovering = 1; assert( pPk!=0 ); diff --git a/test/without_rowid6.test b/test/without_rowid6.test new file mode 100644 index 0000000000..e827ccab90 --- /dev/null +++ b/test/without_rowid6.test @@ -0,0 +1,41 @@ +# 2014-12-28 +# +# The author disclaims copyright to this source code. In place of +# a legal notice, here is a blessing: +# +# May you do good and not evil. +# May you find forgiveness for yourself and forgive others. +# May you share freely, never taking more than you give. +# +#*********************************************************************** +# +# Verify that WITHOUT ROWID tables work correctly when the PRIMARY KEY +# has redundant columns. +# + +set testdir [file dirname $argv0] +source $testdir/tester.tcl + +do_execsql_test without_rowid6-100 { + CREATE TABLE t1(a,b,c,d,e, PRIMARY KEY(a,b,c,a,b,c,d,a,b,c)) WITHOUT ROWID; + CREATE INDEX t1a ON t1(b, b); + WITH RECURSIVE + c(i) AS (VALUES(1) UNION ALL SELECT i+1 FROM c WHERE i<1000) + INSERT INTO t1(a,b,c,d,e) SELECT i, i+1000, printf('x%dy',i), 0, 0 FROM c; + ANALYZE; +} {} +do_execsql_test without_rowid6-110 { + SELECT c FROM t1 WHERE a=123; +} {x123y} +do_execsql_test without_rowid6-120 { + SELECT c FROM t1 WHERE b=1123; +} {x123y} +do_execsql_test without_rowid6-130 { + SELECT c FROM t1 ORDER BY a DESC LIMIT 5; +} {x1000y x999y x998y x997y x996y} +do_execsql_test without_rowid6-140 { + SELECT c FROM t1 ORDER BY b LIMIT 5; +} {x1y x2y x3y x4y x5y} + + +finish_test From 277b4e446cb4400b107df38fb91553d8585e5ff1 Mon Sep 17 00:00:00 2001 From: drh Date: Mon, 29 Dec 2014 02:55:58 +0000 Subject: [PATCH 23/54] Fix the "checksymbols" target in Makefile.in so that it actually works. Enhance the releasetest.tcl script to count the total number of tests run over all configurations. FossilOrigin-Name: 4eda1c746043acbdb7ef3e1f95bf8b01ee976479 --- Makefile.in | 3 ++- manifest | 14 +++++++------- manifest.uuid | 2 +- test/releasetest.tcl | 39 +++++++++++++++++++++++++++++++++++++-- 4 files changed, 47 insertions(+), 11 deletions(-) diff --git a/Makefile.in b/Makefile.in index 887f99e0ee..6867afcf52 100644 --- a/Makefile.in +++ b/Makefile.in @@ -974,7 +974,8 @@ speedtest1$(TEXE): $(TOP)/test/wordcount.c sqlite3.lo # releasetest.tcl script. # checksymbols: sqlite3.lo - nm -g --defined-only sqlite3.lo | grep -v " sqlite3_" ; test $$? -ne 0 + nm -g --defined-only sqlite3.o | grep -v " sqlite3_" ; test $$? -ne 0 + echo '0 errors out of 1 tests' # The next two rules are used to support the "threadtest" target. Building # threadtest runs a few thread-safety tests that are implemented in C. This diff --git a/manifest b/manifest index ab14a67a57..8891c37497 100644 --- a/manifest +++ b/manifest @@ -1,7 +1,7 @@ -C Fix\sWITHOUT\sROWID\stables\sso\sthat\sthey\scorrectly\sdeal\swith\sPRIMARY\sKEYs\sthat\ncontain\sredundant\scolumns. -D 2014-12-28T22:10:51.114 +C Fix\sthe\s"checksymbols"\starget\sin\sMakefile.in\sso\sthat\sit\sactually\sworks.\nEnhance\sthe\sreleasetest.tcl\sscript\sto\scount\sthe\stotal\snumber\sof\stests\nrun\sover\sall\sconfigurations. +D 2014-12-29T02:55:58.026 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f -F Makefile.in c20e37499a3d664a3732257ed042352eba777a4d +F Makefile.in 40326b6d788007dd5e00587c54adcd2621832bb3 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 F Makefile.msc b363b90fe1bfc3b87d190f2f728a126c00d9ce09 F Makefile.vxworks 034289efa9d591b04b1a73598623119c306cbba0 @@ -801,7 +801,7 @@ F test/randexpr1.test eda062a97e60f9c38ae8d806b03b0ddf23d796df F test/rdonly.test dd30a4858d8e0fbad2304c2bd74a33d4df36412a F test/regexp1.test 497ea812f264d12b6198d6e50a76be4a1973a9d8 F test/reindex.test 44edd3966b474468b823d481eafef0c305022254 -F test/releasetest.tcl 80d10f058667e6d0c8ab379d6e5bb0a60ecb40e2 +F test/releasetest.tcl 14552a8741165a0489cd9ec3e9a651ba1f1b3567 F test/resolver01.test 33abf37ff8335e6bf98f2b45a0af3e06996ccd9a F test/rollback.test 458fe73eb3ffdfdf9f6ba3e9b7350a6220414dea F test/rollback2.test fc14cf6d1a2b250d2735ef16124b971bce152f14 @@ -1234,7 +1234,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 3286424b4d30035de69b88ef0b2897365ff848f9 -R fdb1da8fdb04c896d0536c98941bdfa0 +P 0dfef6757056ef0bdea8f049f7469ccf6960e2cb +R 74cab324b9af5a87ce922fe9e97d1a6b U drh -Z ccbcde8f60a3b3f04760cafd27073216 +Z 3ab79c0378fea7c029a9124c0c9f4912 diff --git a/manifest.uuid b/manifest.uuid index e8065acc31..5ec8724985 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -0dfef6757056ef0bdea8f049f7469ccf6960e2cb \ No newline at end of file +4eda1c746043acbdb7ef3e1f95bf8b01ee976479 \ No newline at end of file diff --git a/test/releasetest.tcl b/test/releasetest.tcl index 879b7f8fb9..6a91ac585b 100644 --- a/test/releasetest.tcl +++ b/test/releasetest.tcl @@ -65,7 +65,6 @@ array set ::Configs { -DSQLITE_SECURE_DELETE=1 -DSQLITE_SOUNDEX=1 -DSQLITE_ENABLE_ATOMIC_WRITE=1 - -DSQLITE_ENABLE_IOTRACE=1 -DSQLITE_ENABLE_MEMORY_MANAGEMENT=1 -DSQLITE_ENABLE_OVERSIZE_CELL_CHECK=1 } @@ -201,6 +200,37 @@ foreach {key value} [array get ::Platforms] { } } +# Open the file $logfile and look for a report on the number of errors +# and the number of test cases run. Add these values to the global +# $::NERRCASE and $::NTESTCASE variables. +# +# If any errors occur, then write into $errmsgVar the text of an appropriate +# one-line error message to show on the output. +# +proc count_tests_and_errors {logfile rcVar errmsgVar} { + upvar 1 $rcVar rc $errmsgVar errmsg + set fd [open $logfile rb] + set seen 0 + while {![eof $fd]} { + set line [gets $fd] + if {[regexp {^(\d+) errors out of (\d+) tests} $line all nerr ntest]} { + incr ::NERRCASE $nerr + incr ::NTESTCASE $ntest + set seen 1 + if {$nerr>0} { + set rc 1 + set errmsg $line + } + break; + } + } + close $fd + if {!$seen} { + set rc 1 + set errmsg "Test did not complete" + } +} + proc run_test_suite {name testtarget config} { # Tcl variable $opts is used to build up the value used to set the # OPTS Makefile variable. Variable $cflags holds the value for @@ -242,9 +272,11 @@ proc run_test_suite {name testtarget config} { set tm1 [clock seconds] set origdir [pwd] dryrun cd $dir + set errmsg {} set rc [catch [configureCommand]] if {!$rc} { set rc [catch [makeCommand $testtarget $cflags $opts]] + count_tests_and_errors test.log rc errmsg } set tm2 [clock seconds] dryrun cd $origdir @@ -257,6 +289,7 @@ proc run_test_suite {name testtarget config} { if {$rc} { puts " FAIL $tm" incr ::NERR + if {$errmsg!=""} {puts " $errmsg"} } else { puts " Ok $tm" } @@ -407,6 +440,8 @@ proc main {argv} { set ::NERR 0 set ::NTEST 0 + set ::NTESTCASE 0 + set ::NERRCASE 0 set STARTTIME [clock seconds] foreach {zConfig target} $::CONFIGLIST { if {$::QUICK} {set target test} @@ -441,7 +476,7 @@ proc main {argv} { set sec [expr {$elapsetime%60}] set etime [format (%02d:%02d:%02d) $hr $min $sec] puts [string repeat * 70] - puts "$::NERR failures of $::NTEST test suites run in $etime" + puts "$::NERRCASE failures of $::NTESTCASE tests run in $etime" } main $argv From 622a53d54aa4f585ab8e465b9b9e7a208146ad9d Mon Sep 17 00:00:00 2001 From: drh Date: Mon, 29 Dec 2014 11:50:39 +0000 Subject: [PATCH 24/54] Reinstate an assert() by adding an "|| CORRUPT_DB" term. FossilOrigin-Name: 95ce20348d9b868a0407adccdb222a0e4c762945 --- manifest | 12 ++++++------ manifest.uuid | 2 +- src/wal.c | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/manifest b/manifest index 8891c37497..c6dc73b170 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Fix\sthe\s"checksymbols"\starget\sin\sMakefile.in\sso\sthat\sit\sactually\sworks.\nEnhance\sthe\sreleasetest.tcl\sscript\sto\scount\sthe\stotal\snumber\sof\stests\nrun\sover\sall\sconfigurations. -D 2014-12-29T02:55:58.026 +C Reinstate\san\sassert()\sby\sadding\san\s"||\sCORRUPT_DB"\sterm. +D 2014-12-29T11:50:39.465 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 40326b6d788007dd5e00587c54adcd2621832bb3 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -301,7 +301,7 @@ F src/vdbemem.c 31d8eabb0cd78bfeab4e5124c7363c3e9e54db9f F src/vdbesort.c c150803a3e98fbc68bd07772cbbd4328a0a7212d F src/vdbetrace.c 7e4222955e07dd707a2f360c0eb73452be1cb010 F src/vtab.c c08ec66f45919eaa726bf88aa53eb08379d607f9 -F src/wal.c 847692349eb6e1fb8543dbc97e69ddbfa4cc7ea7 +F src/wal.c 85353539f2d9d0c91ebd057c32525b1e1aa3335e F src/wal.h df01efe09c5cb8c8e391ff1715cca294f89668a4 F src/walker.c c253b95b4ee44b21c406e2a1052636c31ea27804 F src/where.c d46de821bc604a4fd36fa3928c086950e91aafb1 @@ -1234,7 +1234,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 0dfef6757056ef0bdea8f049f7469ccf6960e2cb -R 74cab324b9af5a87ce922fe9e97d1a6b +P 4eda1c746043acbdb7ef3e1f95bf8b01ee976479 +R 110d8f73632ac0551fa4d638f24a9811 U drh -Z 3ab79c0378fea7c029a9124c0c9f4912 +Z b99a612326485f12a8c134680408ea8b diff --git a/manifest.uuid b/manifest.uuid index 5ec8724985..bf6224e944 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -4eda1c746043acbdb7ef3e1f95bf8b01ee976479 \ No newline at end of file +95ce20348d9b868a0407adccdb222a0e4c762945 \ No newline at end of file diff --git a/src/wal.c b/src/wal.c index 2b80c7a95e..f2738a6727 100644 --- a/src/wal.c +++ b/src/wal.c @@ -2412,7 +2412,7 @@ int sqlite3WalFindFrame( for(iKey=walHash(pgno); aHash[iKey]; iKey=walNextHash(iKey)){ u32 iFrame = aHash[iKey] + iZero; if( iFrame<=iLast && aPgno[aHash[iKey]]==pgno ){ - /* assert( iFrame>iRead ); -- not true if there is corruption */ + assert( iFrame>iRead || CORRUPT_DB ); iRead = iFrame; } if( (nCollide--)==0 ){ From 620315840c0f9797b85a09cebe94672575602caa Mon Sep 17 00:00:00 2001 From: dan Date: Mon, 29 Dec 2014 12:02:31 +0000 Subject: [PATCH 25/54] Fix some recently added tests so that they work with SQLITE_DEFAULT_AUTOVACUUM=1. FossilOrigin-Name: ef0626ab20f753f01090ca8e8a94e8b516eea55e --- manifest | 18 +++++++++--------- manifest.uuid | 2 +- test/e_walauto.test | 1 + test/e_walckpt.test | 2 ++ test/wal5.test | 11 ++++++----- 5 files changed, 19 insertions(+), 15 deletions(-) diff --git a/manifest b/manifest index c6dc73b170..ff08366760 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Reinstate\san\sassert()\sby\sadding\san\s"||\sCORRUPT_DB"\sterm. -D 2014-12-29T11:50:39.465 +C Fix\ssome\srecently\sadded\stests\sso\sthat\sthey\swork\swith\sSQLITE_DEFAULT_AUTOVACUUM=1. +D 2014-12-29T12:02:31.823 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 40326b6d788007dd5e00587c54adcd2621832bb3 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -478,8 +478,8 @@ F test/e_update.test 312cb8f5ccfe41515a6bb092f8ea562a9bd54d52 F test/e_uri.test 5ae33760fb2039c61aa2d90886f1664664173585 F test/e_vacuum.test 5bfbdc21b65c0abf24398d0ba31dc88d93ca77a9 F test/e_wal.test 0967f0b8f1dfda871dc7b9b5574198f1f4f7d69a -F test/e_walauto.test eab3bedddbc3fd19795d51e618da41a48e19a3e3 -F test/e_walckpt.test 3116a98fa0dd9b2c9e493de7c59730adfe436746 +F test/e_walauto.test d2dfc6681aade1f1306a8a336f5a258d8b62becd +F test/e_walckpt.test 65e29b6631e51f210f83e4ff11571e647ba93608 F test/e_walhook.test da3ea8b3483d1af72190337bda50155a91a4b664 F test/enc.test e54531cd6bf941ee6760be041dff19a104c7acea F test/enc2.test 83437a79ba1545a55fb549309175c683fb334473 @@ -1123,7 +1123,7 @@ F test/wal.test 885f32b2b390b30b4aa3dbb0e568f8f78d40f5cc F test/wal2.test 1f841d2048080d32f552942e333fd99ce541dada F test/wal3.test b22eb662bcbc148c5f6d956eaf94b047f7afe9c0 F test/wal4.test 4744e155cd6299c6bd99d3eab1c82f77db9cdb3c -F test/wal5.test 174cc1512e304a7dfa28ac30527e28ea02fc37df +F test/wal5.test 11b8658dd4d5448f4604124bebd9b68be5bc3e66 F test/wal6.test 527581f5527bf9c24394991e2be83000aace5f9e F test/wal64k.test 163655ecd2cb8afef4737cac2a40fdd2eeaf20b8 F test/wal7.test 2ae8f427d240099cc4b2dfef63cff44e2a68a1bd @@ -1234,7 +1234,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 4eda1c746043acbdb7ef3e1f95bf8b01ee976479 -R 110d8f73632ac0551fa4d638f24a9811 -U drh -Z b99a612326485f12a8c134680408ea8b +P 95ce20348d9b868a0407adccdb222a0e4c762945 +R 0db2cbd8617dad79686d47ebce6896f7 +U dan +Z 03a26819b4fc4a14b459978f03e3e164 diff --git a/manifest.uuid b/manifest.uuid index bf6224e944..57a4b2b13b 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -95ce20348d9b868a0407adccdb222a0e4c762945 \ No newline at end of file +ef0626ab20f753f01090ca8e8a94e8b516eea55e \ No newline at end of file diff --git a/test/e_walauto.test b/test/e_walauto.test index 79a2702d04..239adc3b95 100644 --- a/test/e_walauto.test +++ b/test/e_walauto.test @@ -66,6 +66,7 @@ foreach {tn code} { eval $code reset_db + execsql { PRAGMA auto_vacuum = 0 } do_execsql_test 1.$tn.0 { PRAGMA journal_mode = WAL } {wal} do_execsql_test 1.$tn.1 { CREATE TABLE t1(a, b) } set shmfd [open "test.db-shm" rb] diff --git a/test/e_walckpt.test b/test/e_walckpt.test index e6b6566bed..e022f840cf 100644 --- a/test/e_walckpt.test +++ b/test/e_walckpt.test @@ -247,6 +247,7 @@ foreach {tn script} { do_test $tn.3.2.1 { db2 eval { + PRAGMA auto_vacuum = 0; PRAGMA journal_mode = WAL; CREATE TABLE t1(x, y); INSERT INTO t1 VALUES(1,2); @@ -706,6 +707,7 @@ sqlite3 db2 test.db do_test 6.1 { execsql { + PRAGMA auto_vacuum = 0; PRAGMA journal_mode = WAL; CREATE TABLE t1(a, b); INSERT INTO t1 VALUES(1, 2); diff --git a/test/wal5.test b/test/wal5.test index 09c7d76040..8c1ec8bcc7 100644 --- a/test/wal5.test +++ b/test/wal5.test @@ -363,9 +363,10 @@ foreach {testprefix do_wal_checkpoint} { code2 $do_wal_checkpoint code3 $do_wal_checkpoint - do_test 3.$tn.1 { + do_test 4.$tn.1 { sql1 { PRAGMA page_size = 1024; + PRAGMA auto_vacuum = 0; PRAGMA journal_mode = WAL; PRAGMA synchronous = normal; CREATE TABLE t1(x, y); @@ -376,14 +377,14 @@ foreach {testprefix do_wal_checkpoint} { file size test.db-wal } [wal_file_size 8 1024] - do_test 3.$tn.2 { do_wal_checkpoint db -mode truncate } {0 0 0} - do_test 3.$tn.3 { file size test.db-wal } 0 + do_test 4.$tn.2 { do_wal_checkpoint db -mode truncate } {0 0 0} + do_test 4.$tn.3 { file size test.db-wal } 0 - do_test 3.$tn.4 { + do_test 4.$tn.4 { sql2 { SELECT * FROM t1 } } {1 2 3 4} - do_test 3.$tn.5 { + do_test 4.$tn.5 { sql2 { INSERT INTO t1 VALUES('a', 'b') } file size test.db-wal } [wal_file_size 2 1024] From cb281a9a2c3887f2e80aed8a59bcdf8c241c141b Mon Sep 17 00:00:00 2001 From: drh Date: Mon, 29 Dec 2014 19:54:10 +0000 Subject: [PATCH 26/54] Fix the --dryrun option in releasetest.tcl. FossilOrigin-Name: 0f9e549643ab94b0465e6891384dd20506708a8f --- manifest | 14 +++++++------- manifest.uuid | 2 +- test/releasetest.tcl | 1 + 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/manifest b/manifest index ff08366760..101d767d16 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Fix\ssome\srecently\sadded\stests\sso\sthat\sthey\swork\swith\sSQLITE_DEFAULT_AUTOVACUUM=1. -D 2014-12-29T12:02:31.823 +C Fix\sthe\s--dryrun\soption\sin\sreleasetest.tcl. +D 2014-12-29T19:54:10.833 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 40326b6d788007dd5e00587c54adcd2621832bb3 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -801,7 +801,7 @@ F test/randexpr1.test eda062a97e60f9c38ae8d806b03b0ddf23d796df F test/rdonly.test dd30a4858d8e0fbad2304c2bd74a33d4df36412a F test/regexp1.test 497ea812f264d12b6198d6e50a76be4a1973a9d8 F test/reindex.test 44edd3966b474468b823d481eafef0c305022254 -F test/releasetest.tcl 14552a8741165a0489cd9ec3e9a651ba1f1b3567 +F test/releasetest.tcl 3ffd8d99da7a087917f057147053ed35ce1bf90b F test/resolver01.test 33abf37ff8335e6bf98f2b45a0af3e06996ccd9a F test/rollback.test 458fe73eb3ffdfdf9f6ba3e9b7350a6220414dea F test/rollback2.test fc14cf6d1a2b250d2735ef16124b971bce152f14 @@ -1234,7 +1234,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 95ce20348d9b868a0407adccdb222a0e4c762945 -R 0db2cbd8617dad79686d47ebce6896f7 -U dan -Z 03a26819b4fc4a14b459978f03e3e164 +P ef0626ab20f753f01090ca8e8a94e8b516eea55e +R fa81eb180b12cb206ba390f700c75ee2 +U drh +Z 819655494d4a64bf8e32c2a6559858d5 diff --git a/manifest.uuid b/manifest.uuid index 57a4b2b13b..8a65bd3f3d 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -ef0626ab20f753f01090ca8e8a94e8b516eea55e \ No newline at end of file +0f9e549643ab94b0465e6891384dd20506708a8f \ No newline at end of file diff --git a/test/releasetest.tcl b/test/releasetest.tcl index 6a91ac585b..bcd7d3d060 100644 --- a/test/releasetest.tcl +++ b/test/releasetest.tcl @@ -208,6 +208,7 @@ foreach {key value} [array get ::Platforms] { # one-line error message to show on the output. # proc count_tests_and_errors {logfile rcVar errmsgVar} { + if {$::DRYRUN} return upvar 1 $rcVar rc $errmsgVar errmsg set fd [open $logfile rb] set seen 0 From 37c057b8ff93ad750623b0a4f032722849954551 Mon Sep 17 00:00:00 2001 From: drh Date: Tue, 30 Dec 2014 00:57:29 +0000 Subject: [PATCH 27/54] Round all object sizes that go into computing SQLITE_CONFIG_PCACHE_HDRSZ up to a multiple of 8 bytes. FossilOrigin-Name: b28ce75f2d3a6343dc20d581dc55afae89ab5efa --- manifest | 16 ++++++++-------- manifest.uuid | 2 +- src/btree.c | 2 +- src/pcache.c | 2 +- src/pcache1.c | 2 +- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/manifest b/manifest index 101d767d16..750bbbaad6 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Fix\sthe\s--dryrun\soption\sin\sreleasetest.tcl. -D 2014-12-29T19:54:10.833 +C Round\sall\sobject\ssizes\sthat\sgo\sinto\scomputing\sSQLITE_CONFIG_PCACHE_HDRSZ\sup\nto\sa\smultiple\sof\s8\sbytes. +D 2014-12-30T00:57:29.979 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 40326b6d788007dd5e00587c54adcd2621832bb3 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -173,7 +173,7 @@ F src/auth.c b56c78ebe40a2110fd361379f7e8162d23f92240 F src/backup.c 7ddee9c7d505e07e959a575b18498f17c71e53ea F src/bitvec.c 19a4ba637bd85f8f63fc8c9bae5ade9fb05ec1cb F src/btmutex.c 49ca66250c7dfa844a4d4cb8272b87420d27d3a5 -F src/btree.c 904d30478685fe0723ad9092fc800a655544c69a +F src/btree.c 4c098bb6e8678e4596983862abf78f7a0fcb807e F src/btree.h 94277c1d30c0b75705974bcc8b0c05e79c03d474 F src/btreeInt.h a3d0ae1d511365e1a2b76ad10960dbe55c286f34 F src/build.c f5cfd7b32216f695b995bbc7c1a395f6d451d11f @@ -219,9 +219,9 @@ F src/os_win.h 09e751b20bbc107ffbd46e13555dc73576d88e21 F src/pager.c 2cbaf886a6157c53a8061ea7e677f81620ff46eb F src/pager.h c3476e7c89cdf1c6914e50a11f3714e30b4e0a77 F src/parse.y 5dfead8aed90cb0c7c1115898ee2266804daff45 -F src/pcache.c ace1b67632deeaa84859b4c16c27711dfb7db3d4 +F src/pcache.c 8ee2ce15c4f49b44e27e8ffb8ce683c5e506e736 F src/pcache.h b44658c9c932d203510279439d891a2a83e12ba8 -F src/pcache1.c facbdd3ecc09c8f750089d941305694301328e98 +F src/pcache1.c ff599891da0e4993c814eeae3e7e2801f47364f3 F src/pragma.c bd33aa24456f043bb6f6d32a918bbeed41d8c591 F src/prepare.c 173a5a499138451b2561614ecb87d78f9f4644b9 F src/printf.c 9e75a6a0b55bf61cfff7d7e19d89834a1b938236 @@ -1234,7 +1234,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P ef0626ab20f753f01090ca8e8a94e8b516eea55e -R fa81eb180b12cb206ba390f700c75ee2 +P 0f9e549643ab94b0465e6891384dd20506708a8f +R e296d2763d3effbc9c21b29aae15693b U drh -Z 819655494d4a64bf8e32c2a6559858d5 +Z 2369afc171a95fab3bda365a2e52134d diff --git a/manifest.uuid b/manifest.uuid index 8a65bd3f3d..51d7bf7cd2 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -0f9e549643ab94b0465e6891384dd20506708a8f \ No newline at end of file +b28ce75f2d3a6343dc20d581dc55afae89ab5efa \ No newline at end of file diff --git a/src/btree.c b/src/btree.c index 0554f3fa3c..f9f76c2ebb 100644 --- a/src/btree.c +++ b/src/btree.c @@ -9146,4 +9146,4 @@ int sqlite3BtreeIsReadonly(Btree *p){ /* ** Return the size of the header added to each page by this module. */ -int sqlite3HeaderSizeBtree(void){ return sizeof(MemPage); } +int sqlite3HeaderSizeBtree(void){ return ROUND8(sizeof(MemPage)); } diff --git a/src/pcache.c b/src/pcache.c index 13551872d1..3139429699 100644 --- a/src/pcache.c +++ b/src/pcache.c @@ -655,7 +655,7 @@ void sqlite3PcacheShrink(PCache *pCache){ ** Return the size of the header added by this middleware layer ** in the page-cache hierarchy. */ -int sqlite3HeaderSizePcache(void){ return sizeof(PgHdr); } +int sqlite3HeaderSizePcache(void){ return ROUND8(sizeof(PgHdr)); } #if defined(SQLITE_CHECK_PAGES) || defined(SQLITE_DEBUG) diff --git a/src/pcache1.c b/src/pcache1.c index cad41b1b73..990f51591f 100644 --- a/src/pcache1.c +++ b/src/pcache1.c @@ -984,7 +984,7 @@ void sqlite3PCacheSetDefault(void){ /* ** Return the size of the header on each page of this PCACHE implementation. */ -int sqlite3HeaderSizePcache1(void){ return sizeof(PgHdr1); } +int sqlite3HeaderSizePcache1(void){ return ROUND8(sizeof(PgHdr1)); } #ifdef SQLITE_ENABLE_MEMORY_MANAGEMENT /* From 8ab4b9e96459f756749edad0cfb2eb6faef771bc Mon Sep 17 00:00:00 2001 From: dan Date: Tue, 30 Dec 2014 12:03:35 +0000 Subject: [PATCH 28/54] Change notify2.test to check that sqlite3_blocking_step() uses CPU more efficiently than sqlite3_step(), not that it results in greater overall throughput for any specific number of threads. FossilOrigin-Name: d904d29354a5ed85d33bafe4a7143f3c5ecee790 --- manifest | 14 +++++++------- manifest.uuid | 2 +- test/notify2.test | 41 +++++++++++++++++++++++++++++++++-------- 3 files changed, 41 insertions(+), 16 deletions(-) diff --git a/manifest b/manifest index 750bbbaad6..68e968d12e 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Round\sall\sobject\ssizes\sthat\sgo\sinto\scomputing\sSQLITE_CONFIG_PCACHE_HDRSZ\sup\nto\sa\smultiple\sof\s8\sbytes. -D 2014-12-30T00:57:29.979 +C Change\snotify2.test\sto\scheck\sthat\ssqlite3_blocking_step()\suses\sCPU\smore\sefficiently\sthan\ssqlite3_step(),\snot\sthat\sit\sresults\sin\sgreater\soverall\sthroughput\sfor\sany\sspecific\snumber\sof\sthreads. +D 2014-12-30T12:03:35.117 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 40326b6d788007dd5e00587c54adcd2621832bb3 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -755,7 +755,7 @@ F test/mutex2.test bfeaeac2e73095b2ac32285d2756e3a65e681660 F test/nan.test e9648b9d007c7045242af35e11a984d4b169443a F test/nolock.test 0540dd96f39b8876e3ffdd8814fad0ea425efeee F test/notify1.test 669b2b743618efdc18ca4b02f45423d5d2304abf -F test/notify2.test ce23eb522c9e1fff6443f96376fe67872202061c +F test/notify2.test 2ecabaa1305083856b7c39cf32816b612740c161 F test/notify3.test 10ff25cde502e72a92053a2f215d64bece4ef934 F test/notnull.test f8fcf58669ddba79274daa2770d61dfad8274f62 F test/null.test a8b09b8ed87852742343b33441a9240022108993 @@ -1234,7 +1234,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 0f9e549643ab94b0465e6891384dd20506708a8f -R e296d2763d3effbc9c21b29aae15693b -U drh -Z 2369afc171a95fab3bda365a2e52134d +P b28ce75f2d3a6343dc20d581dc55afae89ab5efa +R 05d3fab766dc5317a84b8e8fc66a7683 +U dan +Z 9e6a15ccef1a8c8d1ccc67c36a60ea41 diff --git a/manifest.uuid b/manifest.uuid index 51d7bf7cd2..f0f3fc30da 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -b28ce75f2d3a6343dc20d581dc55afae89ab5efa \ No newline at end of file +d904d29354a5ed85d33bafe4a7143f3c5ecee790 \ No newline at end of file diff --git a/test/notify2.test b/test/notify2.test index 9e40ed695b..12c6a537ef 100644 --- a/test/notify2.test +++ b/test/notify2.test @@ -101,6 +101,8 @@ set sql $zSql # This loop runs for ~20 seconds. # set iStart [clock_seconds] + set nOp 0 + set nAttempt 0 while { ([clock_seconds]-$iStart) < $nSecond } { # Each transaction does 3 operations. Each operation is either a read @@ -128,6 +130,7 @@ set sql $zSql # Execute the SQL transaction. # + incr nAttempt set rc [catch { execsql_blocking $::DB " BEGIN; $SQL(1); @@ -154,13 +157,14 @@ set sql $zSql # returned "1". Otherwise, the invariant was false, indicating that # some malfunction has occurred. foreach r $msg { if {$r != 1} { puts "Invariant check failed: $msg" } } + incr nOp } } # Close the database connection and return 0. # sqlite3_close $::DB - expr 0 + list $nOp $nAttempt } foreach {iTest xStep xPrepare} { @@ -204,7 +208,9 @@ foreach {iTest xStep xPrepare} { for {set ii 0} {$ii < $nThread} {incr ii} { do_test notify2-$iTest.2.$ii { if {![info exists finished($ii)]} { vwait finished($ii) } - set finished($ii) + incr anSuccess($xStep) [lindex $finished($ii) 0] + incr anAttempt($xStep) [lindex $finished($ii) 1] + expr 0 } {0} } @@ -225,17 +231,36 @@ foreach {iTest xStep xPrepare} { } # The following tests checks to make sure sqlite3_blocking_step() is -# faster than sqlite3_step(). blocking_step() is always faster on -# multi-core and is usually faster on single-core. But sometimes, by -# chance, step() will be faster on a single core, in which case the +# faster than sqlite3_step(). "Faster" in this case means uses fewer +# CPU cycles. This is not always the same as faster in wall-clock time +# for this type of test. The number of CPU cycles per transaction is +# roughly proportional to the number of attempts made (i.e. one plus the +# number of SQLITE_BUSY or SQLITE_LOCKED errors that require the transaction +# to be retried). So this test just measures that a greater percentage of +# transactions attempted using blocking_step() succeed. +# +# The blocking_step() function is almost always faster on multi-core and is +# usually faster on single-core. But sometimes, by chance, step() will be +# faster on a single core, in which case the # following test will fail. # puts "The following test seeks to demonstrate that the sqlite3_unlock_notify()" -puts "interface helps multi-core systems to run faster. This test sometimes" -puts "fails on single-core machines." +puts "interface helps multi-core systems to run more efficiently. This test" +puts "sometimes fails on single-core machines." puts [array get anWrite] do_test notify2-3 { - expr {$anWrite(sqlite3_blocking_step) > $anWrite(sqlite3_step)} + set blocking [expr { + double($anSuccess(sqlite3_blocking_step)) / + double($anAttempt(sqlite3_blocking_step)) + }] + set non [expr { + double($anSuccess(sqlite3_step)) / + double($anAttempt(sqlite3_step)) + }] + puts -nonewline [format " blocking: %.1f%% non-blocking %.1f%% ..." \ + [expr $blocking*100.0] [expr $non*100.0]] + + expr {$blocking > $non} } {1} sqlite3_enable_shared_cache $::enable_shared_cache From 51dc84eb7053963a6236e0a10dd3936bf4bd1378 Mon Sep 17 00:00:00 2001 From: drh Date: Tue, 30 Dec 2014 13:04:25 +0000 Subject: [PATCH 29/54] Make SQLITE_CONFIG_PCACHE_HDRSZ accurate (not an over-estimate) on 32-bit systems. FossilOrigin-Name: 340b347758e570db3e739b56af0dcf3fc34525be --- manifest | 16 ++++++++-------- manifest.uuid | 2 +- src/pcache.c | 3 ++- src/pcache1.c | 2 +- 4 files changed, 12 insertions(+), 11 deletions(-) diff --git a/manifest b/manifest index 68e968d12e..e2c3330813 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Change\snotify2.test\sto\scheck\sthat\ssqlite3_blocking_step()\suses\sCPU\smore\sefficiently\sthan\ssqlite3_step(),\snot\sthat\sit\sresults\sin\sgreater\soverall\sthroughput\sfor\sany\sspecific\snumber\sof\sthreads. -D 2014-12-30T12:03:35.117 +C Make\sSQLITE_CONFIG_PCACHE_HDRSZ\saccurate\s(not\san\sover-estimate)\son\s32-bit\nsystems. +D 2014-12-30T13:04:25.944 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 40326b6d788007dd5e00587c54adcd2621832bb3 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -219,9 +219,9 @@ F src/os_win.h 09e751b20bbc107ffbd46e13555dc73576d88e21 F src/pager.c 2cbaf886a6157c53a8061ea7e677f81620ff46eb F src/pager.h c3476e7c89cdf1c6914e50a11f3714e30b4e0a77 F src/parse.y 5dfead8aed90cb0c7c1115898ee2266804daff45 -F src/pcache.c 8ee2ce15c4f49b44e27e8ffb8ce683c5e506e736 +F src/pcache.c b83d160ce81ca101f98f0d27498e6d6bd49f1599 F src/pcache.h b44658c9c932d203510279439d891a2a83e12ba8 -F src/pcache1.c ff599891da0e4993c814eeae3e7e2801f47364f3 +F src/pcache1.c 1e77432b40b7d3288327d9cdf399dcdfd2b6d3bf F src/pragma.c bd33aa24456f043bb6f6d32a918bbeed41d8c591 F src/prepare.c 173a5a499138451b2561614ecb87d78f9f4644b9 F src/printf.c 9e75a6a0b55bf61cfff7d7e19d89834a1b938236 @@ -1234,7 +1234,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P b28ce75f2d3a6343dc20d581dc55afae89ab5efa -R 05d3fab766dc5317a84b8e8fc66a7683 -U dan -Z 9e6a15ccef1a8c8d1ccc67c36a60ea41 +P d904d29354a5ed85d33bafe4a7143f3c5ecee790 +R 10e3253f54695b7f7d1030889f62fe40 +U drh +Z 96098511eaa9438036b4e314651b0800 diff --git a/manifest.uuid b/manifest.uuid index f0f3fc30da..d790a34fba 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -d904d29354a5ed85d33bafe4a7143f3c5ecee790 \ No newline at end of file +340b347758e570db3e739b56af0dcf3fc34525be \ No newline at end of file diff --git a/src/pcache.c b/src/pcache.c index 3139429699..0194f63bb9 100644 --- a/src/pcache.c +++ b/src/pcache.c @@ -196,7 +196,8 @@ int sqlite3PcacheSetPageSize(PCache *pCache, int szPage){ if( pCache->szPage ){ sqlite3_pcache *pNew; pNew = sqlite3GlobalConfig.pcache2.xCreate( - szPage, pCache->szExtra + sizeof(PgHdr), pCache->bPurgeable + szPage, pCache->szExtra + ROUND8(sizeof(PgHdr)), + pCache->bPurgeable ); if( pNew==0 ) return SQLITE_NOMEM; sqlite3GlobalConfig.pcache2.xCachesize(pNew, numberOfCachePages(pCache)); diff --git a/src/pcache1.c b/src/pcache1.c index 990f51591f..f5f7893714 100644 --- a/src/pcache1.c +++ b/src/pcache1.c @@ -296,7 +296,7 @@ static PgHdr1 *pcache1AllocPage(PCache1 *pCache){ pPg = 0; } #else - pPg = pcache1Alloc(sizeof(PgHdr1) + pCache->szPage + pCache->szExtra); + pPg = pcache1Alloc(ROUND8(sizeof(PgHdr1)) + pCache->szPage + pCache->szExtra); p = (PgHdr1 *)&((u8 *)pPg)[pCache->szPage]; #endif pcache1EnterMutex(pCache->pGroup); From d348c66e2971fe9de3ec832e54c24348bfcec8ec Mon Sep 17 00:00:00 2001 From: dan Date: Tue, 30 Dec 2014 14:40:53 +0000 Subject: [PATCH 30/54] If the sorter uses mmap'd temp files, ensure all pages of the temp file have been allocated before it is accessed. Otherwise, a disk-full condition might result in a SIGBUS exception. FossilOrigin-Name: 776648412c30dce206f1024ff849c2cb025bb006 --- manifest | 16 ++++++++-------- manifest.uuid | 2 +- src/os_unix.c | 8 ++++---- src/vdbesort.c | 12 ++++++------ 4 files changed, 19 insertions(+), 19 deletions(-) diff --git a/manifest b/manifest index e2c3330813..553eab2472 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Make\sSQLITE_CONFIG_PCACHE_HDRSZ\saccurate\s(not\san\sover-estimate)\son\s32-bit\nsystems. -D 2014-12-30T13:04:25.944 +C If\sthe\ssorter\suses\smmap'd\stemp\sfiles,\sensure\sall\spages\sof\sthe\stemp\sfile\shave\sbeen\sallocated\sbefore\sit\sis\saccessed.\sOtherwise,\sa\sdisk-full\scondition\smight\sresult\sin\sa\sSIGBUS\sexception. +D 2014-12-30T14:40:53.460 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 40326b6d788007dd5e00587c54adcd2621832bb3 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -213,7 +213,7 @@ F src/os.c 8fd25588eeba74068d41102d26810e216999b6c8 F src/os.h 3e57a24e2794a94d3cf2342c6d9a884888cd96bf F src/os_common.h 92815ed65f805560b66166e3583470ff94478f04 F src/os_setup.h c9d4553b5aaa6f73391448b265b89bed0b890faa -F src/os_unix.c fb587121840f690101336879adfa6d0b2cd0e8c7 +F src/os_unix.c 7f9ed5f05e4a9eb7275d1216e46d245d0cebfebb F src/os_win.c 91d3d08e33ec0258d180d4c8255492f47d15e007 F src/os_win.h 09e751b20bbc107ffbd46e13555dc73576d88e21 F src/pager.c 2cbaf886a6157c53a8061ea7e677f81620ff46eb @@ -298,7 +298,7 @@ F src/vdbeapi.c 4bc511a46b9839392ae0e90844a71dc96d9dbd71 F src/vdbeaux.c 07ef87c6d4b5abdf13ff33babb10205702fdab0a F src/vdbeblob.c 4af4bfb71f6df7778397b4a0ebc1879793276778 F src/vdbemem.c 31d8eabb0cd78bfeab4e5124c7363c3e9e54db9f -F src/vdbesort.c c150803a3e98fbc68bd07772cbbd4328a0a7212d +F src/vdbesort.c 80e40d889ebb536cb7a5ac4c12fa2a4662bc9181 F src/vdbetrace.c 7e4222955e07dd707a2f360c0eb73452be1cb010 F src/vtab.c c08ec66f45919eaa726bf88aa53eb08379d607f9 F src/wal.c 85353539f2d9d0c91ebd057c32525b1e1aa3335e @@ -1234,7 +1234,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P d904d29354a5ed85d33bafe4a7143f3c5ecee790 -R 10e3253f54695b7f7d1030889f62fe40 -U drh -Z 96098511eaa9438036b4e314651b0800 +P 340b347758e570db3e739b56af0dcf3fc34525be +R e81d03c815814a7da9c21e19ec0ae799 +U dan +Z 9955da99fb103f07b93ca8aef676d75e diff --git a/manifest.uuid b/manifest.uuid index d790a34fba..40b0399bb8 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -340b347758e570db3e739b56af0dcf3fc34525be \ No newline at end of file +776648412c30dce206f1024ff849c2cb025bb006 \ No newline at end of file diff --git a/src/os_unix.c b/src/os_unix.c index a9344ee830..8314e4f678 100644 --- a/src/os_unix.c +++ b/src/os_unix.c @@ -3718,16 +3718,16 @@ static int fcntlSizeHint(unixFile *pFile, i64 nByte){ int nBlk = buf.st_blksize; /* File-system block size */ i64 iWrite; /* Next offset to write to */ - if( robust_ftruncate(pFile->h, nSize) ){ - pFile->lastErrno = errno; - return unixLogError(SQLITE_IOERR_TRUNCATE, "ftruncate", pFile->zPath); - } iWrite = ((buf.st_size + 2*nBlk - 1)/nBlk)*nBlk-1; while( iWriteh, nSize) ){ + pFile->lastErrno = errno; + return unixLogError(SQLITE_IOERR_TRUNCATE, "ftruncate", pFile->zPath); + } #endif } } diff --git a/src/vdbesort.c b/src/vdbesort.c index 78ecc1efb9..d022af9af6 100644 --- a/src/vdbesort.c +++ b/src/vdbesort.c @@ -1132,12 +1132,12 @@ void sqlite3VdbeSorterClose(sqlite3 *db, VdbeCursor *pCsr){ */ static void vdbeSorterExtendFile(sqlite3 *db, sqlite3_file *pFd, i64 nByte){ if( nByte<=(i64)(db->nMaxSorterMmap) && pFd->pMethods->iVersion>=3 ){ - int rc = sqlite3OsTruncate(pFd, nByte); - if( rc==SQLITE_OK ){ - void *p = 0; - sqlite3OsFetch(pFd, 0, (int)nByte, &p); - sqlite3OsUnfetch(pFd, 0, p); - } + void *p = 0; + int chunksize = 4*1024; + sqlite3OsFileControlHint(pFd, SQLITE_FCNTL_CHUNK_SIZE, &chunksize); + sqlite3OsFileControlHint(pFd, SQLITE_FCNTL_SIZE_HINT, &nByte); + sqlite3OsFetch(pFd, 0, (int)nByte, &p); + sqlite3OsUnfetch(pFd, 0, p); } } #else From 55e115f060fae26e3f3ea3fee78cb24012035dfc Mon Sep 17 00:00:00 2001 From: dan Date: Tue, 30 Dec 2014 18:07:34 +0000 Subject: [PATCH 31/54] Fix problems with the "inmemory_journal" permutation. FossilOrigin-Name: 79693f0412ffb0486b974ee6c63b4231cfff5a77 --- manifest | 14 +++++++------- manifest.uuid | 2 +- test/permutations.test | 2 +- test/pragma3.test | 6 ++++++ 4 files changed, 15 insertions(+), 9 deletions(-) diff --git a/manifest b/manifest index 553eab2472..c8eb6467d4 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C If\sthe\ssorter\suses\smmap'd\stemp\sfiles,\sensure\sall\spages\sof\sthe\stemp\sfile\shave\sbeen\sallocated\sbefore\sit\sis\saccessed.\sOtherwise,\sa\sdisk-full\scondition\smight\sresult\sin\sa\sSIGBUS\sexception. -D 2014-12-30T14:40:53.460 +C Fix\sproblems\swith\sthe\s"inmemory_journal"\spermutation. +D 2014-12-30T18:07:34.789 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 40326b6d788007dd5e00587c54adcd2621832bb3 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -782,10 +782,10 @@ F test/pagesize.test 1dd51367e752e742f58e861e65ed7390603827a0 F test/pcache.test b09104b03160aca0d968d99e8cd2c5b1921a993d F test/pcache2.test a83efe2dec0d392f814bfc998def1d1833942025 F test/percentile.test b98fc868d71eb5619d42a1702e9ab91718cbed54 -F test/permutations.test 4e12d43f4639ea8a0e366d9c64e0009afe2eb544 +F test/permutations.test d408cd2d48e7a61c9c51ae528d94c3c48ce97477 F test/pragma.test aa16dedfe01c02c8895169012f7dfde9c163f0d5 F test/pragma2.test aea7b3d82c76034a2df2b38a13745172ddc0bc13 -F test/pragma3.test 4f141da233358783ba443eb685e6739ce0eb1d90 +F test/pragma3.test 0ca2aea1499a7c2dcee235419e520d825dac958d F test/printf.test ec9870c4dce8686a37818e0bf1aba6e6a1863552 F test/printf2.test b4acd4bf8734243257f01ddefa17c4fb090acc8a F test/progress.test a282973d1d17f08071bc58a77d6b80f2a81c354d @@ -1234,7 +1234,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 340b347758e570db3e739b56af0dcf3fc34525be -R e81d03c815814a7da9c21e19ec0ae799 +P 776648412c30dce206f1024ff849c2cb025bb006 +R d8ec23380207a0894ebd8ce1599deb6c U dan -Z 9955da99fb103f07b93ca8aef676d75e +Z 8cab0a0cf2d75b3466c28901d182f0a0 diff --git a/manifest.uuid b/manifest.uuid index 40b0399bb8..e8c8d8da23 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -776648412c30dce206f1024ff849c2cb025bb006 \ No newline at end of file +79693f0412ffb0486b974ee6c63b4231cfff5a77 \ No newline at end of file diff --git a/test/permutations.test b/test/permutations.test index ff61bf644b..63f8dc589e 100644 --- a/test/permutations.test +++ b/test/permutations.test @@ -690,7 +690,7 @@ test_suite "inmemory_journal" -description { zerodamage.test # WAL mode is different. - wal* tkt-2d1a5c67d.test backcompat.test + wal* tkt-2d1a5c67d.test backcompat.test e_wal* }] ifcapable mem3 { diff --git a/test/pragma3.test b/test/pragma3.test index f3d531164b..4654578df2 100644 --- a/test/pragma3.test +++ b/test/pragma3.test @@ -216,7 +216,12 @@ ifcapable shared_cache { # Make sure this also works in WAL mode # +# This will not work with the in-memory journal permutation, as opening +# [db2] switches the journal mode back to "memory" +# ifcapable wal { +if {[permutation]!="inmemory_journal"} { + sqlite3 db test.db db eval {PRAGMA journal_mode=WAL} sqlite3 db2 test.db @@ -242,5 +247,6 @@ ifcapable wal { } {3 111 222} db2 close } +} finish_test From 9486c1b020767a6cc5962470605cc72305717b25 Mon Sep 17 00:00:00 2001 From: drh Date: Tue, 30 Dec 2014 19:26:07 +0000 Subject: [PATCH 32/54] Update the threadtest3 test program so that its output summary is compatible with releasetest.tcl. In threadtest3, do not record errors that contain the string "no such table" as being fatal errors, since they happen sometimes in a race condition in stress1. FossilOrigin-Name: 98cb56e2401ae7e113b071df8997ba62265821d3 --- manifest | 16 ++++----- manifest.uuid | 2 +- test/threadtest3.c | 80 ++++++++++++++++++++----------------------- test/tt3_checkpoint.c | 4 +-- 4 files changed, 48 insertions(+), 54 deletions(-) diff --git a/manifest b/manifest index c8eb6467d4..6c2e6952e9 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Fix\sproblems\swith\sthe\s"inmemory_journal"\spermutation. -D 2014-12-30T18:07:34.789 +C Update\sthe\sthreadtest3\stest\sprogram\sso\sthat\sits\soutput\ssummary\sis\s\ncompatible\swith\sreleasetest.tcl.\s\sIn\sthreadtest3,\sdo\snot\srecord\serrors\nthat\scontain\sthe\sstring\s"no\ssuch\stable"\sas\sbeing\sfatal\serrors,\ssince\sthey\nhappen\ssometimes\sin\sa\srace\scondition\sin\sstress1. +D 2014-12-30T19:26:07.267 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 40326b6d788007dd5e00587c54adcd2621832bb3 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -914,7 +914,7 @@ F test/thread2.test f35d2106452b77523b3a2b7d1dcde2e5ee8f9e46 F test/thread_common.tcl 334639cadcb9f912bf82aa73f49efd5282e6cadd F test/threadtest1.c 6029d9c5567db28e6dc908a0c63099c3ba6c383b F test/threadtest2.c ace893054fa134af3fc8d6e7cfecddb8e3acefb9 -F test/threadtest3.c f8c6595664a4c5ef5f28d97a612386fe14dd1940 +F test/threadtest3.c 66c2693d888f9ed256d54d70dd60f569d92c12cf F test/threadtest4.c c1e67136ceb6c7ec8184e56ac61db28f96bd2925 F test/tkt-02a8e81d44.test 6c80d9c7514e2a42d4918bf87bf6bc54f379110c F test/tkt-26ff0c2d1e.test 888324e751512972c6e0d1a09df740d8f5aaf660 @@ -1078,7 +1078,7 @@ F test/triggerB.test 56780c031b454abac2340dbb3b71ac5c56c3d7fe F test/triggerC.test a68980c5955d62ee24be6f97129d824f199f9a4c F test/triggerD.test 8e7f3921a92a5797d472732108109e44575fa650 F test/triggerE.test 355e9c5cbaed5cd039a60baad1fb2197caeb8e52 -F test/tt3_checkpoint.c 5e63ee65ed5f87176e25a996480cb02c6caec8b4 +F test/tt3_checkpoint.c 9e75cf7c1c364f52e1c47fd0f14c4340a9db0fe1 F test/tt3_index.c 39eec10a35f57672225be4d182862152896dee4a F test/tt3_lookaside1.c 0377e202c3c2a50d688cb65ba203afeda6fafeb9 F test/tt3_stress.c c57d804716165811d979d4a719e05baccd79277f @@ -1234,7 +1234,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 776648412c30dce206f1024ff849c2cb025bb006 -R d8ec23380207a0894ebd8ce1599deb6c -U dan -Z 8cab0a0cf2d75b3466c28901d182f0a0 +P 79693f0412ffb0486b974ee6c63b4231cfff5a77 +R 5cf8bac225464c2ed58e93713858c6ef +U drh +Z 61949e8b38696d2e4ed6889c396c567f diff --git a/manifest.uuid b/manifest.uuid index e8c8d8da23..cee491506b 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -79693f0412ffb0486b974ee6c63b4231cfff5a77 \ No newline at end of file +98cb56e2401ae7e113b071df8997ba62265821d3 \ No newline at end of file diff --git a/test/threadtest3.c b/test/threadtest3.c index ff8add5bf6..d700d7d47a 100644 --- a/test/threadtest3.c +++ b/test/threadtest3.c @@ -1,41 +1,41 @@ - /* +** 2010-07-22 +** +** The author disclaims copyright to this source code. In place of +** a legal notice, here is a blessing: +** +** May you do good and not evil. +** May you find forgiveness for yourself and forgive others. +** May you share freely, never taking more than you give. +** +************************************************************************* +** ** The code in this file runs a few multi-threaded test cases using the ** SQLite library. It can be compiled to an executable on unix using the ** following command: ** ** gcc -O2 threadtest3.c sqlite3.c -ldl -lpthread -lm ** -** Then run the compiled program. The exit status is non-zero if any tests -** failed (hopefully there is also some output to stdout to clarify what went -** wrong). +** Even though threadtest3.c is the only C source code file mentioned on +** the compiler command-line, #include macros are used to pull in additional +** C code files named "tt3_*.c". ** -** There are three parts to the code in this file, in the following order: +** After compiling, run this program with an optional argument telling +** which test to run. All tests are run if no argument is given. The +** argument can be a glob pattern to match multiple tests. Examples: ** -** 1. Code for the SQL aggregate function md5sum() copied from -** tclsqlite.c in the SQLite distribution. The names of all the -** types and functions in this section begin with "MD5" or "md5". +** ./a.out -- Run all tests +** ./a.out walthread3 -- Run the "walthread3" test +** ./a.out 'wal*' -- Run all of the wal* tests +** ./a.out --help -- List all available tests ** -** 2. A set of utility functions that may be used to implement -** multi-threaded test cases. These are all called by test code -** via macros that help with error reporting. The macros are defined -** immediately below this comment. -** -** 3. The test code itself. And a main() routine to drive the test -** code. +** The exit status is non-zero if any test fails. */ -/************************************************************************* -** Start of test code/infrastructure interface macros. -** -** The following macros constitute the interface between the test -** programs and the test infrastructure. Test infrastructure code -** does not itself use any of these macros. Test code should not -** call any of the macroname_x() functions directly. -** -** See the header comments above the corresponding macroname_x() -** function for a description of each interface. +/* +** The "Set Error Line" macro. */ +#define SEL(e) ((e)->iLine = ((e)->rc ? (e)->iLine : __LINE__)) /* Database functions */ #define opendb(w,x,y,z) (SEL(w), opendb_x(w,x,y,z)) @@ -391,9 +391,9 @@ static void md5finalize(sqlite3_context *context){ sqlite3_result_text(context, zBuf, -1, SQLITE_TRANSIENT); } -/************************************************************************* +/* ** End of copied md5sum() code. -*/ +**************************************************************************/ typedef sqlite3_int64 i64; @@ -448,7 +448,8 @@ static void free_err(Error *p){ static void print_err(Error *p){ if( p->rc!=SQLITE_OK ){ printf("Error: (%d) \"%s\" at line %d\n", p->rc, p->zErr, p->iLine); - nGlobalErr++; + if( sqlite3_strglob("* - no such table: *",p->zErr)!=0 ) nGlobalErr++; + fflush(stdout); } } @@ -785,6 +786,7 @@ static void join_all_threads_x( if( pErr->rc==SQLITE_OK ) system_error(pErr, rc); }else{ printf("Thread %d says: %s\n", p->iTid, (ret==0 ? "..." : (char *)ret)); + fflush(stdout); } sqlite3_free(p); } @@ -898,11 +900,6 @@ static int timetostop_x( return ret; } -/* -** The "Set Error Line" macro. -*/ -#define SEL(e) ((e)->iLine = ((e)->rc ? (e)->iLine : __LINE__)) - /************************************************************************* ************************************************************************** @@ -1427,9 +1424,9 @@ static void dynamic_triggers(int nMs){ int main(int argc, char **argv){ struct ThreadTest { - void (*xTest)(int); - const char *zTest; - int nMs; + void (*xTest)(int); /* Routine for running this test */ + const char *zTest; /* Name of this test */ + int nMs; /* How long to run this test, in milliseconds */ } aTest[] = { { walthread1, "walthread1", 20000 }, { walthread2, "walthread2", 20000 }, @@ -1452,7 +1449,7 @@ int main(int argc, char **argv){ }; int i; - int bTestfound = 0; + int nTestfound = 0; sqlite3_config(SQLITE_CONFIG_MULTITHREAD); sqlite3_config(SQLITE_CONFIG_MULTITHREAD); @@ -1468,12 +1465,13 @@ int main(int argc, char **argv){ } printf("Running %s for %d seconds...\n", z, aTest[i].nMs/1000); + fflush(stdout); aTest[i].xTest(aTest[i].nMs); - bTestfound++; + nTestfound++; } - if( bTestfound==0 ) goto usage; + if( nTestfound==0 ) goto usage; - printf("Total of %d errors across all tests\n", nGlobalErr); + printf("%d errors out of %d tests\n", nGlobalErr, nTestfound); return (nGlobalErr>0 ? 255 : 0); usage: @@ -1485,5 +1483,3 @@ int main(int argc, char **argv){ return 254; } - - diff --git a/test/tt3_checkpoint.c b/test/tt3_checkpoint.c index db237d6d9f..060a698211 100644 --- a/test/tt3_checkpoint.c +++ b/test/tt3_checkpoint.c @@ -1,5 +1,5 @@ /* -** 2001 September 15 +** 2011-02-02 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: @@ -146,5 +146,3 @@ static void checkpoint_starvation_2(int nMs){ } print_and_free_err(&err); } - - From 592bf7faf5a855a77b04abfeab3c66d5a5f3fa7b Mon Sep 17 00:00:00 2001 From: dan Date: Tue, 30 Dec 2014 19:58:31 +0000 Subject: [PATCH 33/54] Ensure that when a file is extended using FCNTL_SIZE_HINT the last page is allocated on disk, even if the file will only use part of it. FossilOrigin-Name: c7f84717d61197afa9e0ac607c4b349361e6e2b7 --- manifest | 14 +++++++------- manifest.uuid | 2 +- src/os_unix.c | 23 +++++++++++++---------- 3 files changed, 21 insertions(+), 18 deletions(-) diff --git a/manifest b/manifest index 6c2e6952e9..b8c410c164 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Update\sthe\sthreadtest3\stest\sprogram\sso\sthat\sits\soutput\ssummary\sis\s\ncompatible\swith\sreleasetest.tcl.\s\sIn\sthreadtest3,\sdo\snot\srecord\serrors\nthat\scontain\sthe\sstring\s"no\ssuch\stable"\sas\sbeing\sfatal\serrors,\ssince\sthey\nhappen\ssometimes\sin\sa\srace\scondition\sin\sstress1. -D 2014-12-30T19:26:07.267 +C Ensure\sthat\swhen\sa\sfile\sis\sextended\susing\sFCNTL_SIZE_HINT\sthe\slast\spage\sis\sallocated\son\sdisk,\seven\sif\sthe\sfile\swill\sonly\suse\spart\sof\sit. +D 2014-12-30T19:58:31.340 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 40326b6d788007dd5e00587c54adcd2621832bb3 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -213,7 +213,7 @@ F src/os.c 8fd25588eeba74068d41102d26810e216999b6c8 F src/os.h 3e57a24e2794a94d3cf2342c6d9a884888cd96bf F src/os_common.h 92815ed65f805560b66166e3583470ff94478f04 F src/os_setup.h c9d4553b5aaa6f73391448b265b89bed0b890faa -F src/os_unix.c 7f9ed5f05e4a9eb7275d1216e46d245d0cebfebb +F src/os_unix.c 08c0346d2ea5e5ffd5b1a796f9becf1976d648d7 F src/os_win.c 91d3d08e33ec0258d180d4c8255492f47d15e007 F src/os_win.h 09e751b20bbc107ffbd46e13555dc73576d88e21 F src/pager.c 2cbaf886a6157c53a8061ea7e677f81620ff46eb @@ -1234,7 +1234,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 79693f0412ffb0486b974ee6c63b4231cfff5a77 -R 5cf8bac225464c2ed58e93713858c6ef -U drh -Z 61949e8b38696d2e4ed6889c396c567f +P 98cb56e2401ae7e113b071df8997ba62265821d3 +R 42e94e61b93d775e47b58099deb363fd +U dan +Z 6763ecde934c72a96b9e8144b7d09293 diff --git a/manifest.uuid b/manifest.uuid index cee491506b..1e1eaa02a9 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -98cb56e2401ae7e113b071df8997ba62265821d3 \ No newline at end of file +c7f84717d61197afa9e0ac607c4b349361e6e2b7 \ No newline at end of file diff --git a/src/os_unix.c b/src/os_unix.c index 8314e4f678..f802d9cd19 100644 --- a/src/os_unix.c +++ b/src/os_unix.c @@ -3709,24 +3709,27 @@ static int fcntlSizeHint(unixFile *pFile, i64 nByte){ }while( err==EINTR ); if( err ) return SQLITE_IOERR_WRITE; #else - /* If the OS does not have posix_fallocate(), fake it. First use - ** ftruncate() to set the file size, then write a single byte to - ** the last byte in each block within the extended region. This - ** is the same technique used by glibc to implement posix_fallocate() - ** on systems that do not have a real fallocate() system call. + /* If the OS does not have posix_fallocate(), fake it. Write a + ** single byte to the last byte in each block that falls entirely + ** within the extended region. Then, if required, a single byte + ** at offset (nSize-1), to set the size of the file correctly. + ** This is a similar technique to that used by glibc on systems + ** that do not have a real fallocate() call. */ int nBlk = buf.st_blksize; /* File-system block size */ i64 iWrite; /* Next offset to write to */ iWrite = ((buf.st_size + 2*nBlk - 1)/nBlk)*nBlk-1; - while( iWrite=buf.st_size ); + assert( (iWrite/nBlk)==((buf.st_size+nBlk-1)/nBlk) ); + assert( ((iWrite+1)%nBlk)==0 ); + for(/*no-op*/; iWriteh, nSize) ){ - pFile->lastErrno = errno; - return unixLogError(SQLITE_IOERR_TRUNCATE, "ftruncate", pFile->zPath); + if( nSize%nBlk ){ + int nWrite = seekAndWrite(pFile, nSize-1, "", 1); + if( nWrite!=1 ) return SQLITE_IOERR_WRITE; } #endif } From bd41d566292dec6f65994b7f56a6d4f508222988 Mon Sep 17 00:00:00 2001 From: drh Date: Tue, 30 Dec 2014 20:40:32 +0000 Subject: [PATCH 34/54] Add the "mptester" tests to releasetest.tcl. FossilOrigin-Name: 93094a68d3a6178779878cbbe0e5e09ef31a323f --- Makefile.in | 5 +++++ manifest | 18 +++++++++--------- manifest.uuid | 2 +- mptest/mptest.c | 2 +- test/releasetest.tcl | 22 +++++++++++----------- 5 files changed, 27 insertions(+), 22 deletions(-) diff --git a/Makefile.in b/Makefile.in index 6867afcf52..cd024e950a 100644 --- a/Makefile.in +++ b/Makefile.in @@ -530,6 +530,11 @@ mptester$(EXE): sqlite3.c $(TOP)/mptest/mptest.c $(LTLINK) -o $@ -I. $(TOP)/mptest/mptest.c sqlite3.c \ $(TLIBS) -rpath "$(libdir)" +mptest: mptester$(EXE) + rm -f mptest1.db + ./mptester$(EXE) mptest1.db $(TOP)/mptest/crash01.test + rm -f mptest2.db + ./mptester$(EXE) mptest2.db $(TOP)/mptest/multiwrite01.test # This target creates a directory named "tsrc" and fills it with # copies of all of the C source code and header files needed to diff --git a/manifest b/manifest index b8c410c164..f0f77e4215 100644 --- a/manifest +++ b/manifest @@ -1,7 +1,7 @@ -C Ensure\sthat\swhen\sa\sfile\sis\sextended\susing\sFCNTL_SIZE_HINT\sthe\slast\spage\sis\sallocated\son\sdisk,\seven\sif\sthe\sfile\swill\sonly\suse\spart\sof\sit. -D 2014-12-30T19:58:31.340 +C Add\sthe\s"mptester"\stests\sto\sreleasetest.tcl. +D 2014-12-30T20:40:32.817 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f -F Makefile.in 40326b6d788007dd5e00587c54adcd2621832bb3 +F Makefile.in 7cd23e4fc91004a6bd081623e1bc6932e44828c0 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 F Makefile.msc b363b90fe1bfc3b87d190f2f728a126c00d9ce09 F Makefile.vxworks 034289efa9d591b04b1a73598623119c306cbba0 @@ -160,7 +160,7 @@ F mptest/config01.test 3c6adcbc50b991866855f1977ff172eb6d901271 F mptest/config02.test 4415dfe36c48785f751e16e32c20b077c28ae504 F mptest/crash01.test cce8e306d8596d5a2e497e27112dae1f6e5e3538 F mptest/crash02.subtest f4ef05adcd15d60e5d2bd654204f2c008b519df8 -F mptest/mptest.c 499a74af4be293b7c1c7c3d40f332b67227dd739 +F mptest/mptest.c 24c5f72415df2eab7088ef8c9f99f163aed590c8 F mptest/multiwrite01.test 499ad0310da8dff8e8f98d2e272fc2a8aa741b2e F spec.template 86a4a43b99ebb3e75e6b9a735d5fd293a24e90ca F sqlite.pc.in 42b7bf0d02e08b9e77734a47798d1a55a9e0716b @@ -801,7 +801,7 @@ F test/randexpr1.test eda062a97e60f9c38ae8d806b03b0ddf23d796df F test/rdonly.test dd30a4858d8e0fbad2304c2bd74a33d4df36412a F test/regexp1.test 497ea812f264d12b6198d6e50a76be4a1973a9d8 F test/reindex.test 44edd3966b474468b823d481eafef0c305022254 -F test/releasetest.tcl 3ffd8d99da7a087917f057147053ed35ce1bf90b +F test/releasetest.tcl 8f35e5073901e48a634a649462fa2e7e522e9dc0 F test/resolver01.test 33abf37ff8335e6bf98f2b45a0af3e06996ccd9a F test/rollback.test 458fe73eb3ffdfdf9f6ba3e9b7350a6220414dea F test/rollback2.test fc14cf6d1a2b250d2735ef16124b971bce152f14 @@ -1234,7 +1234,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 98cb56e2401ae7e113b071df8997ba62265821d3 -R 42e94e61b93d775e47b58099deb363fd -U dan -Z 6763ecde934c72a96b9e8144b7d09293 +P c7f84717d61197afa9e0ac607c4b349361e6e2b7 +R 0933bc5647d1041ce6d28bf44cb1ff01 +U drh +Z 8ac9cef8267dc35aa4f2371bf41435dc diff --git a/manifest.uuid b/manifest.uuid index 1e1eaa02a9..daccc74158 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -c7f84717d61197afa9e0ac607c4b349361e6e2b7 \ No newline at end of file +93094a68d3a6178779878cbbe0e5e09ef31a323f \ No newline at end of file diff --git a/mptest/mptest.c b/mptest/mptest.c index 059ae102fa..7b56b61902 100644 --- a/mptest/mptest.c +++ b/mptest/mptest.c @@ -1395,7 +1395,7 @@ int main(int argc, char **argv){ maybeClose(g.pLog); maybeClose(g.pErrLog); if( iClient==0 ){ - printf("Summary: %d errors in %d tests\n", g.nError, g.nTest); + printf("Summary: %d errors out of %d tests\n", g.nError, g.nTest); } return g.nError>0; } diff --git a/test/releasetest.tcl b/test/releasetest.tcl index bcd7d3d060..e2311d8f9c 100644 --- a/test/releasetest.tcl +++ b/test/releasetest.tcl @@ -158,7 +158,7 @@ array set ::Configs { array set ::Platforms { Linux-x86_64 { "Check-Symbols" checksymbols - "Debug-One" test + "Debug-One" "mptest test" "Secure-Delete" test "Unlock-Notify" "QUICKTEST_INCLUDE=notify2.test test" "Update-Delete-Limit" test @@ -178,11 +178,11 @@ array set ::Platforms { "Default" "threadtest fulltest" } Darwin-i386 { - "Locking-Style" test + "Locking-Style" "mptest test" "OS-X" "threadtest fulltest" } "Windows NT-intel" { - "Default" "fulltestonly" + "Default" "mptest fulltestonly" } } @@ -214,7 +214,7 @@ proc count_tests_and_errors {logfile rcVar errmsgVar} { set seen 0 while {![eof $fd]} { set line [gets $fd] - if {[regexp {^(\d+) errors out of (\d+) tests} $line all nerr ntest]} { + if {[regexp {(\d+) errors out of (\d+) tests} $line all nerr ntest]} { incr ::NERRCASE $nerr incr ::NTESTCASE $ntest set seen 1 @@ -222,7 +222,6 @@ proc count_tests_and_errors {logfile rcVar errmsgVar} { set rc 1 set errmsg $line } - break; } } close $fd @@ -457,16 +456,17 @@ proc main {argv} { # add it and run veryquick.test. if {$target!="checksymbols" && !$::BUILDONLY} { set debug_idx [lsearch -glob $config_options -DSQLITE_DEBUG*] + set xtarget $target + regsub -all {fulltest[a-z]+} $xtarget test xtarget if {$debug_idx < 0} { incr NTEST - run_test_suite "${zConfig}_debug" test [ - concat $config_options -DSQLITE_DEBUG=1 - ] + append config_options " -DSQLITE_DEBUG=1" + run_test_suite "${zConfig}_debug" $xtarget $config_options } else { incr NTEST - run_test_suite "${zConfig}_ndebug" test [ - lreplace $config_options $debug_idx $debug_idx - ] + regsub { *-DSQLITE_MEMDEBUG[^ ]* *} $config_options { } config_options + regsub { *-DSQLITE_DEBUG[^ ]* *} $config_options { } config_options + run_test_suite "${zConfig}_ndebug" $xtarget $config_options } } } From e895b873894149268b661c14cd93adcafb5eee4e Mon Sep 17 00:00:00 2001 From: dan Date: Wed, 31 Dec 2014 09:52:15 +0000 Subject: [PATCH 35/54] Do not run pragma3.test as part of the mmap permutation. FossilOrigin-Name: 94101011966243d599519a69c99c202ea31b928d --- manifest | 14 +++++++------- manifest.uuid | 2 +- test/permutations.test | 8 ++++++-- 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/manifest b/manifest index f0f77e4215..9942d4b320 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Add\sthe\s"mptester"\stests\sto\sreleasetest.tcl. -D 2014-12-30T20:40:32.817 +C Do\snot\srun\spragma3.test\sas\spart\sof\sthe\smmap\spermutation. +D 2014-12-31T09:52:15.410 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 7cd23e4fc91004a6bd081623e1bc6932e44828c0 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -782,7 +782,7 @@ F test/pagesize.test 1dd51367e752e742f58e861e65ed7390603827a0 F test/pcache.test b09104b03160aca0d968d99e8cd2c5b1921a993d F test/pcache2.test a83efe2dec0d392f814bfc998def1d1833942025 F test/percentile.test b98fc868d71eb5619d42a1702e9ab91718cbed54 -F test/permutations.test d408cd2d48e7a61c9c51ae528d94c3c48ce97477 +F test/permutations.test e1c603ec095e29de3d1f1566d704ea270f9c3f89 F test/pragma.test aa16dedfe01c02c8895169012f7dfde9c163f0d5 F test/pragma2.test aea7b3d82c76034a2df2b38a13745172ddc0bc13 F test/pragma3.test 0ca2aea1499a7c2dcee235419e520d825dac958d @@ -1234,7 +1234,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P c7f84717d61197afa9e0ac607c4b349361e6e2b7 -R 0933bc5647d1041ce6d28bf44cb1ff01 -U drh -Z 8ac9cef8267dc35aa4f2371bf41435dc +P 93094a68d3a6178779878cbbe0e5e09ef31a323f +R 568e484006de3cb2669a32ac139fa8fe +U dan +Z 9ed2b5eb1c7f4568141d7b75c646d319 diff --git a/manifest.uuid b/manifest.uuid index daccc74158..9a0f1e309b 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -93094a68d3a6178779878cbbe0e5e09ef31a323f \ No newline at end of file +94101011966243d599519a69c99c202ea31b928d \ No newline at end of file diff --git a/test/permutations.test b/test/permutations.test index 63f8dc589e..28572ca0a7 100644 --- a/test/permutations.test +++ b/test/permutations.test @@ -141,11 +141,15 @@ test_suite "veryquick" -prefix "" -description { ] test_suite "mmap" -prefix "mm-" -description { - Similar to veryquick. Except with memory mapping disabled. + Similar to veryquick. Except with memory mapping enabled. } -presql { pragma mmap_size = 268435456; } -files [ - test_set $allquicktests -exclude *malloc* *ioerr* *fault* -include malloc.test + # Do not run pragma3.test, as it depends on the values returned by + # "PRAGMA data_version". And if mmap is being used these are often, + # but not always, one greater than if it were not. + test_set $allquicktests -exclude *malloc* *ioerr* *fault* pragma3.test \ + -include malloc.test ] test_suite "valgrind" -prefix "" -description { From 542d55865cb1ec11421783060212b4b13e9f96e4 Mon Sep 17 00:00:00 2001 From: drh Date: Wed, 31 Dec 2014 14:18:48 +0000 Subject: [PATCH 36/54] Make sure PRAGMA data_version is updated even if the cache is empty when another connection changes the database. FossilOrigin-Name: cf48eb608af9102a8def2a5b7f5f7b348548116f --- manifest | 16 ++++++++-------- manifest.uuid | 2 +- src/pager.c | 21 ++++++++++----------- test/pragma3.test | 1 + 4 files changed, 20 insertions(+), 20 deletions(-) diff --git a/manifest b/manifest index 9942d4b320..18d0f09e4c 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Do\snot\srun\spragma3.test\sas\spart\sof\sthe\smmap\spermutation. -D 2014-12-31T09:52:15.410 +C Make\ssure\sPRAGMA\sdata_version\sis\supdated\seven\sif\sthe\scache\sis\sempty\swhen\nanother\sconnection\schanges\sthe\sdatabase. +D 2014-12-31T14:18:48.679 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 7cd23e4fc91004a6bd081623e1bc6932e44828c0 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -216,7 +216,7 @@ F src/os_setup.h c9d4553b5aaa6f73391448b265b89bed0b890faa F src/os_unix.c 08c0346d2ea5e5ffd5b1a796f9becf1976d648d7 F src/os_win.c 91d3d08e33ec0258d180d4c8255492f47d15e007 F src/os_win.h 09e751b20bbc107ffbd46e13555dc73576d88e21 -F src/pager.c 2cbaf886a6157c53a8061ea7e677f81620ff46eb +F src/pager.c 4120a49ecd37697e28f5ed807f470b9c0b88410c F src/pager.h c3476e7c89cdf1c6914e50a11f3714e30b4e0a77 F src/parse.y 5dfead8aed90cb0c7c1115898ee2266804daff45 F src/pcache.c b83d160ce81ca101f98f0d27498e6d6bd49f1599 @@ -785,7 +785,7 @@ F test/percentile.test b98fc868d71eb5619d42a1702e9ab91718cbed54 F test/permutations.test e1c603ec095e29de3d1f1566d704ea270f9c3f89 F test/pragma.test aa16dedfe01c02c8895169012f7dfde9c163f0d5 F test/pragma2.test aea7b3d82c76034a2df2b38a13745172ddc0bc13 -F test/pragma3.test 0ca2aea1499a7c2dcee235419e520d825dac958d +F test/pragma3.test 6f849ccffeee7e496d2f2b5e74152306c0b8757c F test/printf.test ec9870c4dce8686a37818e0bf1aba6e6a1863552 F test/printf2.test b4acd4bf8734243257f01ddefa17c4fb090acc8a F test/progress.test a282973d1d17f08071bc58a77d6b80f2a81c354d @@ -1234,7 +1234,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 93094a68d3a6178779878cbbe0e5e09ef31a323f -R 568e484006de3cb2669a32ac139fa8fe -U dan -Z 9ed2b5eb1c7f4568141d7b75c646d319 +P 94101011966243d599519a69c99c202ea31b928d +R ce88be0f3eb17006a4da57569dcf8731 +U drh +Z eb99526801ba8c2c5e7e84b0513387c7 diff --git a/manifest.uuid b/manifest.uuid index 9a0f1e309b..a48eb47585 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -94101011966243d599519a69c99c202ea31b928d \ No newline at end of file +cf48eb608af9102a8def2a5b7f5f7b348548116f \ No newline at end of file diff --git a/src/pager.c b/src/pager.c index 67b95f7186..2230174e5c 100644 --- a/src/pager.c +++ b/src/pager.c @@ -647,6 +647,7 @@ struct Pager { u8 doNotSpill; /* Do not spill the cache when non-zero */ u8 subjInMemory; /* True to use in-memory sub-journals */ u8 bUseFetch; /* True to use xFetch() */ + u8 hasBeenUsed; /* True if any content previously read from this pager*/ Pgno dbSize; /* Number of pages in the database */ Pgno dbOrigSize; /* dbSize before the current transaction */ Pgno dbFileSize; /* Number of pages in the database file */ @@ -3897,7 +3898,7 @@ static int pagerAcquireMapPage( PgHdr **ppPage /* OUT: Acquired page object */ ){ PgHdr *p; /* Memory mapped page to return */ - + if( pPager->pMmapFreelist ){ *ppPage = p = pPager->pMmapFreelist; pPager->pMmapFreelist = p->pDirty; @@ -5128,16 +5129,12 @@ int sqlite3PagerSharedLock(Pager *pPager){ ); } - if( !pPager->tempFile && ( - pPager->pBackup - || sqlite3PcachePagecount(pPager->pPCache)>0 - || USEFETCH(pPager) - )){ - /* The shared-lock has just been acquired on the database file - ** and there are already pages in the cache (from a previous - ** read or write transaction). Check to see if the database - ** has been modified. If the database has changed, flush the - ** cache. + if( !pPager->tempFile && pPager->hasBeenUsed ){ + /* The shared-lock has just been acquired then check to + ** see if the database has been modified. If the database has changed, + ** flush the cache. The pPager->hasBeenUsed flag prevents this from + ** occurring on the very first access to a file, in order to save a + ** single unnecessary sqlite3OsRead() call at the start-up. ** ** Database changes is detected by looking at 15 bytes beginning ** at offset 24 into the file. The first 4 of these 16 bytes are @@ -5302,6 +5299,7 @@ int sqlite3PagerAcquire( if( pgno==0 ){ return SQLITE_CORRUPT_BKPT; } + pPager->hasBeenUsed = 1; /* If the pager is in the error state, return an error immediately. ** Otherwise, request the page from the PCache layer. */ @@ -5451,6 +5449,7 @@ DbPage *sqlite3PagerLookup(Pager *pPager, Pgno pgno){ assert( pgno!=0 ); assert( pPager->pPCache!=0 ); pPage = sqlite3PcacheFetch(pPager->pPCache, pgno, 0); + assert( pPage==0 || pPager->hasBeenUsed ); return sqlite3PcacheFetchFinish(pPager->pPCache, pgno, pPage); } diff --git a/test/pragma3.test b/test/pragma3.test index 4654578df2..b7ea4d3fc6 100644 --- a/test/pragma3.test +++ b/test/pragma3.test @@ -64,6 +64,7 @@ do_execsql_test pragma3-130 { COMMIT; SELECT * FROM t1; PRAGMA data_version; + PRAGMA shrink_memory; } {1 1 1 100 200 300 400 500 1} # EVIDENCE-OF: R-63005-41812 The integer values returned by two From c67d650264c37d024074736a451ba48480b0c4d2 Mon Sep 17 00:00:00 2001 From: drh Date: Wed, 31 Dec 2014 15:14:29 +0000 Subject: [PATCH 37/54] Change the width of output lines in releasetest.tcl from 70 to 79 characters. FossilOrigin-Name: a468d96700c05d1a01a745930d13ce89c09ce4fa --- manifest | 12 ++++++------ manifest.uuid | 2 +- test/releasetest.tcl | 7 ++++--- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/manifest b/manifest index 18d0f09e4c..847c4e9ac3 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Make\ssure\sPRAGMA\sdata_version\sis\supdated\seven\sif\sthe\scache\sis\sempty\swhen\nanother\sconnection\schanges\sthe\sdatabase. -D 2014-12-31T14:18:48.679 +C Change\sthe\swidth\sof\soutput\slines\sin\sreleasetest.tcl\sfrom\s70\sto\s79\scharacters. +D 2014-12-31T15:14:29.242 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 7cd23e4fc91004a6bd081623e1bc6932e44828c0 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -801,7 +801,7 @@ F test/randexpr1.test eda062a97e60f9c38ae8d806b03b0ddf23d796df F test/rdonly.test dd30a4858d8e0fbad2304c2bd74a33d4df36412a F test/regexp1.test 497ea812f264d12b6198d6e50a76be4a1973a9d8 F test/reindex.test 44edd3966b474468b823d481eafef0c305022254 -F test/releasetest.tcl 8f35e5073901e48a634a649462fa2e7e522e9dc0 +F test/releasetest.tcl fad4402d19b94021a3a9032b7b4a9855bf1ef498 F test/resolver01.test 33abf37ff8335e6bf98f2b45a0af3e06996ccd9a F test/rollback.test 458fe73eb3ffdfdf9f6ba3e9b7350a6220414dea F test/rollback2.test fc14cf6d1a2b250d2735ef16124b971bce152f14 @@ -1234,7 +1234,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 94101011966243d599519a69c99c202ea31b928d -R ce88be0f3eb17006a4da57569dcf8731 +P cf48eb608af9102a8def2a5b7f5f7b348548116f +R 0eaceead134311c4ebac703045ebc24b U drh -Z eb99526801ba8c2c5e7e84b0513387c7 +Z b3362a619542185f9ea20d6df6dfbfd7 diff --git a/manifest.uuid b/manifest.uuid index a48eb47585..f7f3930580 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -cf48eb608af9102a8def2a5b7f5f7b348548116f \ No newline at end of file +a468d96700c05d1a01a745930d13ce89c09ce4fa \ No newline at end of file diff --git a/test/releasetest.tcl b/test/releasetest.tcl index e2311d8f9c..8b97f7f4f3 100644 --- a/test/releasetest.tcl +++ b/test/releasetest.tcl @@ -133,6 +133,7 @@ array set ::Configs { -DSQLITE_MAX_VARIABLE_NUMBER=500000 -DSQLITE_DEBUG=1 -DSQLITE_PREFER_PROXY_LOCKING=1 + -DSQLITE_ENABLE_API_ARMOR=1 } "Extra-Robustness" { -DSQLITE_ENABLE_OVERSIZE_CELL_CHECK=1 @@ -265,7 +266,7 @@ proc run_test_suite {name testtarget config} { if {!$::DRYRUN} { set title ${name}($testtarget) set n [string length $title] - puts -nonewline "${title}[string repeat . [expr {54-$n}]]" + puts -nonewline "${title}[string repeat . [expr {63-$n}]]" flush stdout } @@ -436,7 +437,7 @@ proc main {argv} { # Process any command line options. process_options $argv - puts [string repeat * 70] + puts [string repeat * 79] set ::NERR 0 set ::NTEST 0 @@ -476,7 +477,7 @@ proc main {argv} { set min [expr {($elapsetime/60)%60}] set sec [expr {$elapsetime%60}] set etime [format (%02d:%02d:%02d) $hr $min $sec] - puts [string repeat * 70] + puts [string repeat * 79] puts "$::NERRCASE failures of $::NTESTCASE tests run in $etime" } From 23f8a7cd2f7f035fe2abfd19a75d6fc98c742e9f Mon Sep 17 00:00:00 2001 From: dan Date: Wed, 31 Dec 2014 18:08:46 +0000 Subject: [PATCH 38/54] Do run pragma3.test as part of the mmap permutation. As it works as of [cf48eb608a]. FossilOrigin-Name: 11057e2645d92876fd0fb6d702757408077b7354 --- manifest | 14 +++++++------- manifest.uuid | 2 +- test/permutations.test | 6 +----- 3 files changed, 9 insertions(+), 13 deletions(-) diff --git a/manifest b/manifest index 847c4e9ac3..c70155dc52 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Change\sthe\swidth\sof\soutput\slines\sin\sreleasetest.tcl\sfrom\s70\sto\s79\scharacters. -D 2014-12-31T15:14:29.242 +C Do\srun\spragma3.test\sas\spart\sof\sthe\smmap\spermutation.\sAs\sit\sworks\sas\sof\s[cf48eb608a]. +D 2014-12-31T18:08:46.501 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 7cd23e4fc91004a6bd081623e1bc6932e44828c0 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -782,7 +782,7 @@ F test/pagesize.test 1dd51367e752e742f58e861e65ed7390603827a0 F test/pcache.test b09104b03160aca0d968d99e8cd2c5b1921a993d F test/pcache2.test a83efe2dec0d392f814bfc998def1d1833942025 F test/percentile.test b98fc868d71eb5619d42a1702e9ab91718cbed54 -F test/permutations.test e1c603ec095e29de3d1f1566d704ea270f9c3f89 +F test/permutations.test 59e2d8aba8c4f5842edba1a10a158b798690d3ba F test/pragma.test aa16dedfe01c02c8895169012f7dfde9c163f0d5 F test/pragma2.test aea7b3d82c76034a2df2b38a13745172ddc0bc13 F test/pragma3.test 6f849ccffeee7e496d2f2b5e74152306c0b8757c @@ -1234,7 +1234,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P cf48eb608af9102a8def2a5b7f5f7b348548116f -R 0eaceead134311c4ebac703045ebc24b -U drh -Z b3362a619542185f9ea20d6df6dfbfd7 +P a468d96700c05d1a01a745930d13ce89c09ce4fa +R 2124f8dd0c13e87cf432312e601e89d3 +U dan +Z 1d23743f5f5d9d87deea6bb5afeffc32 diff --git a/manifest.uuid b/manifest.uuid index f7f3930580..61668af109 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -a468d96700c05d1a01a745930d13ce89c09ce4fa \ No newline at end of file +11057e2645d92876fd0fb6d702757408077b7354 \ No newline at end of file diff --git a/test/permutations.test b/test/permutations.test index 28572ca0a7..fea70a60e8 100644 --- a/test/permutations.test +++ b/test/permutations.test @@ -145,11 +145,7 @@ test_suite "mmap" -prefix "mm-" -description { } -presql { pragma mmap_size = 268435456; } -files [ - # Do not run pragma3.test, as it depends on the values returned by - # "PRAGMA data_version". And if mmap is being used these are often, - # but not always, one greater than if it were not. - test_set $allquicktests -exclude *malloc* *ioerr* *fault* pragma3.test \ - -include malloc.test + test_set $allquicktests -exclude *malloc* *ioerr* *fault* -include malloc.test ] test_suite "valgrind" -prefix "" -description { From fb212d02c51c3f9beaa7ac60858ee13fd6618a4c Mon Sep 17 00:00:00 2001 From: drh Date: Wed, 31 Dec 2014 18:10:07 +0000 Subject: [PATCH 39/54] Only run walthread5 once when running all tests in threadtest3. FossilOrigin-Name: ca2e4a5b22e1dc9ea79f77853e328d401138f747 --- manifest | 14 +++++++------- manifest.uuid | 2 +- test/threadtest3.c | 1 - 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/manifest b/manifest index c70155dc52..de184d9294 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Do\srun\spragma3.test\sas\spart\sof\sthe\smmap\spermutation.\sAs\sit\sworks\sas\sof\s[cf48eb608a]. -D 2014-12-31T18:08:46.501 +C Only\srun\swalthread5\sonce\swhen\srunning\sall\stests\sin\sthreadtest3. +D 2014-12-31T18:10:07.569 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 7cd23e4fc91004a6bd081623e1bc6932e44828c0 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -914,7 +914,7 @@ F test/thread2.test f35d2106452b77523b3a2b7d1dcde2e5ee8f9e46 F test/thread_common.tcl 334639cadcb9f912bf82aa73f49efd5282e6cadd F test/threadtest1.c 6029d9c5567db28e6dc908a0c63099c3ba6c383b F test/threadtest2.c ace893054fa134af3fc8d6e7cfecddb8e3acefb9 -F test/threadtest3.c 66c2693d888f9ed256d54d70dd60f569d92c12cf +F test/threadtest3.c 7bbedc9df2b8fb0a3f75c5f2f66941c7f18ce1db F test/threadtest4.c c1e67136ceb6c7ec8184e56ac61db28f96bd2925 F test/tkt-02a8e81d44.test 6c80d9c7514e2a42d4918bf87bf6bc54f379110c F test/tkt-26ff0c2d1e.test 888324e751512972c6e0d1a09df740d8f5aaf660 @@ -1234,7 +1234,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P a468d96700c05d1a01a745930d13ce89c09ce4fa -R 2124f8dd0c13e87cf432312e601e89d3 -U dan -Z 1d23743f5f5d9d87deea6bb5afeffc32 +P 11057e2645d92876fd0fb6d702757408077b7354 +R 977b3277256e94a381a08f38ec63eac7 +U drh +Z 206269a2c6d9b5759d40a6ff53cbafad diff --git a/manifest.uuid b/manifest.uuid index 61668af109..de99444ace 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -11057e2645d92876fd0fb6d702757408077b7354 \ No newline at end of file +ca2e4a5b22e1dc9ea79f77853e328d401138f747 \ No newline at end of file diff --git a/test/threadtest3.c b/test/threadtest3.c index d700d7d47a..9d7edd18cd 100644 --- a/test/threadtest3.c +++ b/test/threadtest3.c @@ -1433,7 +1433,6 @@ int main(int argc, char **argv){ { walthread3, "walthread3", 20000 }, { walthread4, "walthread4", 20000 }, { walthread5, "walthread5", 1000 }, - { walthread5, "walthread5", 1000 }, { cgt_pager_1, "cgt_pager_1", 0 }, { dynamic_triggers, "dynamic_triggers", 20000 }, From b8a9d8db872b048e30440de359176f87a32906f0 Mon Sep 17 00:00:00 2001 From: dan Date: Wed, 31 Dec 2014 18:25:21 +0000 Subject: [PATCH 40/54] Add a missing sqlite3_close() call to threadtest3.c. FossilOrigin-Name: a65a44f3ff851b71c9a79e96b9575c6a7006d2dd --- manifest | 14 +++++++------- manifest.uuid | 2 +- test/threadtest3.c | 1 + 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/manifest b/manifest index de184d9294..5e3ede2339 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Only\srun\swalthread5\sonce\swhen\srunning\sall\stests\sin\sthreadtest3. -D 2014-12-31T18:10:07.569 +C Add\sa\smissing\ssqlite3_close()\scall\sto\sthreadtest3.c. +D 2014-12-31T18:25:21.460 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 7cd23e4fc91004a6bd081623e1bc6932e44828c0 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -914,7 +914,7 @@ F test/thread2.test f35d2106452b77523b3a2b7d1dcde2e5ee8f9e46 F test/thread_common.tcl 334639cadcb9f912bf82aa73f49efd5282e6cadd F test/threadtest1.c 6029d9c5567db28e6dc908a0c63099c3ba6c383b F test/threadtest2.c ace893054fa134af3fc8d6e7cfecddb8e3acefb9 -F test/threadtest3.c 7bbedc9df2b8fb0a3f75c5f2f66941c7f18ce1db +F test/threadtest3.c 14aa134981cffb4deefe8acf1154b9fa6b6cdf78 F test/threadtest4.c c1e67136ceb6c7ec8184e56ac61db28f96bd2925 F test/tkt-02a8e81d44.test 6c80d9c7514e2a42d4918bf87bf6bc54f379110c F test/tkt-26ff0c2d1e.test 888324e751512972c6e0d1a09df740d8f5aaf660 @@ -1234,7 +1234,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 11057e2645d92876fd0fb6d702757408077b7354 -R 977b3277256e94a381a08f38ec63eac7 -U drh -Z 206269a2c6d9b5759d40a6ff53cbafad +P ca2e4a5b22e1dc9ea79f77853e328d401138f747 +R b1064b21ce1900d12ee259ac9e26c073 +U dan +Z aa685526ef0fa03163cab11b3ca440f6 diff --git a/manifest.uuid b/manifest.uuid index de99444ace..1b893c5708 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -ca2e4a5b22e1dc9ea79f77853e328d401138f747 \ No newline at end of file +a65a44f3ff851b71c9a79e96b9575c6a7006d2dd \ No newline at end of file diff --git a/test/threadtest3.c b/test/threadtest3.c index 9d7edd18cd..cc51447804 100644 --- a/test/threadtest3.c +++ b/test/threadtest3.c @@ -981,6 +981,7 @@ static void walthread1(int nMs){ "INSERT INTO t1 VALUES(randomblob(100));" "INSERT INTO t1 SELECT md5sum(x) FROM t1;" ); + closedb(&err, &db); setstoptime(&err, nMs); for(i=0; i Date: Wed, 31 Dec 2014 18:28:59 +0000 Subject: [PATCH 41/54] Update the command-line parsing for threadtest3 so that tests are run in the order they are specified on the command-line. FossilOrigin-Name: f489bc31165f043dc10570e6c1250a292673660e --- manifest | 14 +++++++------- manifest.uuid | 2 +- test/threadtest3.c | 38 +++++++++++++++++++++----------------- 3 files changed, 29 insertions(+), 25 deletions(-) diff --git a/manifest b/manifest index 5e3ede2339..c3a71d4329 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Add\sa\smissing\ssqlite3_close()\scall\sto\sthreadtest3.c. -D 2014-12-31T18:25:21.460 +C Update\sthe\scommand-line\sparsing\sfor\sthreadtest3\sso\sthat\stests\sare\srun\sin\sthe\norder\sthey\sare\sspecified\son\sthe\scommand-line. +D 2014-12-31T18:28:59.230 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 7cd23e4fc91004a6bd081623e1bc6932e44828c0 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -914,7 +914,7 @@ F test/thread2.test f35d2106452b77523b3a2b7d1dcde2e5ee8f9e46 F test/thread_common.tcl 334639cadcb9f912bf82aa73f49efd5282e6cadd F test/threadtest1.c 6029d9c5567db28e6dc908a0c63099c3ba6c383b F test/threadtest2.c ace893054fa134af3fc8d6e7cfecddb8e3acefb9 -F test/threadtest3.c 14aa134981cffb4deefe8acf1154b9fa6b6cdf78 +F test/threadtest3.c 7331b9f7f79e4b22341dc87a4ee7074a8a62ad7f F test/threadtest4.c c1e67136ceb6c7ec8184e56ac61db28f96bd2925 F test/tkt-02a8e81d44.test 6c80d9c7514e2a42d4918bf87bf6bc54f379110c F test/tkt-26ff0c2d1e.test 888324e751512972c6e0d1a09df740d8f5aaf660 @@ -1234,7 +1234,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P ca2e4a5b22e1dc9ea79f77853e328d401138f747 -R b1064b21ce1900d12ee259ac9e26c073 -U dan -Z aa685526ef0fa03163cab11b3ca440f6 +P a65a44f3ff851b71c9a79e96b9575c6a7006d2dd +R f32e62f7b458009e8ff83ca7f7bb9ebe +U drh +Z 7baa195e642be2449fd61a3f6b6a2b7e diff --git a/manifest.uuid b/manifest.uuid index 1b893c5708..906c60ab4e 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -a65a44f3ff851b71c9a79e96b9575c6a7006d2dd \ No newline at end of file +f489bc31165f043dc10570e6c1250a292673660e \ No newline at end of file diff --git a/test/threadtest3.c b/test/threadtest3.c index cc51447804..edc56527d2 100644 --- a/test/threadtest3.c +++ b/test/threadtest3.c @@ -1447,27 +1447,31 @@ int main(int argc, char **argv){ { stress1, "stress1", 10000 }, { stress2, "stress2", 60000 }, }; - - int i; + static char *substArgv[] = { 0, "*", 0 }; + int i, iArg; int nTestfound = 0; sqlite3_config(SQLITE_CONFIG_MULTITHREAD); - sqlite3_config(SQLITE_CONFIG_MULTITHREAD); - - for(i=0; i1 ){ - int iArg; - for(iArg=1; iArg=sizeof(aTest)/sizeof(aTest[0]) ) goto usage; + } + for(iArg=1; iArg Date: Wed, 31 Dec 2014 18:55:09 +0000 Subject: [PATCH 42/54] Change threadtest3.c so that SQLITE_SCHEMA returns result in warnings not hard errors. Add the Darwin-x86_64 platform to releasetest.tcl. FossilOrigin-Name: b09a139c9e2e1a45a3d53395ac1376e952d459e5 --- manifest | 14 +++++++------- manifest.uuid | 2 +- test/releasetest.tcl | 4 ++++ test/threadtest3.c | 8 ++++++-- 4 files changed, 18 insertions(+), 10 deletions(-) diff --git a/manifest b/manifest index c3a71d4329..f3e7704fed 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Update\sthe\scommand-line\sparsing\sfor\sthreadtest3\sso\sthat\stests\sare\srun\sin\sthe\norder\sthey\sare\sspecified\son\sthe\scommand-line. -D 2014-12-31T18:28:59.230 +C Change\sthreadtest3.c\sso\sthat\sSQLITE_SCHEMA\sreturns\sresult\sin\swarnings\nnot\shard\serrors.\s\sAdd\sthe\sDarwin-x86_64\splatform\sto\sreleasetest.tcl. +D 2014-12-31T18:55:09.661 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 7cd23e4fc91004a6bd081623e1bc6932e44828c0 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -801,7 +801,7 @@ F test/randexpr1.test eda062a97e60f9c38ae8d806b03b0ddf23d796df F test/rdonly.test dd30a4858d8e0fbad2304c2bd74a33d4df36412a F test/regexp1.test 497ea812f264d12b6198d6e50a76be4a1973a9d8 F test/reindex.test 44edd3966b474468b823d481eafef0c305022254 -F test/releasetest.tcl fad4402d19b94021a3a9032b7b4a9855bf1ef498 +F test/releasetest.tcl f8845aae7b19f0c5418b27bf7723da84a336d0d5 F test/resolver01.test 33abf37ff8335e6bf98f2b45a0af3e06996ccd9a F test/rollback.test 458fe73eb3ffdfdf9f6ba3e9b7350a6220414dea F test/rollback2.test fc14cf6d1a2b250d2735ef16124b971bce152f14 @@ -914,7 +914,7 @@ F test/thread2.test f35d2106452b77523b3a2b7d1dcde2e5ee8f9e46 F test/thread_common.tcl 334639cadcb9f912bf82aa73f49efd5282e6cadd F test/threadtest1.c 6029d9c5567db28e6dc908a0c63099c3ba6c383b F test/threadtest2.c ace893054fa134af3fc8d6e7cfecddb8e3acefb9 -F test/threadtest3.c 7331b9f7f79e4b22341dc87a4ee7074a8a62ad7f +F test/threadtest3.c 9ab4b168681c3a6f70f6c833ba08e0d48dd4af9b F test/threadtest4.c c1e67136ceb6c7ec8184e56ac61db28f96bd2925 F test/tkt-02a8e81d44.test 6c80d9c7514e2a42d4918bf87bf6bc54f379110c F test/tkt-26ff0c2d1e.test 888324e751512972c6e0d1a09df740d8f5aaf660 @@ -1234,7 +1234,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P a65a44f3ff851b71c9a79e96b9575c6a7006d2dd -R f32e62f7b458009e8ff83ca7f7bb9ebe +P f489bc31165f043dc10570e6c1250a292673660e +R fb381e088e2268612fdb185243c3a797 U drh -Z 7baa195e642be2449fd61a3f6b6a2b7e +Z 09baa910ae3dee28dd8ef1c911c03495 diff --git a/manifest.uuid b/manifest.uuid index 906c60ab4e..5518ac9017 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -f489bc31165f043dc10570e6c1250a292673660e \ No newline at end of file +b09a139c9e2e1a45a3d53395ac1376e952d459e5 \ No newline at end of file diff --git a/test/releasetest.tcl b/test/releasetest.tcl index 8b97f7f4f3..cfd0ba900f 100644 --- a/test/releasetest.tcl +++ b/test/releasetest.tcl @@ -182,6 +182,10 @@ array set ::Platforms { "Locking-Style" "mptest test" "OS-X" "threadtest fulltest" } + Darwin-x86_64 { + "Locking-Style" "mptest test" + "OS-X" "threadtest fulltest" + } "Windows NT-intel" { "Default" "mptest fulltestonly" } diff --git a/test/threadtest3.c b/test/threadtest3.c index edc56527d2..25caeb89f9 100644 --- a/test/threadtest3.c +++ b/test/threadtest3.c @@ -447,8 +447,12 @@ static void free_err(Error *p){ static void print_err(Error *p){ if( p->rc!=SQLITE_OK ){ - printf("Error: (%d) \"%s\" at line %d\n", p->rc, p->zErr, p->iLine); - if( sqlite3_strglob("* - no such table: *",p->zErr)!=0 ) nGlobalErr++; + int isWarn = 0; + if( p->rc==SQLITE_SCHEMA ) isWarn = 1; + if( sqlite3_strglob("* - no such table: *",p->zErr)==0 ) isWarn = 1; + printf("%s: (%d) \"%s\" at line %d\n", isWarn ? "Warning" : "Error", + p->rc, p->zErr, p->iLine); + if( !isWarn ) nGlobalErr++; fflush(stdout); } } From 2e5021d5eaab7008fcde02520b4248b0ded63f7d Mon Sep 17 00:00:00 2001 From: drh Date: Wed, 31 Dec 2014 19:58:32 +0000 Subject: [PATCH 43/54] Disable the bigsort.test module on machine with less than 8GB of available RAM or machine, to avoid thrashing. FossilOrigin-Name: 9d4fe11641043af4e663085e979f637676599da0 --- manifest | 12 ++++++------ manifest.uuid | 2 +- test/bigsort.test | 11 +++++++++-- 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/manifest b/manifest index f3e7704fed..6474745a56 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Change\sthreadtest3.c\sso\sthat\sSQLITE_SCHEMA\sreturns\sresult\sin\swarnings\nnot\shard\serrors.\s\sAdd\sthe\sDarwin-x86_64\splatform\sto\sreleasetest.tcl. -D 2014-12-31T18:55:09.661 +C Disable\sthe\sbigsort.test\smodule\son\smachine\swith\sless\sthan\s8GB\sof\savailable\nRAM\sor\smachine,\sto\savoid\sthrashing. +D 2014-12-31T19:58:32.224 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 7cd23e4fc91004a6bd081623e1bc6932e44828c0 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -366,7 +366,7 @@ F test/between.test 34d375fb5ce1ae283ffe82b6b233e9f38e84fc6c F test/bigfile.test aa74f4e5db51c8e54a1d9de9fa65d01d1eb20b59 F test/bigfile2.test 1b489a3a39ae90c7f027b79110d6b4e1dbc71bfc F test/bigrow.test f0aeb7573dcb8caaafea76454be3ade29b7fc747 -F test/bigsort.test 835478d0ce83bd1e5b05c90571dedd9871a09196 +F test/bigsort.test 8299fa9298f4f1e02fc7d2712e8b77d6cd60e5a2 F test/bind.test 3c7b320969000c441a70952b0b15938fbb66237c F test/bindxfer.test efecd12c580c14df5f4ad3b3e83c667744a4f7e0 F test/bitvec.test 75894a880520164d73b1305c1c3f96882615e142 @@ -1234,7 +1234,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P f489bc31165f043dc10570e6c1250a292673660e -R fb381e088e2268612fdb185243c3a797 +P b09a139c9e2e1a45a3d53395ac1376e952d459e5 +R 958bbb31d1168aa8cd0ac8a1eba90de6 U drh -Z 09baa910ae3dee28dd8ef1c911c03495 +Z 1f37f8136326091af864e56108cf76a8 diff --git a/manifest.uuid b/manifest.uuid index 5518ac9017..d365d2d171 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -b09a139c9e2e1a45a3d53395ac1376e952d459e5 \ No newline at end of file +9d4fe11641043af4e663085e979f637676599da0 \ No newline at end of file diff --git a/test/bigsort.test b/test/bigsort.test index 259adc3747..c711515973 100644 --- a/test/bigsort.test +++ b/test/bigsort.test @@ -20,6 +20,15 @@ set testprefix bigsort # loop if the product was also an integer multiple of 2^32, or # inefficiency otherwise. # +# This test causes thrashing on machines with smaller amounts of +# memory. Make sure the host has at least 8GB available before running +# this test. +# +if {[catch {exec free | grep Mem:} out] || [lindex $out 1]<8000000} { + finish_test + return +} + do_execsql_test 1.0 { PRAGMA page_size = 1024; CREATE TABLE t1(a, b); @@ -39,5 +48,3 @@ do_execsql_test 1.1 { finish_test - - From 9854248609bb4cefe1114eb63b9c21e4e6949057 Mon Sep 17 00:00:00 2001 From: drh Date: Wed, 31 Dec 2014 20:19:20 +0000 Subject: [PATCH 44/54] Fix a floating-point round-off error problem in the percentile.test module. FossilOrigin-Name: 456948ea64c6980dab79dac30a538b5a6ab8773d --- manifest | 12 ++++++------ manifest.uuid | 2 +- test/percentile.test | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/manifest b/manifest index 6474745a56..2b97b2d733 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Disable\sthe\sbigsort.test\smodule\son\smachine\swith\sless\sthan\s8GB\sof\savailable\nRAM\sor\smachine,\sto\savoid\sthrashing. -D 2014-12-31T19:58:32.224 +C Fix\sa\sfloating-point\sround-off\serror\sproblem\sin\sthe\spercentile.test\smodule. +D 2014-12-31T20:19:20.731 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 7cd23e4fc91004a6bd081623e1bc6932e44828c0 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -781,7 +781,7 @@ F test/pageropt.test 6b8f6a123a5572c195ad4ae40f2987007923bbd6 F test/pagesize.test 1dd51367e752e742f58e861e65ed7390603827a0 F test/pcache.test b09104b03160aca0d968d99e8cd2c5b1921a993d F test/pcache2.test a83efe2dec0d392f814bfc998def1d1833942025 -F test/percentile.test b98fc868d71eb5619d42a1702e9ab91718cbed54 +F test/percentile.test 4243af26b8f3f4555abe166f723715a1f74c77ff F test/permutations.test 59e2d8aba8c4f5842edba1a10a158b798690d3ba F test/pragma.test aa16dedfe01c02c8895169012f7dfde9c163f0d5 F test/pragma2.test aea7b3d82c76034a2df2b38a13745172ddc0bc13 @@ -1234,7 +1234,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P b09a139c9e2e1a45a3d53395ac1376e952d459e5 -R 958bbb31d1168aa8cd0ac8a1eba90de6 +P 9d4fe11641043af4e663085e979f637676599da0 +R efe4238b2b9db9ced84ff6eed3896298 U drh -Z 1f37f8136326091af864e56108cf76a8 +Z 00ece672f6a64adef12b5a8614c66e28 diff --git a/manifest.uuid b/manifest.uuid index d365d2d171..aacc249381 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -9d4fe11641043af4e663085e979f637676599da0 \ No newline at end of file +456948ea64c6980dab79dac30a538b5a6ab8773d \ No newline at end of file diff --git a/test/percentile.test b/test/percentile.test index 9d471dfcde..b2bd061e86 100644 --- a/test/percentile.test +++ b/test/percentile.test @@ -200,7 +200,7 @@ ifcapable vtab { } { do_test percentile-2.1.$in { execsql { - SELECT percentile(x, $in) from t3; + SELECT round(percentile(x, $in),1) from t3; } } $out } From 0265eb666be73fd3bd6d23f6c3bb8ad8e2a76d2a Mon Sep 17 00:00:00 2001 From: drh Date: Wed, 31 Dec 2014 20:25:33 +0000 Subject: [PATCH 45/54] Adjust the memsubsys1-5.5 test case to avoid occasional false positives. FossilOrigin-Name: 432413187f41061a08ecff2697ce85c935fa6fa8 --- manifest | 12 ++++++------ manifest.uuid | 2 +- test/memsubsys1.test | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/manifest b/manifest index 2b97b2d733..287183c9b9 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Fix\sa\sfloating-point\sround-off\serror\sproblem\sin\sthe\spercentile.test\smodule. -D 2014-12-31T20:19:20.731 +C Adjust\sthe\smemsubsys1-5.5\stest\scase\sto\savoid\soccasional\sfalse\spositives. +D 2014-12-31T20:25:33.588 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 7cd23e4fc91004a6bd081623e1bc6932e44828c0 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -727,7 +727,7 @@ F test/manydb.test 28385ae2087967aa05c38624cec7d96ec74feb3e F test/mem5.test c6460fba403c5703141348cd90de1c294188c68f F test/memdb.test fcb5297b321b562084fc79d64d5a12a1cd2b639b F test/memleak.test 10b9c6c57e19fc68c32941495e9ba1c50123f6e2 -F test/memsubsys1.test bf270964ab83bc2da5927960f78304a866fb9a9d +F test/memsubsys1.test e33072ea2ebbca54104f00bc0b6452295ff6268e F test/memsubsys2.test 3a1c1a9de48e5726faa85108b02459fae8cb9ee9 F test/minmax.test 42fbad0e81afaa6e0de41c960329f2b2c3526efd F test/minmax2.test b44bae787fc7b227597b01b0ca5575c7cb54d3bc @@ -1234,7 +1234,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 9d4fe11641043af4e663085e979f637676599da0 -R efe4238b2b9db9ced84ff6eed3896298 +P 456948ea64c6980dab79dac30a538b5a6ab8773d +R faffc322ba435b37e085a2179210ef63 U drh -Z 00ece672f6a64adef12b5a8614c66e28 +Z 4cc37900b3dc79a667b61580e5a01937 diff --git a/manifest.uuid b/manifest.uuid index aacc249381..ac386cfe2a 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -456948ea64c6980dab79dac30a538b5a6ab8773d \ No newline at end of file +432413187f41061a08ecff2697ce85c935fa6fa8 \ No newline at end of file diff --git a/test/memsubsys1.test b/test/memsubsys1.test index 8cc7c2afc1..7402d515be 100644 --- a/test/memsubsys1.test +++ b/test/memsubsys1.test @@ -176,13 +176,13 @@ do_test memsubsys1-4.6 { set s_used [lindex [sqlite3_status SQLITE_STATUS_SCRATCH_USED 0] 2] } 1 -# Test 5: Activate both PAGECACHE and SCRATCH. But make the page size +# Test 5: Activate both PAGECACHE and SCRATCH. But make the page size is # such that the SCRATCH allocations are too small. # db close sqlite3_shutdown sqlite3_config_pagecache [expr 4096+$xtra_size] 24 -sqlite3_config_scratch 6000 2 +sqlite3_config_scratch 4000 2 sqlite3_initialize reset_highwater_marks build_test_db memsubsys1-5 {PRAGMA page_size=4096} From af700b3971a968d4539e43bad0e14e555c796e4f Mon Sep 17 00:00:00 2001 From: drh Date: Wed, 31 Dec 2014 20:35:11 +0000 Subject: [PATCH 46/54] Fix to releasetest.tcl: When doing the secondary _debug runs, convert "fulltest" to just "test". FossilOrigin-Name: ec264bdee5ab8047fda9a36af27c8a2c8d964112 --- manifest | 12 ++++++------ manifest.uuid | 2 +- test/releasetest.tcl | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/manifest b/manifest index 287183c9b9..23cde5e727 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Adjust\sthe\smemsubsys1-5.5\stest\scase\sto\savoid\soccasional\sfalse\spositives. -D 2014-12-31T20:25:33.588 +C Fix\sto\sreleasetest.tcl:\s\sWhen\sdoing\sthe\ssecondary\s_debug\sruns,\sconvert\n"fulltest"\sto\sjust\s"test". +D 2014-12-31T20:35:11.375 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 7cd23e4fc91004a6bd081623e1bc6932e44828c0 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -801,7 +801,7 @@ F test/randexpr1.test eda062a97e60f9c38ae8d806b03b0ddf23d796df F test/rdonly.test dd30a4858d8e0fbad2304c2bd74a33d4df36412a F test/regexp1.test 497ea812f264d12b6198d6e50a76be4a1973a9d8 F test/reindex.test 44edd3966b474468b823d481eafef0c305022254 -F test/releasetest.tcl f8845aae7b19f0c5418b27bf7723da84a336d0d5 +F test/releasetest.tcl 9440b21870bc25c9303e7a2adc0708257249295a F test/resolver01.test 33abf37ff8335e6bf98f2b45a0af3e06996ccd9a F test/rollback.test 458fe73eb3ffdfdf9f6ba3e9b7350a6220414dea F test/rollback2.test fc14cf6d1a2b250d2735ef16124b971bce152f14 @@ -1234,7 +1234,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 456948ea64c6980dab79dac30a538b5a6ab8773d -R faffc322ba435b37e085a2179210ef63 +P 432413187f41061a08ecff2697ce85c935fa6fa8 +R eab92cc42f1c6f3a82dbafd90384e659 U drh -Z 4cc37900b3dc79a667b61580e5a01937 +Z efe20f1bf1699435938e7d67d2cf6478 diff --git a/manifest.uuid b/manifest.uuid index ac386cfe2a..4765ac41a9 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -432413187f41061a08ecff2697ce85c935fa6fa8 \ No newline at end of file +ec264bdee5ab8047fda9a36af27c8a2c8d964112 \ No newline at end of file diff --git a/test/releasetest.tcl b/test/releasetest.tcl index cfd0ba900f..96e7ffb4b2 100644 --- a/test/releasetest.tcl +++ b/test/releasetest.tcl @@ -462,7 +462,7 @@ proc main {argv} { if {$target!="checksymbols" && !$::BUILDONLY} { set debug_idx [lsearch -glob $config_options -DSQLITE_DEBUG*] set xtarget $target - regsub -all {fulltest[a-z]+} $xtarget test xtarget + regsub -all {fulltest[a-z]*} $xtarget test xtarget if {$debug_idx < 0} { incr NTEST append config_options " -DSQLITE_DEBUG=1" From fddfacc371c75c20603e0b1122c1a5afef4ea72a Mon Sep 17 00:00:00 2001 From: drh Date: Thu, 1 Jan 2015 14:06:24 +0000 Subject: [PATCH 47/54] Fix the fkey-7.1 test so that it sorts its answer and hence always gives the same answer. FossilOrigin-Name: 5830c557f7ed048056e2faeb82a8705ee7ecfdd7 --- manifest | 12 ++++++------ manifest.uuid | 2 +- test/fkey5.test | 6 +++++- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/manifest b/manifest index 23cde5e727..8890c6573d 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Fix\sto\sreleasetest.tcl:\s\sWhen\sdoing\sthe\ssecondary\s_debug\sruns,\sconvert\n"fulltest"\sto\sjust\s"test". -D 2014-12-31T20:35:11.375 +C Fix\sthe\sfkey-7.1\stest\sso\sthat\sit\ssorts\sits\sanswer\sand\shence\salways\sgives\sthe\nsame\sanswer. +D 2015-01-01T14:06:24.026 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 7cd23e4fc91004a6bd081623e1bc6932e44828c0 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -501,7 +501,7 @@ F test/fkey1.test e1d1fa84cde579185ea01358436839703e415a5b F test/fkey2.test 1db212cda86b0d3ce72714001f7b6381c321341c F test/fkey3.test 76d475c80b84ee7a5d062e56ccb6ea68882e2b49 F test/fkey4.test 86446017011273aad8f9a99c1a65019e7bd9ca9d -F test/fkey5.test 8a1fde4e7721ae00b05b3178888833726ca2df8d +F test/fkey5.test 488601fbda8350619b3029487e56830447056fd2 F test/fkey6.test abb59f866c1b44926fd02d1fdd217d831fe04f48 F test/fkey7.test 72e915890ee4a005daaf3002cb208e8fe973ac13 F test/fkey8.test 8f08203458321e6c19a263829de4cfc936274ab0 @@ -1234,7 +1234,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 432413187f41061a08ecff2697ce85c935fa6fa8 -R eab92cc42f1c6f3a82dbafd90384e659 +P ec264bdee5ab8047fda9a36af27c8a2c8d964112 +R 8acff839204fa9ef6e40b09dc0daac28 U drh -Z efe20f1bf1699435938e7d67d2cf6478 +Z e6b9572729fe8b314ffd25cb175a4396 diff --git a/manifest.uuid b/manifest.uuid index 4765ac41a9..d65542baa3 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -ec264bdee5ab8047fda9a36af27c8a2c8d964112 \ No newline at end of file +5830c557f7ed048056e2faeb82a8705ee7ecfdd7 \ No newline at end of file diff --git a/test/fkey5.test b/test/fkey5.test index 5aa8b1d4b7..dc866cbdb8 100644 --- a/test/fkey5.test +++ b/test/fkey5.test @@ -252,13 +252,17 @@ do_test fkey5-6.5 { } {c12 1 p4 0 c12 3 p4 0 c12 6 p4 0} do_test fkey5-7.1 { + set res {} db eval { INSERT OR IGNORE INTO c13 SELECT * FROM c12; INSERT OR IGNORE INTO C14 SELECT * FROM c12; DELETE FROM c12; PRAGMA foreign_key_check; + } { + lappend res [list $table $rowid $fkid $parent] } -} {c14 1 p4 0 c14 3 p4 0 c14 6 p4 0 c13 1 p3 0 c13 2 p3 0 c13 3 p3 0 c13 4 p3 0 c13 5 p3 0 c13 6 p3 0} + lsort $res +} {{c13 1 0 p3} {c13 2 0 p3} {c13 3 0 p3} {c13 4 0 p3} {c13 5 0 p3} {c13 6 0 p3} {c14 1 0 p4} {c14 3 0 p4} {c14 6 0 p4}} do_test fkey5-7.2 { db eval { PRAGMA foreign_key_check(c14); From a0de826c9ff84bd19de76ebbc0d4bdafa9686d3a Mon Sep 17 00:00:00 2001 From: drh Date: Thu, 1 Jan 2015 14:13:45 +0000 Subject: [PATCH 48/54] Fix two test cases in memsubsys1 so that they work with the mmap permutation. FossilOrigin-Name: 66269d0d8e49eb3dc7f508714753584f648bb022 --- manifest | 12 ++++++------ manifest.uuid | 2 +- test/memsubsys1.test | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/manifest b/manifest index 8890c6573d..4094f7cc8a 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Fix\sthe\sfkey-7.1\stest\sso\sthat\sit\ssorts\sits\sanswer\sand\shence\salways\sgives\sthe\nsame\sanswer. -D 2015-01-01T14:06:24.026 +C Fix\stwo\stest\scases\sin\smemsubsys1\sso\sthat\sthey\swork\swith\sthe\smmap\spermutation. +D 2015-01-01T14:13:45.725 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 7cd23e4fc91004a6bd081623e1bc6932e44828c0 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -727,7 +727,7 @@ F test/manydb.test 28385ae2087967aa05c38624cec7d96ec74feb3e F test/mem5.test c6460fba403c5703141348cd90de1c294188c68f F test/memdb.test fcb5297b321b562084fc79d64d5a12a1cd2b639b F test/memleak.test 10b9c6c57e19fc68c32941495e9ba1c50123f6e2 -F test/memsubsys1.test e33072ea2ebbca54104f00bc0b6452295ff6268e +F test/memsubsys1.test 690d142525a7d31efb638b0d232e25fac3afeb1a F test/memsubsys2.test 3a1c1a9de48e5726faa85108b02459fae8cb9ee9 F test/minmax.test 42fbad0e81afaa6e0de41c960329f2b2c3526efd F test/minmax2.test b44bae787fc7b227597b01b0ca5575c7cb54d3bc @@ -1234,7 +1234,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P ec264bdee5ab8047fda9a36af27c8a2c8d964112 -R 8acff839204fa9ef6e40b09dc0daac28 +P 5830c557f7ed048056e2faeb82a8705ee7ecfdd7 +R 9ee216f4d87447d224436bd4fa1652bd U drh -Z e6b9572729fe8b314ffd25cb175a4396 +Z f94d536f9021f3614a2a0370bbcf66ff diff --git a/manifest.uuid b/manifest.uuid index d65542baa3..6e46921ab5 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -5830c557f7ed048056e2faeb82a8705ee7ecfdd7 \ No newline at end of file +66269d0d8e49eb3dc7f508714753584f648bb022 \ No newline at end of file diff --git a/test/memsubsys1.test b/test/memsubsys1.test index 7402d515be..891558fd52 100644 --- a/test/memsubsys1.test +++ b/test/memsubsys1.test @@ -189,7 +189,7 @@ build_test_db memsubsys1-5 {PRAGMA page_size=4096} #show_memstats do_test memsubsys1-5.3 { set pg_used [lindex [sqlite3_status SQLITE_STATUS_PAGECACHE_USED 0] 2] -} 24 +} {/^2[34]$/} do_test memsubsys1-5.4 { set maxreq [lindex [sqlite3_status SQLITE_STATUS_MALLOC_SIZE 0] 2] expr {$maxreq>4096} @@ -215,7 +215,7 @@ build_test_db memsubsys1-6 {PRAGMA page_size=4096} #show_memstats do_test memsubsys1-6.3 { set pg_used [lindex [sqlite3_status SQLITE_STATUS_PAGECACHE_USED 0] 2] -} 24 +} {/^2[34]$/} #do_test memsubsys1-6.4 { # set maxreq [lindex [sqlite3_status SQLITE_STATUS_MALLOC_SIZE 0] 2] # expr {$maxreq>4096 && $maxreq<=(4096+$xtra_size)} From f0a88279bdd40a54003d527e3d42f986ecbd0a69 Mon Sep 17 00:00:00 2001 From: drh Date: Thu, 1 Jan 2015 16:47:43 +0000 Subject: [PATCH 49/54] Fix a harmless compiler warning in rtree. FossilOrigin-Name: 30891c6b8ebe9dfc939f9695bb45a159fbaaf262 --- ext/rtree/rtree.c | 2 +- manifest | 12 ++++++------ manifest.uuid | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/ext/rtree/rtree.c b/ext/rtree/rtree.c index 8150538d45..57b38de03d 100644 --- a/ext/rtree/rtree.c +++ b/ext/rtree/rtree.c @@ -1182,7 +1182,7 @@ static RtreeSearchPoint *rtreeEnqueue( pNew = pCur->aPoint + i; pNew->rScore = rScore; pNew->iLevel = iLevel; - assert( iLevel>=0 && iLevel<=RTREE_MAX_DEPTH ); + assert( iLevel<=RTREE_MAX_DEPTH ); while( i>0 ){ RtreeSearchPoint *pParent; j = (i-1)/2; diff --git a/manifest b/manifest index 4094f7cc8a..b7c0812559 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Fix\stwo\stest\scases\sin\smemsubsys1\sso\sthat\sthey\swork\swith\sthe\smmap\spermutation. -D 2015-01-01T14:13:45.725 +C Fix\sa\sharmless\scompiler\swarning\sin\srtree. +D 2015-01-01T16:47:43.069 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 7cd23e4fc91004a6bd081623e1bc6932e44828c0 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -124,7 +124,7 @@ F ext/misc/vfslog.c fe40fab5c077a40477f7e5eba994309ecac6cc95 F ext/misc/vtshim.c babb0dc2bf116029e3e7c9a618b8a1377045303e F ext/misc/wholenumber.c 784b12543d60702ebdd47da936e278aa03076212 F ext/rtree/README 6315c0d73ebf0ec40dedb5aa0e942bc8b54e3761 -F ext/rtree/rtree.c 57bec53e1a677ab74217fe1f20a58c3a47261d6b +F ext/rtree/rtree.c a03ebd2480a1a4969cb363bb696d9d911e5a6ecd F ext/rtree/rtree.h 834dbcb82dc85b2481cde6a07cdadfddc99e9b9e F ext/rtree/rtree1.test 541bbcab74613907fea08b2ecdcdd5b7aa724cc9 F ext/rtree/rtree2.test acbb3a4ce0f4fbc2c304d2b4b784cfa161856bba @@ -1234,7 +1234,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 5830c557f7ed048056e2faeb82a8705ee7ecfdd7 -R 9ee216f4d87447d224436bd4fa1652bd +P 66269d0d8e49eb3dc7f508714753584f648bb022 +R e5d27e633a5b491c2ea88ea18c8cfd90 U drh -Z f94d536f9021f3614a2a0370bbcf66ff +Z a7e9ba08973a7605802bac8950dbf017 diff --git a/manifest.uuid b/manifest.uuid index 6e46921ab5..c0a63b890d 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -66269d0d8e49eb3dc7f508714753584f648bb022 \ No newline at end of file +30891c6b8ebe9dfc939f9695bb45a159fbaaf262 \ No newline at end of file From 7203aed919d3b5118a8aaacbaab9c3d1b8120d36 Mon Sep 17 00:00:00 2001 From: drh Date: Thu, 1 Jan 2015 18:54:23 +0000 Subject: [PATCH 50/54] Fix an error in the computation of the number of hours of runtime for individual test runs in the releasetest.tcl script. FossilOrigin-Name: e2b0ebe21cd8a63927decb645efd2db80bf88379 --- manifest | 12 ++++++------ manifest.uuid | 2 +- test/releasetest.tcl | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/manifest b/manifest index b7c0812559..cba0e35cee 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Fix\sa\sharmless\scompiler\swarning\sin\srtree. -D 2015-01-01T16:47:43.069 +C Fix\san\serror\sin\sthe\scomputation\sof\sthe\snumber\sof\shours\sof\sruntime\sfor\nindividual\stest\sruns\sin\sthe\sreleasetest.tcl\sscript. +D 2015-01-01T18:54:23.534 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 7cd23e4fc91004a6bd081623e1bc6932e44828c0 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -801,7 +801,7 @@ F test/randexpr1.test eda062a97e60f9c38ae8d806b03b0ddf23d796df F test/rdonly.test dd30a4858d8e0fbad2304c2bd74a33d4df36412a F test/regexp1.test 497ea812f264d12b6198d6e50a76be4a1973a9d8 F test/reindex.test 44edd3966b474468b823d481eafef0c305022254 -F test/releasetest.tcl 9440b21870bc25c9303e7a2adc0708257249295a +F test/releasetest.tcl 183f35a18840152f24bfe0a24d9346f815ccd218 F test/resolver01.test 33abf37ff8335e6bf98f2b45a0af3e06996ccd9a F test/rollback.test 458fe73eb3ffdfdf9f6ba3e9b7350a6220414dea F test/rollback2.test fc14cf6d1a2b250d2735ef16124b971bce152f14 @@ -1234,7 +1234,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 66269d0d8e49eb3dc7f508714753584f648bb022 -R e5d27e633a5b491c2ea88ea18c8cfd90 +P 30891c6b8ebe9dfc939f9695bb45a159fbaaf262 +R ff7c096e1b65892104ff528c7034919c U drh -Z a7e9ba08973a7605802bac8950dbf017 +Z 2f878e885c01058106b8fb811cc67e19 diff --git a/manifest.uuid b/manifest.uuid index c0a63b890d..dcdae3e8de 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -30891c6b8ebe9dfc939f9695bb45a159fbaaf262 \ No newline at end of file +e2b0ebe21cd8a63927decb645efd2db80bf88379 \ No newline at end of file diff --git a/test/releasetest.tcl b/test/releasetest.tcl index 96e7ffb4b2..3a9ee3311a 100644 --- a/test/releasetest.tcl +++ b/test/releasetest.tcl @@ -287,7 +287,7 @@ proc run_test_suite {name testtarget config} { dryrun cd $origdir if {!$::DRYRUN} { - set hours [expr {($tm2-$tm2)/3600}] + set hours [expr {($tm2-$tm1)/3600}] set minutes [expr {(($tm2-$tm1)/60)%60}] set seconds [expr {($tm2-$tm1)%60}] set tm [format (%02d:%02d:%02d) $hours $minutes $seconds] From 0325d3962ad0cff8513cde30223f9ed930bf17be Mon Sep 17 00:00:00 2001 From: drh Date: Thu, 1 Jan 2015 19:11:22 +0000 Subject: [PATCH 51/54] Enhance the "lemon" executable so that it ignores -f, -W, -O, and -I command-line options. This permits most of the same options that are passed to the compiler to also be harmlessly passed to lemon, and thus simplifies makefiles. FossilOrigin-Name: da408d128b4301d9fc7a3a00f219dce7ed48bc60 --- manifest | 12 ++++++------ manifest.uuid | 2 +- tool/lemon.c | 14 ++++++++++---- 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/manifest b/manifest index cba0e35cee..aac11a7aa5 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Fix\san\serror\sin\sthe\scomputation\sof\sthe\snumber\sof\shours\sof\sruntime\sfor\nindividual\stest\sruns\sin\sthe\sreleasetest.tcl\sscript. -D 2015-01-01T18:54:23.534 +C Enhance\sthe\s"lemon"\sexecutable\sso\sthat\sit\signores\s-f,\s-W,\s-O,\sand\s-I\ncommand-line\soptions.\s\sThis\spermits\smost\sof\sthe\ssame\soptions\sthat\sare\spassed\nto\sthe\scompiler\sto\salso\sbe\sharmlessly\spassed\sto\slemon,\sand\sthus\nsimplifies\smakefiles. +D 2015-01-01T19:11:22.522 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 7cd23e4fc91004a6bd081623e1bc6932e44828c0 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -1192,7 +1192,7 @@ F tool/fragck.tcl 5265a95126abcf6ab357f7efa544787e5963f439 F tool/genfkey.README cf68fddd4643bbe3ff8e31b8b6d8b0a1b85e20f4 F tool/genfkey.test 4196a8928b78f51d54ef58e99e99401ab2f0a7e5 F tool/getlock.c f4c39b651370156cae979501a7b156bdba50e7ce -F tool/lemon.c 3ff0fec22f92dfb54e62eeb48772eddffdbeb0d6 +F tool/lemon.c 20f3132a1a150d50b022aa0b1fa26bd46aebf7b5 F tool/lempar.c 01ca97f87610d1dac6d8cd96ab109ab1130e76dc F tool/logest.c eef612f8adf4d0993dafed0416064cf50d5d33c6 F tool/mkautoconfamal.sh 5dc5010e2e748a9e1bba67baca5956a2c2deda7b @@ -1234,7 +1234,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 30891c6b8ebe9dfc939f9695bb45a159fbaaf262 -R ff7c096e1b65892104ff528c7034919c +P e2b0ebe21cd8a63927decb645efd2db80bf88379 +R 5d6dc81c5e6fc0ccf7a552bd6bb1dd01 U drh -Z 2f878e885c01058106b8fb811cc67e19 +Z c56b05defbbdeecd31b9d2ca5ed09dfe diff --git a/manifest.uuid b/manifest.uuid index dcdae3e8de..7f420ec644 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -e2b0ebe21cd8a63927decb645efd2db80bf88379 \ No newline at end of file +da408d128b4301d9fc7a3a00f219dce7ed48bc60 \ No newline at end of file diff --git a/tool/lemon.c b/tool/lemon.c index 85e94f7007..54c155204a 100644 --- a/tool/lemon.c +++ b/tool/lemon.c @@ -1497,10 +1497,12 @@ int main(int argc, char **argv) {OPT_FLAG, "b", (char*)&basisflag, "Print only the basis in report."}, {OPT_FLAG, "c", (char*)&compress, "Don't compress the action table."}, {OPT_FSTR, "D", (char*)handle_D_option, "Define an %ifdef macro."}, - {OPT_FSTR, "T", (char*)handle_T_option, "Specify a template file."}, + {OPT_FSTR, "f", 0, "Ignored. (Placeholder for -f compiler options.)"}, {OPT_FLAG, "g", (char*)&rpflag, "Print grammar without actions."}, + {OPT_FSTR, "I", 0, "Ignored. (Placeholder for '-I' compiler options.)"}, {OPT_FLAG, "m", (char*)&mhflag, "Output a makeheaders compatible file."}, {OPT_FLAG, "l", (char*)&nolinenosflag, "Do not print #line statements."}, + {OPT_FSTR, "O", 0, "Ignored. (Placeholder for '-O' compiler options.)"}, {OPT_FLAG, "p", (char*)&showPrecedenceConflict, "Show conflicts resolved by precedence rules"}, {OPT_FLAG, "q", (char*)&quiet, "(Quiet) Don't print the report file."}, @@ -1508,6 +1510,8 @@ int main(int argc, char **argv) {OPT_FLAG, "s", (char*)&statistics, "Print parser stats to standard output."}, {OPT_FLAG, "x", (char*)&version, "Print the version number."}, + {OPT_FSTR, "T", (char*)handle_T_option, "Specify a template file."}, + {OPT_FSTR, "W", 0, "Ignored. (Placeholder for '-W' compiler options.)"}, {OPT_FLAG,0,0,0} }; int i; @@ -1812,6 +1816,8 @@ static int handleflags(int i, FILE *err) errline(i,1,err); } errcnt++; + }else if( op[j].arg==0 ){ + /* Ignore this option */ }else if( op[j].type==OPT_FLAG ){ *((int*)op[j].arg) = v; }else if( op[j].type==OPT_FFLAG ){ @@ -2001,17 +2007,17 @@ void OptPrint(){ break; case OPT_INT: case OPT_FINT: - fprintf(errstream," %s=%*s %s\n",op[i].label, + fprintf(errstream," -%s%*s %s\n",op[i].label, (int)(max-lemonStrlen(op[i].label)-9),"",op[i].message); break; case OPT_DBL: case OPT_FDBL: - fprintf(errstream," %s=%*s %s\n",op[i].label, + fprintf(errstream," -%s%*s %s\n",op[i].label, (int)(max-lemonStrlen(op[i].label)-6),"",op[i].message); break; case OPT_STR: case OPT_FSTR: - fprintf(errstream," %s=%*s %s\n",op[i].label, + fprintf(errstream," -%s%*s %s\n",op[i].label, (int)(max-lemonStrlen(op[i].label)-8),"",op[i].message); break; } From 149735d9461c65553b1f49e128211066912fa2af Mon Sep 17 00:00:00 2001 From: drh Date: Thu, 1 Jan 2015 19:53:10 +0000 Subject: [PATCH 52/54] Add the ability to specify an alternative compiler (clang instead of gcc) on the default Makefile. Use this in releasetest.tcl to implement an -fsanitize=undefined test. FossilOrigin-Name: c55c05fe22b9ddb61de55d473a411a11090d3d68 --- Makefile.in | 10 +++++++--- manifest | 14 +++++++------- manifest.uuid | 2 +- test/releasetest.tcl | 12 +++++++++++- 4 files changed, 26 insertions(+), 12 deletions(-) diff --git a/Makefile.in b/Makefile.in index cd024e950a..f9974d609b 100644 --- a/Makefile.in +++ b/Makefile.in @@ -22,11 +22,15 @@ TOP = @srcdir@ # BCC = @BUILD_CC@ @BUILD_CFLAGS@ -# C Compile and options for use in building executables that +# TCC is the C Compile and options for use in building executables that # will run on the target platform. (BCC and TCC are usually the -# same unless your are cross-compiling.) +# same unless your are cross-compiling.) Separate CC and CFLAGS macros +# are provide so that these aspects of the build process can be changed +# on the "make" command-line. Ex: "make CC=clang CFLAGS=-fsanitize=undefined" # -TCC = @CC@ @CPPFLAGS@ @CFLAGS@ -I. -I${TOP}/src -I${TOP}/ext/rtree +CC = @CC@ +CFLAGS = @CPPFLAGS@ @CFLAGS@ +TCC = $(CC) $(CFLAGS) -I. -I${TOP}/src -I${TOP}/ext/rtree # Define this for the autoconf-based build, so that the code knows it can # include the generated config.h diff --git a/manifest b/manifest index aac11a7aa5..13a4c6435b 100644 --- a/manifest +++ b/manifest @@ -1,7 +1,7 @@ -C Enhance\sthe\s"lemon"\sexecutable\sso\sthat\sit\signores\s-f,\s-W,\s-O,\sand\s-I\ncommand-line\soptions.\s\sThis\spermits\smost\sof\sthe\ssame\soptions\sthat\sare\spassed\nto\sthe\scompiler\sto\salso\sbe\sharmlessly\spassed\sto\slemon,\sand\sthus\nsimplifies\smakefiles. -D 2015-01-01T19:11:22.522 +C Add\sthe\sability\sto\sspecify\san\salternative\scompiler\s(clang\sinstead\sof\sgcc)\non\sthe\sdefault\sMakefile.\s\sUse\sthis\sin\sreleasetest.tcl\sto\simplement\san\n-fsanitize=undefined\stest. +D 2015-01-01T19:53:10.337 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f -F Makefile.in 7cd23e4fc91004a6bd081623e1bc6932e44828c0 +F Makefile.in 335e2d3ff0f2455eacbfa3075fc37495e3321410 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 F Makefile.msc b363b90fe1bfc3b87d190f2f728a126c00d9ce09 F Makefile.vxworks 034289efa9d591b04b1a73598623119c306cbba0 @@ -801,7 +801,7 @@ F test/randexpr1.test eda062a97e60f9c38ae8d806b03b0ddf23d796df F test/rdonly.test dd30a4858d8e0fbad2304c2bd74a33d4df36412a F test/regexp1.test 497ea812f264d12b6198d6e50a76be4a1973a9d8 F test/reindex.test 44edd3966b474468b823d481eafef0c305022254 -F test/releasetest.tcl 183f35a18840152f24bfe0a24d9346f815ccd218 +F test/releasetest.tcl dbb2dbbf82fbd05e30abac638c382a5b6f808407 F test/resolver01.test 33abf37ff8335e6bf98f2b45a0af3e06996ccd9a F test/rollback.test 458fe73eb3ffdfdf9f6ba3e9b7350a6220414dea F test/rollback2.test fc14cf6d1a2b250d2735ef16124b971bce152f14 @@ -1234,7 +1234,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P e2b0ebe21cd8a63927decb645efd2db80bf88379 -R 5d6dc81c5e6fc0ccf7a552bd6bb1dd01 +P da408d128b4301d9fc7a3a00f219dce7ed48bc60 +R ca09f55008007dc6e5522170a985ac90 U drh -Z c56b05defbbdeecd31b9d2ca5ed09dfe +Z 2d169330368dfa1bfb6338447f689c29 diff --git a/manifest.uuid b/manifest.uuid index 7f420ec644..48bbba87a3 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -da408d128b4301d9fc7a3a00f219dce7ed48bc60 \ No newline at end of file +c55c05fe22b9ddb61de55d473a411a11090d3d68 \ No newline at end of file diff --git a/test/releasetest.tcl b/test/releasetest.tcl index 3a9ee3311a..772e5e481a 100644 --- a/test/releasetest.tcl +++ b/test/releasetest.tcl @@ -34,7 +34,12 @@ array set ::Configs { } "Ftrapv" { -O2 -ftrapv - -DSQLITE_MAX_ATTACHED=55 + -DSQLITE_MAX_ATTACHED=125 + -DSQLITE_TCL_DEFAULT_FULLMUTEX=1 + } + "Clang-Sanitize" { + CC=clang -fsanitize=undefined + -DSQLITE_MAX_ATTACHED=125 -DSQLITE_TCL_DEFAULT_FULLMUTEX=1 } "Unlock-Notify" { @@ -119,6 +124,7 @@ array set ::Configs { -DSQLITE_ENABLE_LOCKING_STYLE=1 } "OS-X" { + -O1 # Avoid a compiler bug in gcc 4.2.1 build 5658 -DSQLITE_OMIT_LOAD_EXTENSION=1 -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_THREADSAFE=2 @@ -166,6 +172,7 @@ array set ::Platforms { "Extra-Robustness" test "Device-Two" test "Ftrapv" test + "Clang-Sanitize" test "No-lookaside" test "Devkit" test "Default" "threadtest fulltest" @@ -244,9 +251,12 @@ proc run_test_suite {name testtarget config} { # set cflags "-g" set opts "" + regsub -all {#[^\n]*\n} $config \n config foreach arg $config { if {[string match -D* $arg]} { lappend opts $arg + } elseif {[string match CC=* $arg]} { + lappend testtarget $arg } else { lappend cflags $arg } From 4081d5da3bddb8b03e4d767df6011998cccbe858 Mon Sep 17 00:00:00 2001 From: drh Date: Thu, 1 Jan 2015 23:02:01 +0000 Subject: [PATCH 53/54] Add logic to releasetest.tcl that detects -fsanitize=undefined errors. Fix a few false-positivies that come up when running the sanitize=undefined test. FossilOrigin-Name: 2835e79a0afec6e4d449ac9340afec068c2d4c11 --- ext/misc/fuzzer.c | 3 ++- manifest | 20 ++++++++++---------- manifest.uuid | 2 +- src/analyze.c | 2 +- src/test8.c | 4 ++-- test/permutations.test | 5 +++++ test/releasetest.tcl | 16 ++++++++++++---- 7 files changed, 33 insertions(+), 19 deletions(-) diff --git a/ext/misc/fuzzer.c b/ext/misc/fuzzer.c index fe41cda8c2..dc03161aaf 100644 --- a/ext/misc/fuzzer.c +++ b/ext/misc/fuzzer.c @@ -342,7 +342,8 @@ static int fuzzerLoadOneRule( rc = SQLITE_NOMEM; }else{ memset(pRule, 0, sizeof(*pRule)); - pRule->zFrom = &pRule->zTo[nTo+1]; + pRule->zFrom = pRule->zTo; + pRule->zFrom += nTo + 1; pRule->nFrom = nFrom; memcpy(pRule->zFrom, zFrom, nFrom+1); memcpy(pRule->zTo, zTo, nTo+1); diff --git a/manifest b/manifest index 13a4c6435b..be8e05d98a 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Add\sthe\sability\sto\sspecify\san\salternative\scompiler\s(clang\sinstead\sof\sgcc)\non\sthe\sdefault\sMakefile.\s\sUse\sthis\sin\sreleasetest.tcl\sto\simplement\san\n-fsanitize=undefined\stest. -D 2015-01-01T19:53:10.337 +C Add\slogic\sto\sreleasetest.tcl\sthat\sdetects\s-fsanitize=undefined\serrors.\nFix\sa\sfew\sfalse-positivies\sthat\scome\sup\swhen\srunning\sthe\ssanitize=undefined\ntest. +D 2015-01-01T23:02:01.908 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 335e2d3ff0f2455eacbfa3075fc37495e3321410 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -111,7 +111,7 @@ F ext/misc/closure.c 636024302cde41b2bf0c542f81c40c624cfb7012 F ext/misc/compress.c 76e45655f4046e756064ab10c62e18f2eb846b9f F ext/misc/eval.c f971962e92ebb8b0a4e6b62949463ee454d88fa2 F ext/misc/fileio.c d4171c815d6543a9edef8308aab2951413cd8d0f -F ext/misc/fuzzer.c 136533c53cfce0957f0b48fa11dba27e21c5c01d +F ext/misc/fuzzer.c e3e18f47252c151b5553d7e806f38e757d37c4cc F ext/misc/ieee754.c b0362167289170627659e84173f5d2e8fee8566e F ext/misc/nextchar.c 35c8b8baacb96d92abbb34a83a997b797075b342 F ext/misc/percentile.c bcbee3c061b884eccb80e21651daaae8e1e43c63 @@ -167,7 +167,7 @@ F sqlite.pc.in 42b7bf0d02e08b9e77734a47798d1a55a9e0716b F sqlite3.1 fc7ad8990fc8409983309bb80de8c811a7506786 F sqlite3.pc.in 48fed132e7cb71ab676105d2a4dc77127d8c1f3a F src/alter.c ba266a779bc7ce10e52e59e7d3dc79fa342e8fdb -F src/analyze.c 7a2986e6ea8247e5f21aca3d0b584598f58d84fe +F src/analyze.c 91540f835163d5369ccbae78e2e6c74d0dd53c1d F src/attach.c 7f6b3fafa2290b407e4a94dcf1afda7ec0fe394b F src/auth.c b56c78ebe40a2110fd361379f7e8162d23f92240 F src/backup.c 7ddee9c7d505e07e959a575b18498f17c71e53ea @@ -245,7 +245,7 @@ F src/test4.c 9b32d22f5f150abe23c1830e2057c4037c45b3df F src/test5.c 5a34feec76d9b3a86aab30fd4f6cc9c48cbab4c1 F src/test6.c 41cacf3b0dd180823919bf9e1fbab287c9266723 F src/test7.c 72b732baa5642f795655ba1126ea032af46ecfd2 -F src/test8.c 54ccd7b1df5062f0ecbf50a8f7b618f8b1f13b20 +F src/test8.c bf3bad9a7df2e7c58d3371ea913abeaedb429a38 F src/test9.c bea1e8cf52aa93695487badedd6e1886c321ea60 F src/test_async.c 21e11293a2f72080eda70e1124e9102044531cd8 F src/test_autoext.c dea8a01a7153b9adc97bd26161e4226329546e12 @@ -782,7 +782,7 @@ F test/pagesize.test 1dd51367e752e742f58e861e65ed7390603827a0 F test/pcache.test b09104b03160aca0d968d99e8cd2c5b1921a993d F test/pcache2.test a83efe2dec0d392f814bfc998def1d1833942025 F test/percentile.test 4243af26b8f3f4555abe166f723715a1f74c77ff -F test/permutations.test 59e2d8aba8c4f5842edba1a10a158b798690d3ba +F test/permutations.test 3a58611f8b703d385015bbe1710c722ff900f2ee F test/pragma.test aa16dedfe01c02c8895169012f7dfde9c163f0d5 F test/pragma2.test aea7b3d82c76034a2df2b38a13745172ddc0bc13 F test/pragma3.test 6f849ccffeee7e496d2f2b5e74152306c0b8757c @@ -801,7 +801,7 @@ F test/randexpr1.test eda062a97e60f9c38ae8d806b03b0ddf23d796df F test/rdonly.test dd30a4858d8e0fbad2304c2bd74a33d4df36412a F test/regexp1.test 497ea812f264d12b6198d6e50a76be4a1973a9d8 F test/reindex.test 44edd3966b474468b823d481eafef0c305022254 -F test/releasetest.tcl dbb2dbbf82fbd05e30abac638c382a5b6f808407 +F test/releasetest.tcl facd103f341b2ecb5b86569b7e657d59027bd9dd F test/resolver01.test 33abf37ff8335e6bf98f2b45a0af3e06996ccd9a F test/rollback.test 458fe73eb3ffdfdf9f6ba3e9b7350a6220414dea F test/rollback2.test fc14cf6d1a2b250d2735ef16124b971bce152f14 @@ -1234,7 +1234,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P da408d128b4301d9fc7a3a00f219dce7ed48bc60 -R ca09f55008007dc6e5522170a985ac90 +P c55c05fe22b9ddb61de55d473a411a11090d3d68 +R e6aaf3935879f250648e86cbf64d3bdf U drh -Z 2d169330368dfa1bfb6338447f689c29 +Z 20260de80f5f5cb2f8311d6a05cba05e diff --git a/manifest.uuid b/manifest.uuid index 48bbba87a3..b69d1dbdb9 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -c55c05fe22b9ddb61de55d473a411a11090d3d68 \ No newline at end of file +2835e79a0afec6e4d449ac9340afec068c2d4c11 \ No newline at end of file diff --git a/src/analyze.c b/src/analyze.c index e483807116..fec2bdb39d 100644 --- a/src/analyze.c +++ b/src/analyze.c @@ -448,7 +448,7 @@ static void statInit( p->mxSample = mxSample; p->nPSample = (tRowcnt)(sqlite3_value_int64(argv[2])/(mxSample/3+1) + 1); p->current.anLt = &p->current.anEq[nColUp]; - p->iPrn = nCol*0x689e962d ^ sqlite3_value_int(argv[2])*0xd0944565; + p->iPrn = 0x689e962d*(u32)nCol ^ 0xd0944565*(u32)sqlite3_value_int(argv[2]); /* Set up the Stat4Accum.a[] and aBest[] arrays */ p->a = (struct Stat4Sample*)&p->current.anLt[nColUp]; diff --git a/src/test8.c b/src/test8.c index 8bc835d638..407dd54c79 100644 --- a/src/test8.c +++ b/src/test8.c @@ -648,12 +648,12 @@ static int echoRowid(sqlite3_vtab_cursor *cur, sqlite_int64 *pRowid){ ** indeed the hash of the supplied idxStr. */ static int hashString(const char *zString){ - int val = 0; + u32 val = 0; int ii; for(ii=0; zString[ii]; ii++){ val = (val << 3) + (int)zString[ii]; } - return val; + return (int)(val&0x7fffffff); } /* diff --git a/test/permutations.test b/test/permutations.test index fea70a60e8..232e8f9704 100644 --- a/test/permutations.test +++ b/test/permutations.test @@ -118,6 +118,11 @@ set allquicktests [test_set $alltests -exclude { if {[info exists ::env(QUICKTEST_INCLUDE)]} { set allquicktests [concat $allquicktests $::env(QUICKTEST_INCLUDE)] } +if {[info exists ::env(QUICKTEST_OMIT)]} { + foreach x [split $::env(QUICKTEST_OMIT) ,] { + regsub -all \\y$x\\y $allquicktests {} allquicktests + } +} ############################################################################# # Start of tests diff --git a/test/releasetest.tcl b/test/releasetest.tcl index 772e5e481a..342a4069b9 100644 --- a/test/releasetest.tcl +++ b/test/releasetest.tcl @@ -37,10 +37,9 @@ array set ::Configs { -DSQLITE_MAX_ATTACHED=125 -DSQLITE_TCL_DEFAULT_FULLMUTEX=1 } - "Clang-Sanitize" { + "Sanitize" { CC=clang -fsanitize=undefined - -DSQLITE_MAX_ATTACHED=125 - -DSQLITE_TCL_DEFAULT_FULLMUTEX=1 + -DSQLITE_ENABLE_STAT4 } "Unlock-Notify" { -O2 @@ -72,6 +71,7 @@ array set ::Configs { -DSQLITE_ENABLE_ATOMIC_WRITE=1 -DSQLITE_ENABLE_MEMORY_MANAGEMENT=1 -DSQLITE_ENABLE_OVERSIZE_CELL_CHECK=1 + -DSQLITE_ENABLE_STAT4 } "Debug-One" { -O2 @@ -84,6 +84,7 @@ array set ::Configs { -DSQLITE_ENABLE_MEMSYS5=1 -DSQLITE_ENABLE_MEMSYS3=1 -DSQLITE_ENABLE_COLUMN_METADATA=1 + -DSQLITE_ENABLE_STAT4 } "Device-One" { -O2 @@ -172,7 +173,7 @@ array set ::Platforms { "Extra-Robustness" test "Device-Two" test "Ftrapv" test - "Clang-Sanitize" test + "Sanitize" {QUICKTEST_OMIT=func4.test,nan.test test} "No-lookaside" test "Devkit" test "Default" "threadtest fulltest" @@ -235,6 +236,13 @@ proc count_tests_and_errors {logfile rcVar errmsgVar} { set errmsg $line } } + if {[regexp {runtime error: +(.*)} $line all msg]} { + incr ::NERRCASE + if {$rc==0} { + set rc 1 + set errmsg $msg + } + } } close $fd if {!$seen} { From 3bd1791dfb535b7137070f81f470bc784eae1943 Mon Sep 17 00:00:00 2001 From: drh Date: Fri, 2 Jan 2015 15:55:29 +0000 Subject: [PATCH 54/54] Add the SQLITE_CONFIG_PMASZ start-time option. FossilOrigin-Name: acb0d1e8324f19da3d4d577d58748848de1bcef7 --- manifest | 30 +++++++++++++++--------------- manifest.uuid | 2 +- src/global.c | 8 ++++++++ src/main.c | 5 +++++ src/sqlite.h.in | 12 ++++++++++++ src/sqliteInt.h | 1 + src/test_malloc.c | 29 +++++++++++++++++++++++++++++ src/vdbesort.c | 14 +++++--------- test/sort.test | 5 +++++ test/sort2.test | 5 +++++ test/sort4.test | 6 ++++++ test/sortfault.test | 6 ++++++ 12 files changed, 98 insertions(+), 25 deletions(-) diff --git a/manifest b/manifest index be8e05d98a..5142e98f04 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Add\slogic\sto\sreleasetest.tcl\sthat\sdetects\s-fsanitize=undefined\serrors.\nFix\sa\sfew\sfalse-positivies\sthat\scome\sup\swhen\srunning\sthe\ssanitize=undefined\ntest. -D 2015-01-01T23:02:01.908 +C Add\sthe\sSQLITE_CONFIG_PMASZ\sstart-time\soption. +D 2015-01-02T15:55:29.645 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 335e2d3ff0f2455eacbfa3075fc37495e3321410 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -186,7 +186,7 @@ F src/expr.c 00da3072f362b06f39ce4052baa1d4ce2bb36d1c F src/fault.c 160a0c015b6c2629d3899ed2daf63d75754a32bb F src/fkey.c e0444b61bed271a76840cbe6182df93a9baa3f12 F src/func.c 6d3c4ebd72aa7923ce9b110a7dc15f9b8c548430 -F src/global.c 6ded36dda9466fc1c9a3c5492ded81d79bf3977d +F src/global.c 12561d70a1b25f67b21154622bb1723426724f75 F src/hash.c 4263fbc955f26c2e8cdc0cf214bc42435aa4e4f5 F src/hash.h c8f3c31722cf3277d03713909761e152a5b81094 F src/hwtime.h d32741c8f4df852c7d959236615444e2b1063b08 @@ -195,7 +195,7 @@ F src/journal.c b4124532212b6952f42eb2c12fa3c25701d8ba8d F src/legacy.c ba1863ea58c4c840335a84ec276fc2b25e22bc4e F src/lempar.c 7274c97d24bb46631e504332ccd3bd1b37841770 F src/loadext.c 86bd4e2fccd520b748cba52492ab60c4a770f660 -F src/main.c fa2128ef7d6a3dcd6770b2b1f3c284b696f11a2a +F src/main.c b0a7f3f9ff70106b7735f38c602d1b3ca56eb065 F src/malloc.c 740db54387204c9a2eb67c6d98e68b08e9ef4eab F src/mem0.c 6a55ebe57c46ca1a7d98da93aaa07f99f1059645 F src/mem1.c faf615aafd8be74a71494dfa027c113ea5c6615f @@ -230,10 +230,10 @@ F src/resolve.c f6c46d3434439ab2084618d603e6d6dbeb0d6ada F src/rowset.c eccf6af6d620aaa4579bd3b72c1b6395d9e9fa1e F src/select.c f377fb8a5c73c10678ea74f3400f7913943e3d75 F src/shell.c 45d9c9bd7cde07845af957f2d849933b990773cf -F src/sqlite.h.in 47cb601ed2b2ea7f01119e2763185c809d8e82fa +F src/sqlite.h.in ed799ff5c814227c7957eb4f4a217f67fdc0da48 F src/sqlite3.rc 992c9f5fb8285ae285d6be28240a7e8d3a7f2bad F src/sqlite3ext.h 17d487c3c91b0b8c584a32fbeb393f6f795eea7d -F src/sqliteInt.h d36da9a07130cae13cbfee0986bf20028cb01465 +F src/sqliteInt.h 3e0079855cb7b3c85dffac5bcbb1cd712ac62e65 F src/sqliteLimit.h 164b0e6749d31e0daa1a4589a169d31c0dec7b3d F src/status.c 81712116e826b0089bb221b018929536b2b5406f F src/table.c e7a09215315a978057fb42c640f890160dbcc45e @@ -263,7 +263,7 @@ F src/test_intarray.c 6c610a21ab8edde85a3a2c7f2b069244ecf4d834 F src/test_intarray.h 9dc57417fb65bc7835cc18548852cc08cc062202 F src/test_journal.c f5c0a05b7b3d5930db769b5ee6c3766dc2221a64 F src/test_loadext.c a5251f956ab6af21e138dc1f9c0399394a510cb4 -F src/test_malloc.c ba34143f941a9d74b30bbffc8818389bb73a1ca2 +F src/test_malloc.c fffc66b2e7743ce93f039187d3fd78664193c664 F src/test_multiplex.c caadb62cc777268b4f8fb94d5b27b80156c8f7c0 F src/test_multiplex.h c08e4e8f8651f0c5e0509b138ff4d5b43ed1f5d3 F src/test_mutex.c 293042d623ebba969160f471a82aa1551626454f @@ -298,7 +298,7 @@ F src/vdbeapi.c 4bc511a46b9839392ae0e90844a71dc96d9dbd71 F src/vdbeaux.c 07ef87c6d4b5abdf13ff33babb10205702fdab0a F src/vdbeblob.c 4af4bfb71f6df7778397b4a0ebc1879793276778 F src/vdbemem.c 31d8eabb0cd78bfeab4e5124c7363c3e9e54db9f -F src/vdbesort.c 80e40d889ebb536cb7a5ac4c12fa2a4662bc9181 +F src/vdbesort.c fc1aa0d1a8b539bf3a272945d02c9f9ede93039b F src/vdbetrace.c 7e4222955e07dd707a2f360c0eb73452be1cb010 F src/vtab.c c08ec66f45919eaa726bf88aa53eb08379d607f9 F src/wal.c 85353539f2d9d0c91ebd057c32525b1e1aa3335e @@ -869,12 +869,12 @@ F test/skipscan5.test 67817a4b6857c47e0e33ba3e506da6f23ef68de2 F test/skipscan6.test 5866039d03a56f5bd0b3d172a012074a1d90a15b F test/soak.test 0b5b6375c9f4110c828070b826b3b4b0bb65cd5f F test/softheap1.test 40562fe6cac6d9827b7b42b86d45aedf12c15e24 -F test/sort.test c4400e7533748f6bd7413851ff148645e82b9e2d -F test/sort2.test 84a92eebf697feee9c6697746918c7d67373eea1 +F test/sort.test 3f492e5b7be1d3f756728d2ff6edf4f6091e84cb +F test/sort2.test 37afbc03f5559f2eb0f18940b55d38dfbb5172ac F test/sort3.test 6178ade30810ac9166fcdf14b7065e49c0f534e2 -F test/sort4.test 6c37d85f7cd28d50cce222fcab84ccd771e105cb +F test/sort4.test d5e8903194ae551551349ce25dc8d0b40ca2b9c3 F test/sort5.test a448240a42b49239edc00f85d6d7ac7a1b261e1f -F test/sortfault.test b8e35177f97438b930ee87c9419ca2599e8073e1 +F test/sortfault.test d4ccf606a0c77498e2beb542764fd9394acb4d66 F test/speed1.test f2974a91d79f58507ada01864c0e323093065452 F test/speed1p.explain d841e650a04728b39e6740296b852dccdca9b2cb F test/speed1p.test b180e98609c7677382cf618c0ec9b69f789033a8 @@ -1234,7 +1234,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P c55c05fe22b9ddb61de55d473a411a11090d3d68 -R e6aaf3935879f250648e86cbf64d3bdf +P 2835e79a0afec6e4d449ac9340afec068c2d4c11 +R 382d23526375da181cc875b46066d9ad U drh -Z 20260de80f5f5cb2f8311d6a05cba05e +Z bc81c476960284f7c54d9feff6b6453a diff --git a/manifest.uuid b/manifest.uuid index b69d1dbdb9..4fa42f8241 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -2835e79a0afec6e4d449ac9340afec068c2d4c11 \ No newline at end of file +acb0d1e8324f19da3d4d577d58748848de1bcef7 \ No newline at end of file diff --git a/src/global.c b/src/global.c index 4bc8edb3bc..c7043bba48 100644 --- a/src/global.c +++ b/src/global.c @@ -152,6 +152,13 @@ const unsigned char sqlite3CtypeMap[256] = { # define SQLITE_ALLOW_COVERING_INDEX_SCAN 1 #endif +/* The minimum PMA size is set to this value multiplied by the database +** page size in bytes. +*/ +#ifndef SQLITE_SORTER_PMASZ +# define SQLITE_SORTER_PMASZ 250 +#endif + /* ** The following singleton contains the global configuration for ** the SQLite library. @@ -182,6 +189,7 @@ SQLITE_WSD struct Sqlite3Config sqlite3Config = { 0, /* nPage */ 0, /* mxParserStack */ 0, /* sharedCacheEnabled */ + SQLITE_SORTER_PMASZ, /* szPma */ /* All the rest should always be initialized to zero */ 0, /* isInit */ 0, /* inProgress */ diff --git a/src/main.c b/src/main.c index 3220cfe8f6..8af34cc2f1 100644 --- a/src/main.c +++ b/src/main.c @@ -594,6 +594,11 @@ int sqlite3_config(int op, ...){ } #endif + case SQLITE_CONFIG_PMASZ: { + sqlite3GlobalConfig.szPma = va_arg(ap, unsigned int); + break; + } + default: { rc = SQLITE_ERROR; break; diff --git a/src/sqlite.h.in b/src/sqlite.h.in index b525b396f4..e13ee0acc9 100644 --- a/src/sqlite.h.in +++ b/src/sqlite.h.in @@ -1745,6 +1745,17 @@ struct sqlite3_mem_methods { ** bytes per page required for each page in [SQLITE_CONFIG_PAGECACHE]. ** The amount of extra space required can change depending on the compiler, ** target platform, and SQLite version. +** +** [[SQLITE_CONFIG_PMASZ]] +**
SQLITE_CONFIG_PMASZ +**
^The SQLITE_CONFIG_PMASZ option takes a single parameter which +** is an unsigned integer and sets the "Minimum PMA Size" for the multithreaded +** sorter to that integer. The default minimum PMA Size is set by the +** [SQLITE_SORTER_PMASZ] compile-time option. New threads are launched +** to help with sort operations when multithreaded sorting +** is enabled (using the [PRAGMA threads] command) and the amount of content +** to be sorted exceeds the page size times the minimum of the +** [PRAGMA cache_size] setting and this value. ** */ #define SQLITE_CONFIG_SINGLETHREAD 1 /* nil */ @@ -1771,6 +1782,7 @@ struct sqlite3_mem_methods { #define SQLITE_CONFIG_MMAP_SIZE 22 /* sqlite3_int64, sqlite3_int64 */ #define SQLITE_CONFIG_WIN32_HEAPSIZE 23 /* int nByte */ #define SQLITE_CONFIG_PCACHE_HDRSZ 24 /* int *psz */ +#define SQLITE_CONFIG_PMASZ 25 /* unsigned int szPma */ /* ** CAPI3REF: Database Connection Configuration Options diff --git a/src/sqliteInt.h b/src/sqliteInt.h index d90089ba0e..4a4137f0f6 100644 --- a/src/sqliteInt.h +++ b/src/sqliteInt.h @@ -2839,6 +2839,7 @@ struct Sqlite3Config { int nPage; /* Number of pages in pPage[] */ int mxParserStack; /* maximum depth of the parser stack */ int sharedCacheEnabled; /* true if shared-cache mode enabled */ + u32 szPma; /* Maximum Sorter PMA size */ /* The above might be initialized to non-zero. The following need to always ** initially be zero, however. */ int isInit; /* True after initialization has finished */ diff --git a/src/test_malloc.c b/src/test_malloc.c index bd0a3d1ffd..54a89472d0 100644 --- a/src/test_malloc.c +++ b/src/test_malloc.c @@ -1260,6 +1260,34 @@ static int test_config_cis( return TCL_OK; } +/* +** Usage: sqlite3_config_pmasz INTEGER +** +** Set the minimum PMA size. +*/ +static int test_config_pmasz( + void * clientData, + Tcl_Interp *interp, + int objc, + Tcl_Obj *CONST objv[] +){ + int rc; + int iPmaSz; + + if( objc!=2 ){ + Tcl_WrongNumArgs(interp, 1, objv, "BOOL"); + return TCL_ERROR; + } + if( Tcl_GetIntFromObj(interp, objv[1], &iPmaSz) ){ + return TCL_ERROR; + } + + rc = sqlite3_config(SQLITE_CONFIG_PMASZ, iPmaSz); + Tcl_SetResult(interp, (char *)sqlite3ErrName(rc), TCL_VOLATILE); + + return TCL_OK; +} + /* ** Usage: sqlite3_dump_memsys3 FILENAME @@ -1514,6 +1542,7 @@ int Sqlitetest_malloc_Init(Tcl_Interp *interp){ { "sqlite3_config_error", test_config_error ,0 }, { "sqlite3_config_uri", test_config_uri ,0 }, { "sqlite3_config_cis", test_config_cis ,0 }, + { "sqlite3_config_pmasz", test_config_pmasz ,0 }, { "sqlite3_db_config_lookaside",test_db_config_lookaside ,0 }, { "sqlite3_dump_memsys3", test_dump_memsys3 ,3 }, { "sqlite3_dump_memsys5", test_dump_memsys3 ,5 }, diff --git a/src/vdbesort.c b/src/vdbesort.c index d022af9af6..0d16324e2a 100644 --- a/src/vdbesort.c +++ b/src/vdbesort.c @@ -152,7 +152,7 @@ ** to a level 0 PMA. The purpose of this limit is to prevent various integer ** overflows. 512MiB. */ -#define SQLITE_MAX_MXPMASIZE (1<<29) +#define SQLITE_MAX_PMASZ (1<<29) /* ** Private objects used by the sorter @@ -448,11 +448,6 @@ struct SorterRecord { */ #define SRVAL(p) ((void*)((SorterRecord*)(p) + 1)) -/* The minimum PMA size is set to this value multiplied by the database -** page size in bytes. */ -#ifndef SQLITE_SORTER_PMASZ -# define SQLITE_SORTER_PMASZ 10 -#endif /* Maximum number of PMAs that a single MergeEngine can merge */ #define SORTER_MAX_MERGE_COUNT 16 @@ -851,10 +846,11 @@ int sqlite3VdbeSorterInit( } if( !sqlite3TempInMemory(db) ){ - pSorter->mnPmaSize = SQLITE_SORTER_PMASZ * pgsz; + u32 szPma = sqlite3GlobalConfig.szPma; + pSorter->mnPmaSize = szPma * pgsz; mxCache = db->aDb[0].pSchema->cache_size; - if( mxCachemxPmaSize = MIN((i64)mxCache*pgsz, SQLITE_MAX_MXPMASIZE); + if( mxCachemxPmaSize = MIN((i64)mxCache*pgsz, SQLITE_MAX_PMASZ); /* EVIDENCE-OF: R-26747-61719 When the application provides any amount of ** scratch memory using SQLITE_CONFIG_SCRATCH, SQLite avoids unnecessary diff --git a/test/sort.test b/test/sort.test index be2a6f531c..21b11d6c88 100644 --- a/test/sort.test +++ b/test/sort.test @@ -16,6 +16,11 @@ set testdir [file dirname $argv0] source $testdir/tester.tcl set testprefix sort +db close +sqlite3_shutdown +sqlite3_config_pmasz 10 +sqlite3_initialize +sqlite3 db test.db # Create a bunch of data to sort against # diff --git a/test/sort2.test b/test/sort2.test index a4c55c9f24..890025a5d0 100644 --- a/test/sort2.test +++ b/test/sort2.test @@ -17,6 +17,11 @@ set testdir [file dirname $argv0] source $testdir/tester.tcl set testprefix sort2 +db close +sqlite3_shutdown +sqlite3_config_pmasz 10 +sqlite3_initialize +sqlite3 db test.db foreach {tn script} { 1 { } diff --git a/test/sort4.test b/test/sort4.test index 01fcbfee95..7b913610da 100644 --- a/test/sort4.test +++ b/test/sort4.test @@ -17,6 +17,12 @@ set testdir [file dirname $argv0] source $testdir/tester.tcl set testprefix sort4 +db close +sqlite3_shutdown +sqlite3_config_pmasz 10 +sqlite3_initialize +sqlite3 db test.db + # Configure the sorter to use 3 background threads. db eval {PRAGMA threads=3} diff --git a/test/sortfault.test b/test/sortfault.test index a1983ac1c0..f9fe2be48a 100644 --- a/test/sortfault.test +++ b/test/sortfault.test @@ -17,6 +17,12 @@ set testdir [file dirname $argv0] source $testdir/tester.tcl set testprefix sortfault +db close +sqlite3_shutdown +sqlite3_config_pmasz 10 +sqlite3_initialize +sqlite3 db test.db + do_execsql_test 1.0 { PRAGMA cache_size = 5;