From c7401d51c460f7a810609307963a0f78ff15bb53 Mon Sep 17 00:00:00 2001 From: drh Date: Wed, 30 Oct 2013 03:25:45 +0000 Subject: [PATCH 1/6] Add the "Esri Spatially-Enabled Database" file format to the magic.txt file. FossilOrigin-Name: 8530a18f40c8f938da880306d6d9f762c2e4c6a7 --- magic.txt | 1 + manifest | 12 ++++++------ manifest.uuid | 2 +- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/magic.txt b/magic.txt index c6340d9b18..add96a7363 100644 --- a/magic.txt +++ b/magic.txt @@ -27,4 +27,5 @@ >60 belong =0x5f4d544e Monotone source repository - >68 belong =0x47504b47 OGC GeoPackage file - >68 belong =0x47503130 OGC GeoPackage version 1.0 file - +>68 belong =0x45737269 Esri Spatially-Enabled Database - >0 string =SQLite SQLite3 database diff --git a/manifest b/manifest index 7515e3a471..bf759d7eb5 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Add\sthe\sSQLITE_ENABLE_EXPLAIN_COMMENTS\scompile-time\soption\sto\senable\sextra\ncommentary\sin\sthe\sEXPLAIN\soutput.\s\sFormerly,\sthis\swas\sonly\savailable\swith\nSQLITE_DEBUG. -D 2013-10-30T02:28:23.508 +C Add\sthe\s"Esri\sSpatially-Enabled\sDatabase"\sfile\sformat\sto\sthe\smagic.txt\sfile. +D 2013-10-30T03:25:45.892 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 0522b53cdc1fcfc18f3a98e0246add129136c654 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -140,7 +140,7 @@ F ext/rtree/tkt3363.test 142ab96eded44a3615ec79fba98c7bde7d0f96de F ext/rtree/viewrtree.tcl eea6224b3553599ae665b239bd827e182b466024 F install-sh 9d4de14ab9fb0facae2f48780b874848cbf2f895 x F ltmain.sh 3ff0879076df340d2e23ae905484d8c15d5fdea8 -F magic.txt 814d3de5ec227817ff2ad26cbc73159c968a2a58 +F magic.txt f439556c5ce01ced70987e5ee86549a45165d9ff F main.mk c6a433cb334bbb019625c137ab5d5e7568b47cff F mkdll.sh 7d09b23c05d56532e9d44a50868eb4b12ff4f74a F mkextu.sh 416f9b7089d80e5590a29692c9d9280a10dbad9f @@ -1126,7 +1126,7 @@ F tool/vdbe-compress.tcl f12c884766bd14277f4fcedcae07078011717381 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh d1a6de74685f360ab718efda6265994b99bbea01 F tool/win/sqlite.vsix 030f3eeaf2cb811a3692ab9c14d021a75ce41fff -P d6b0c39281d0751ecec04d7c19d9d2931d133e8e -R 97e786a08b0a2c7a14cb84c2e159324e +P e1a89b56f7173166bb9224e2e360fd67ad3399c3 +R 3e3608c916b0a3a0df2a5a0ccce943bf U drh -Z 1b6acaf0339443874185cc93aaa66a02 +Z c375e6da0a6d197b05695de149565d85 diff --git a/manifest.uuid b/manifest.uuid index 04847cc775..f249caa1d9 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -e1a89b56f7173166bb9224e2e360fd67ad3399c3 \ No newline at end of file +8530a18f40c8f938da880306d6d9f762c2e4c6a7 \ No newline at end of file From 4340831cc9359500e33edf1280cc3069b809c6aa Mon Sep 17 00:00:00 2001 From: drh Date: Wed, 30 Oct 2013 12:43:36 +0000 Subject: [PATCH 2/6] Enhance the timer in the shell to show wall-clock time in addition to user and kernel CPU time. FossilOrigin-Name: 908e2c2124baece578e7a665f42b6b483b8f1d64 --- manifest | 12 ++++++------ manifest.uuid | 2 +- src/shell.c | 36 ++++++++++++++++++++++++++++++------ 3 files changed, 37 insertions(+), 13 deletions(-) diff --git a/manifest b/manifest index bf759d7eb5..ecc6dc5890 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Add\sthe\s"Esri\sSpatially-Enabled\sDatabase"\sfile\sformat\sto\sthe\smagic.txt\sfile. -D 2013-10-30T03:25:45.892 +C Enhance\sthe\stimer\sin\sthe\sshell\sto\sshow\swall-clock\stime\sin\saddition\nto\suser\sand\skernel\sCPU\stime. +D 2013-10-30T12:43:36.721 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 0522b53cdc1fcfc18f3a98e0246add129136c654 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -219,7 +219,7 @@ F src/random.c 0b2dbc37fdfbfa6bd455b091dfcef5bdb32dba68 F src/resolve.c 572585a96bf282bb9c3d9e08785ec3cae21dc488 F src/rowset.c 64655f1a627c9c212d9ab497899e7424a34222e0 F src/select.c 15127b54cc11defb2cddef6914e1f384501a61c4 -F src/shell.c d5eebdc6034014103de2b9d58e1d3f6f7de0fb50 +F src/shell.c 03d8d9b4052430343ff30d646334621f980f1202 F src/sqlite.h.in 547a44dd4ff4d975e92a645ea2d609e543a83d0f F src/sqlite3.rc 11094cc6a157a028b301a9f06b3d03089ea37c3e F src/sqlite3ext.h 886f5a34de171002ad46fae8c36a7d8051c190fc @@ -1126,7 +1126,7 @@ F tool/vdbe-compress.tcl f12c884766bd14277f4fcedcae07078011717381 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh d1a6de74685f360ab718efda6265994b99bbea01 F tool/win/sqlite.vsix 030f3eeaf2cb811a3692ab9c14d021a75ce41fff -P e1a89b56f7173166bb9224e2e360fd67ad3399c3 -R 3e3608c916b0a3a0df2a5a0ccce943bf +P 8530a18f40c8f938da880306d6d9f762c2e4c6a7 +R 4b1797e4a9134f44635edbdfd6abc433 U drh -Z c375e6da0a6d197b05695de149565d85 +Z a2af30a7bb5714b498e5d1b1480f9dde diff --git a/manifest.uuid b/manifest.uuid index f249caa1d9..da60cda217 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -8530a18f40c8f938da880306d6d9f762c2e4c6a7 \ No newline at end of file +908e2c2124baece578e7a665f42b6b483b8f1d64 \ No newline at end of file diff --git a/src/shell.c b/src/shell.c index 26c38c59ea..c3aee04633 100644 --- a/src/shell.c +++ b/src/shell.c @@ -86,21 +86,38 @@ extern int pclose(FILE*); #define isatty(x) 1 #endif -/* True if the timer is enabled */ -static int enableTimer = 0; - /* ctype macros that work with signed characters */ #define IsSpace(X) isspace((unsigned char)X) #define IsDigit(X) isdigit((unsigned char)X) #define ToLower(X) (char)tolower((unsigned char)X) + +/* True if the timer is enabled */ +static int enableTimer = 0; + +/* Return the current wall-clock time */ +static sqlite3_int64 timeOfDay(void){ + static sqlite3_vfs *clockVfs = 0; + sqlite3_int64 t; + if( clockVfs==0 ) clockVfs = sqlite3_vfs_find(0); + if( clockVfs->iVersion>=1 && clockVfs->xCurrentTimeInt64!=0 ){ + clockVfs->xCurrentTimeInt64(clockVfs, &t); + }else{ + double r; + clockVfs->xCurrentTime(clockVfs, &r); + t = (sqlite3_int64)(r*86400000.0); + } + return t; +} + #if !defined(_WIN32) && !defined(WIN32) && !defined(_WRS_KERNEL) \ && !defined(__minux) #include #include /* Saved resource information for the beginning of an operation */ -static struct rusage sBegin; +static struct rusage sBegin; /* CPU time at start */ +static sqlite3_int64 iBegin; /* Wall-clock time at start */ /* ** Begin timing an operation @@ -108,6 +125,7 @@ static struct rusage sBegin; static void beginTimer(void){ if( enableTimer ){ getrusage(RUSAGE_SELF, &sBegin); + iBegin = timeOfDay(); } } @@ -123,8 +141,10 @@ static double timeDiff(struct timeval *pStart, struct timeval *pEnd){ static void endTimer(void){ if( enableTimer ){ struct rusage sEnd; + sqlite3_int64 iEnd = timeOfDay(); getrusage(RUSAGE_SELF, &sEnd); - printf("CPU Time: user %f sys %f\n", + printf("Run Time: real %.3f user %f sys %f\n", + (iEnd - iBegin)*0.001, timeDiff(&sBegin.ru_utime, &sEnd.ru_utime), timeDiff(&sBegin.ru_stime, &sEnd.ru_stime)); } @@ -142,6 +162,7 @@ static void endTimer(void){ static HANDLE hProcess; static FILETIME ftKernelBegin; static FILETIME ftUserBegin; +static sqlite3_int64 ftWallBegin; typedef BOOL (WINAPI *GETPROCTIMES)(HANDLE, LPFILETIME, LPFILETIME, LPFILETIME, LPFILETIME); static GETPROCTIMES getProcessTimesAddr = NULL; @@ -179,6 +200,7 @@ static void beginTimer(void){ if( enableTimer && getProcessTimesAddr ){ FILETIME ftCreation, ftExit; getProcessTimesAddr(hProcess, &ftCreation, &ftExit, &ftKernelBegin, &ftUserBegin); + ftWallBegin = timeOfDay(); } } @@ -195,8 +217,10 @@ static double timeDiff(FILETIME *pStart, FILETIME *pEnd){ static void endTimer(void){ if( enableTimer && getProcessTimesAddr){ FILETIME ftCreation, ftExit, ftKernelEnd, ftUserEnd; + sqlite3_int64 ftWallEnd = timeOfDay(); getProcessTimesAddr(hProcess, &ftCreation, &ftExit, &ftKernelEnd, &ftUserEnd); - printf("CPU Time: user %f sys %f\n", + printf("Run Time: real %.3f user %f sys %f\n", + (ftWallEnd - ftWallBegin)*0.001, timeDiff(&ftUserBegin, &ftUserEnd), timeDiff(&ftKernelBegin, &ftKernelEnd)); } From 2744938e82be5c963245ce4e2c4a617f5d4ba771 Mon Sep 17 00:00:00 2001 From: mistachkin Date: Thu, 31 Oct 2013 06:11:10 +0000 Subject: [PATCH 3/6] Fix harmless compiler warnings. FossilOrigin-Name: 1a0a88657f54874703fc05f828ce29ad115d9f28 --- manifest | 14 +++++++------- manifest.uuid | 2 +- src/test6.c | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/manifest b/manifest index ecc6dc5890..e38cb171e1 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Enhance\sthe\stimer\sin\sthe\sshell\sto\sshow\swall-clock\stime\sin\saddition\nto\suser\sand\skernel\sCPU\stime. -D 2013-10-30T12:43:36.721 +C Fix\sharmless\scompiler\swarnings. +D 2013-10-31T06:11:10.437 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 0522b53cdc1fcfc18f3a98e0246add129136c654 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -233,7 +233,7 @@ F src/test2.c 7355101c085304b90024f2261e056cdff13c6c35 F src/test3.c 1c0e5d6f080b8e33c1ce8b3078e7013fdbcd560c F src/test4.c 9b32d22f5f150abe23c1830e2057c4037c45b3df F src/test5.c a6d1ac55ac054d0b2b8f37b5e655b6c92645a013 -F src/test6.c 00af0fe1947305222b8ed488a69c76c5a2b632e2 +F src/test6.c 4f958b71334695e65746d357dac77709732b28db F src/test7.c 72b732baa5642f795655ba1126ea032af46ecfd2 F src/test8.c c7aab1d9fbbf54fc33d43b73aa24aa55f9eaf534 F src/test9.c bea1e8cf52aa93695487badedd6e1886c321ea60 @@ -1126,7 +1126,7 @@ F tool/vdbe-compress.tcl f12c884766bd14277f4fcedcae07078011717381 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh d1a6de74685f360ab718efda6265994b99bbea01 F tool/win/sqlite.vsix 030f3eeaf2cb811a3692ab9c14d021a75ce41fff -P 8530a18f40c8f938da880306d6d9f762c2e4c6a7 -R 4b1797e4a9134f44635edbdfd6abc433 -U drh -Z a2af30a7bb5714b498e5d1b1480f9dde +P 908e2c2124baece578e7a665f42b6b483b8f1d64 +R 23ef143be49c0a216ae28708adaf378d +U mistachkin +Z 3bcc2024c33f836e2f13b6cc80fcc85e diff --git a/manifest.uuid b/manifest.uuid index da60cda217..6ca07fb44e 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -908e2c2124baece578e7a665f42b6b483b8f1d64 \ No newline at end of file +1a0a88657f54874703fc05f828ce29ad115d9f28 \ No newline at end of file diff --git a/src/test6.c b/src/test6.c index 2020885c46..6ea03b0f1c 100644 --- a/src/test6.c +++ b/src/test6.c @@ -621,7 +621,7 @@ static int cfOpen( pWrapper->flags = flags; } if( rc==SQLITE_OK ){ - pWrapper->nData = (4096 + pWrapper->iSize); + pWrapper->nData = (int)(4096 + pWrapper->iSize); pWrapper->zData = crash_malloc(pWrapper->nData); if( pWrapper->zData ){ /* os_unix.c contains an assert() that fails if the caller attempts @@ -637,7 +637,7 @@ static int cfOpen( memset(pWrapper->zData, 0, pWrapper->nData); for(iOff=0; iOffiSize; iOff += 512){ - int nRead = pWrapper->iSize - (int)iOff; + int nRead = (int)(pWrapper->iSize - iOff); if( nRead>512 ) nRead = 512; if( isDb && iOff==PENDING_BYTE ) continue; rc = sqlite3OsRead(pReal, &pWrapper->zData[iOff], nRead, iOff); From 99eef00d437265fca9a53e186a6a098f10f6b885 Mon Sep 17 00:00:00 2001 From: mistachkin Date: Thu, 31 Oct 2013 06:13:57 +0000 Subject: [PATCH 4/6] Enable some more tests on Windows. FossilOrigin-Name: 72389c295bb240ec76746e289403b82e04189903 --- manifest | 14 +++--- manifest.uuid | 2 +- src/test_config.c | 5 --- test/crash8.test | 112 ++++++++++++++++++++++++---------------------- 4 files changed, 67 insertions(+), 66 deletions(-) diff --git a/manifest b/manifest index e38cb171e1..a322753db5 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Fix\sharmless\scompiler\swarnings. -D 2013-10-31T06:11:10.437 +C Enable\ssome\smore\stests\son\sWindows. +D 2013-10-31T06:13:57.969 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 0522b53cdc1fcfc18f3a98e0246add129136c654 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -241,7 +241,7 @@ F src/test_async.c 21e11293a2f72080eda70e1124e9102044531cd8 F src/test_autoext.c dea8a01a7153b9adc97bd26161e4226329546e12 F src/test_backup.c 3875e899222b651e18b662f86e0e50daa946344e F src/test_btree.c 5b89601dcb42a33ba8b820a6b763cc9cb48bac16 -F src/test_config.c 3d148e338b575bd937f7746824f36a9c6682d238 +F src/test_config.c e825cd6a4a8f498be246fc5934fe5fd702b9441f F src/test_demovfs.c 69b2085076654ebc18014cbc6386f04409c959a9 F src/test_devsym.c e7498904e72ba7491d142d5c83b476c4e76993bc F src/test_fs.c ced436e3d4b8e4681328409b8081051ce614e28f @@ -411,7 +411,7 @@ F test/crash4.test fe2821baf37168dc59dd733dcf7dba2a401487bc F test/crash5.test 05dd3aa9dbb751a22d5cdaf22a9c49b6667aa219 F test/crash6.test 4c56f1e40d0291e1110790a99807aa875b1647ba F test/crash7.test 1a194c4900a255258cf94b7fcbfd29536db572df -F test/crash8.test 38767cb504bbe491de6be4a7006b154973a2309f +F test/crash8.test 61442a9964ab6b124fc5254e4258b45747842e6f F test/crashtest1.c 09c1c7d728ccf4feb9e481671e29dda5669bbcc2 F test/createtab.test b5de160630b209c4b8925bdcbbaf48cc90b67fe8 F test/cse.test 277350a26264495e86b1785f34d2d0c8600e021c @@ -1126,7 +1126,7 @@ F tool/vdbe-compress.tcl f12c884766bd14277f4fcedcae07078011717381 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh d1a6de74685f360ab718efda6265994b99bbea01 F tool/win/sqlite.vsix 030f3eeaf2cb811a3692ab9c14d021a75ce41fff -P 908e2c2124baece578e7a665f42b6b483b8f1d64 -R 23ef143be49c0a216ae28708adaf378d +P 1a0a88657f54874703fc05f828ce29ad115d9f28 +R 3ecce2c5ce21312a1dbb296432d69334 U mistachkin -Z 3bcc2024c33f836e2f13b6cc80fcc85e +Z 202c1504aa0d2b90c6b0d6f25f8395e7 diff --git a/manifest.uuid b/manifest.uuid index 6ca07fb44e..57dee51f04 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -1a0a88657f54874703fc05f828ce29ad115d9f28 \ No newline at end of file +72389c295bb240ec76746e289403b82e04189903 \ No newline at end of file diff --git a/src/test_config.c b/src/test_config.c index de1822e3b1..8d871aa74c 100644 --- a/src/test_config.c +++ b/src/test_config.c @@ -252,12 +252,7 @@ static void set_options(Tcl_Interp *interp){ #endif Tcl_SetVar2(interp, "sqlite_options", "conflict", "1", TCL_GLOBAL_ONLY); - -#if SQLITE_OS_UNIX Tcl_SetVar2(interp, "sqlite_options", "crashtest", "1", TCL_GLOBAL_ONLY); -#else - Tcl_SetVar2(interp, "sqlite_options", "crashtest", "0", TCL_GLOBAL_ONLY); -#endif #ifdef SQLITE_OMIT_DATETIME_FUNCS Tcl_SetVar2(interp, "sqlite_options", "datetime", "0", TCL_GLOBAL_ONLY); diff --git a/test/crash8.test b/test/crash8.test index 8bc258651a..930834a962 100644 --- a/test/crash8.test +++ b/test/crash8.test @@ -341,62 +341,68 @@ ifcapable pragma { } {jkl} } -for {set i 1} {$i < 10} {incr i} { - catch { db close } - forcedelete test.db test.db-journal - sqlite3 db test.db - do_test crash8-5.$i.1 { - execsql { - CREATE TABLE t1(x PRIMARY KEY); - INSERT INTO t1 VALUES(randomblob(900)); - INSERT INTO t1 SELECT randomblob(900) FROM t1; - INSERT INTO t1 SELECT randomblob(900) FROM t1; - INSERT INTO t1 SELECT randomblob(900) FROM t1; - INSERT INTO t1 SELECT randomblob(900) FROM t1; - INSERT INTO t1 SELECT randomblob(900) FROM t1; - INSERT INTO t1 SELECT randomblob(900) FROM t1; /* 64 rows */ - } - crashsql -file test.db -delay [expr ($::i%2) + 1] { - PRAGMA cache_size = 10; - BEGIN; - UPDATE t1 SET x = randomblob(900); - ROLLBACK; - INSERT INTO t1 VALUES(randomblob(900)); - } - execsql { PRAGMA integrity_check } - } {ok} +# +# Since the following tests (crash8-5.*) rely upon being able +# to copy a file while open, they will not work on Windows. +# +if {$::tcl_platform(platform)=="unix"} { + for {set i 1} {$i < 10} {incr i} { + catch { db close } + forcedelete test.db test.db-journal + sqlite3 db test.db + do_test crash8-5.$i.1 { + execsql { + CREATE TABLE t1(x PRIMARY KEY); + INSERT INTO t1 VALUES(randomblob(900)); + INSERT INTO t1 SELECT randomblob(900) FROM t1; + INSERT INTO t1 SELECT randomblob(900) FROM t1; + INSERT INTO t1 SELECT randomblob(900) FROM t1; + INSERT INTO t1 SELECT randomblob(900) FROM t1; + INSERT INTO t1 SELECT randomblob(900) FROM t1; + INSERT INTO t1 SELECT randomblob(900) FROM t1; /* 64 rows */ + } + crashsql -file test.db -delay [expr ($::i%2) + 1] { + PRAGMA cache_size = 10; + BEGIN; + UPDATE t1 SET x = randomblob(900); + ROLLBACK; + INSERT INTO t1 VALUES(randomblob(900)); + } + execsql { PRAGMA integrity_check } + } {ok} - catch { db close } - forcedelete test.db test.db-journal - sqlite3 db test.db - do_test crash8-5.$i.2 { - execsql { - PRAGMA cache_size = 10; - CREATE TABLE t1(x PRIMARY KEY); - INSERT INTO t1 VALUES(randomblob(900)); - INSERT INTO t1 SELECT randomblob(900) FROM t1; - INSERT INTO t1 SELECT randomblob(900) FROM t1; - INSERT INTO t1 SELECT randomblob(900) FROM t1; - INSERT INTO t1 SELECT randomblob(900) FROM t1; - INSERT INTO t1 SELECT randomblob(900) FROM t1; - INSERT INTO t1 SELECT randomblob(900) FROM t1; /* 64 rows */ - BEGIN; - UPDATE t1 SET x = randomblob(900); - } - forcedelete testX.db testX.db-journal testX.db-wal - forcecopy test.db testX.db - forcecopy test.db-journal testX.db-journal - db close + catch { db close } + forcedelete test.db test.db-journal + sqlite3 db test.db + do_test crash8-5.$i.2 { + execsql { + PRAGMA cache_size = 10; + CREATE TABLE t1(x PRIMARY KEY); + INSERT INTO t1 VALUES(randomblob(900)); + INSERT INTO t1 SELECT randomblob(900) FROM t1; + INSERT INTO t1 SELECT randomblob(900) FROM t1; + INSERT INTO t1 SELECT randomblob(900) FROM t1; + INSERT INTO t1 SELECT randomblob(900) FROM t1; + INSERT INTO t1 SELECT randomblob(900) FROM t1; + INSERT INTO t1 SELECT randomblob(900) FROM t1; /* 64 rows */ + BEGIN; + UPDATE t1 SET x = randomblob(900); + } + forcedelete testX.db testX.db-journal testX.db-wal + forcecopy test.db testX.db + forcecopy test.db-journal testX.db-journal + db close - crashsql -file test.db -delay [expr ($::i%2) + 1] { - SELECT * FROM sqlite_master; - INSERT INTO t1 VALUES(randomblob(900)); - } + crashsql -file test.db -delay [expr ($::i%2) + 1] { + SELECT * FROM sqlite_master; + INSERT INTO t1 VALUES(randomblob(900)); + } - sqlite3 db2 testX.db - execsql { PRAGMA integrity_check } db2 - } {ok} + sqlite3 db2 testX.db + execsql { PRAGMA integrity_check } db2 + } {ok} + } + catch {db2 close} } -catch {db2 close} finish_test From 293566eaf29579527c8cb17a967ee81dfb0724f1 Mon Sep 17 00:00:00 2001 From: mistachkin Date: Thu, 31 Oct 2013 06:39:15 +0000 Subject: [PATCH 5/6] Update comments in the MSVC batch build tool. FossilOrigin-Name: 0414bb73ef83332bec3d06471d431690356dbe13 --- manifest | 12 ++++++------ manifest.uuid | 2 +- tool/build-all-msvc.bat | 33 +++++++++++++++++++++++++-------- 3 files changed, 32 insertions(+), 15 deletions(-) diff --git a/manifest b/manifest index a322753db5..bf83d16b16 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Enable\ssome\smore\stests\son\sWindows. -D 2013-10-31T06:13:57.969 +C Update\scomments\sin\sthe\sMSVC\sbatch\sbuild\stool. +D 2013-10-31T06:39:15.748 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 0522b53cdc1fcfc18f3a98e0246add129136c654 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -1077,7 +1077,7 @@ F test/win32lock.test 7a6bd73a5dcdee39b5bb93e92395e1773a194361 F test/win32longpath.test e2aafc07e6990fe86c69be22a3d1a0e210cd329b F test/zeroblob.test caaecfb4f908f7bc086ed238668049f96774d688 F test/zerodamage.test 209d7ed441f44cc5299e4ebffbef06fd5aabfefd -F tool/build-all-msvc.bat 38623a30fd58288fda5cc7f7df2682aaab75c9d5 x +F tool/build-all-msvc.bat 1bac6adc3fdb4d9204f21d17b14be25778370e48 x F tool/build-shell.sh 950f47c6174f1eea171319438b93ba67ff5bf367 F tool/checkSpacing.c 810e51703529a204fc4e1eb060e9ab663e3c06d2 F tool/diffdb.c 7524b1b5df217c20cd0431f6789851a4e0cb191b @@ -1126,7 +1126,7 @@ F tool/vdbe-compress.tcl f12c884766bd14277f4fcedcae07078011717381 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh d1a6de74685f360ab718efda6265994b99bbea01 F tool/win/sqlite.vsix 030f3eeaf2cb811a3692ab9c14d021a75ce41fff -P 1a0a88657f54874703fc05f828ce29ad115d9f28 -R 3ecce2c5ce21312a1dbb296432d69334 +P 72389c295bb240ec76746e289403b82e04189903 +R 1054ff58e814a30ba005df284390b721 U mistachkin -Z 202c1504aa0d2b90c6b0d6f25f8395e7 +Z 4b58002663daf257cb37f517515be69c diff --git a/manifest.uuid b/manifest.uuid index 57dee51f04..fcb87c7a76 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -72389c295bb240ec76746e289403b82e04189903 \ No newline at end of file +0414bb73ef83332bec3d06471d431690356dbe13 \ No newline at end of file diff --git a/tool/build-all-msvc.bat b/tool/build-all-msvc.bat index ed05f959fe..c730943f68 100755 --- a/tool/build-all-msvc.bat +++ b/tool/build-all-msvc.bat @@ -252,7 +252,7 @@ FOR %%P IN (%PLATFORMS%) DO ( CALL :fn_CopyVariable %%P_NAME PLATFORMNAME REM - REM NOTE: This is the inner loop. There should be exactly one iteration. + REM NOTE: This is the second loop. There should be exactly one iteration. REM This loop is necessary because the PlatformName environment REM variable was set above and that value is needed by some of the REM commands contained in the inner loop. If these commands were @@ -289,6 +289,10 @@ FOR %%P IN (%PLATFORMS%) DO ( REM SET PATH=%TOOLPATH%;%SystemRoot%\System32;%SystemRoot% + REM + REM NOTE: This is the inner loop. There are normally two iterations, one + REM for each supported build configuration, e.g. Debug or Retail. + REM FOR %%B IN (%CONFIGURATIONS%) DO ( REM REM NOTE: When preparing the debug build, set the DEBUG and MEMDEBUG @@ -318,6 +322,10 @@ FOR %%P IN (%PLATFORMS%) DO ( REM platform to the platform-specific directory beneath the REM binary directory. REM + REM 5. Unless prevented from doing so, copy the "sqlite3.pdb" + REM symbols file for this platform to the platform-specific + REM directory beneath the binary directory. + REM "%ComSpec%" /C ( REM REM NOTE: Attempt to setup the MSVC environment for this platform. @@ -345,21 +353,30 @@ FOR %%P IN (%PLATFORMS%) DO ( ) REM - REM NOTE: When using MSVC 2012, the native SDK path cannot simply use - REM the "lib" sub-directory beneath the location specified in the - REM WindowsSdkDir environment variable because that location does - REM not actually contain the necessary library files for x86. - REM This must be done for each iteration because it relies upon - REM the WindowsSdkDir environment variable being set by the batch - REM file used to setup the MSVC environment. + REM NOTE: When using MSVC 2012 and/or 2013, the native SDK path cannot + REM simply use the "lib" sub-directory beneath the location + REM specified in the WindowsSdkDir environment variable because + REM that location does not actually contain the necessary library + REM files for x86. This must be done for each iteration because + REM it relies upon the WindowsSdkDir environment variable being + REM set by the batch file used to setup the MSVC environment. REM IF DEFINED SET_NSDKLIBPATH ( + REM + REM NOTE: The Windows Phone SDK has a slightly different directory + REM structure and must be handled specially here. + REM IF DEFINED WindowsPhoneKitDir ( CALL :fn_CopyVariable WindowsPhoneKitDir NSDKLIBPATH CALL :fn_AppendVariable NSDKLIBPATH \lib\x86 ) ELSE IF DEFINED WindowsSdkDir ( CALL :fn_CopyVariable WindowsSdkDir NSDKLIBPATH + REM + REM NOTE: The Windows 8.1 SDK has a slightly different directory + REM naming convention. Currently, this tool assumes that + REM the Windows 8.1 SDK should only be used with MSVC 2013. + REM IF "%VisualStudioVersion%" == "12.0" ( CALL :fn_AppendVariable NSDKLIBPATH \lib\winv6.3\um\x86 ) ELSE ( From f52a4690b05bd47bc42a7e963d8516160cc3dce5 Mon Sep 17 00:00:00 2001 From: dan Date: Thu, 31 Oct 2013 18:49:58 +0000 Subject: [PATCH 6/6] Fix a problem in os_unix.c causing compilation failure if SQLITE_DEBUG and SQLITE_MAX_MMAP_SIZE=0 are both defined. FossilOrigin-Name: 090db8c81d8ca216277d11c8c4751c0a37801524 --- manifest | 14 +++++++------- manifest.uuid | 2 +- src/os_unix.c | 2 ++ 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/manifest b/manifest index bf83d16b16..67d073cdb6 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Update\scomments\sin\sthe\sMSVC\sbatch\sbuild\stool. -D 2013-10-31T06:39:15.748 +C Fix\sa\sproblem\sin\sos_unix.c\scausing\scompilation\sfailure\sif\sSQLITE_DEBUG\sand\sSQLITE_MAX_MMAP_SIZE=0\sare\sboth\sdefined. +D 2013-10-31T18:49:58.493 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 0522b53cdc1fcfc18f3a98e0246add129136c654 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -204,7 +204,7 @@ F src/notify.c 976dd0f6171d4588e89e874fcc765e92914b6d30 F src/os.c b4ad71336fd96f97776f75587cd9e8218288f5be F src/os.h 4a46270a64e9193af4a0aaa3bc2c66dc07c29b3f F src/os_common.h 92815ed65f805560b66166e3583470ff94478f04 -F src/os_unix.c 243fb37f47dc072fc59839ea241ff0a17c8d76e6 +F src/os_unix.c 143624d9eabb3b997c59cf594e0d06c56edd43e9 F src/os_win.c b159b5249d9f70607d961bbdd1dbba789c75812c F src/pager.c 2aa4444ffe86e9282d03bc349a4a5e49bd77c0e8 F src/pager.h f094af9f6ececfaa8a1e93876905a4f34233fb0c @@ -1126,7 +1126,7 @@ F tool/vdbe-compress.tcl f12c884766bd14277f4fcedcae07078011717381 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh d1a6de74685f360ab718efda6265994b99bbea01 F tool/win/sqlite.vsix 030f3eeaf2cb811a3692ab9c14d021a75ce41fff -P 72389c295bb240ec76746e289403b82e04189903 -R 1054ff58e814a30ba005df284390b721 -U mistachkin -Z 4b58002663daf257cb37f517515be69c +P 0414bb73ef83332bec3d06471d431690356dbe13 +R 10dc38d378b39c081f52d9ea4434ffc9 +U dan +Z f097b706b4798a5e46296317a11afe2d diff --git a/manifest.uuid b/manifest.uuid index fcb87c7a76..fdc44fddfb 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -0414bb73ef83332bec3d06471d431690356dbe13 \ No newline at end of file +090db8c81d8ca216277d11c8c4751c0a37801524 \ No newline at end of file diff --git a/src/os_unix.c b/src/os_unix.c index cd8cec0046..501b1b769d 100644 --- a/src/os_unix.c +++ b/src/os_unix.c @@ -1890,7 +1890,9 @@ end_unlock: ** the requested locking level, this routine is a no-op. */ static int unixUnlock(sqlite3_file *id, int eFileLock){ +#if SQLITE_MAX_MMAP_SIZE>0 assert( eFileLock==SHARED_LOCK || ((unixFile *)id)->nFetchOut==0 ); +#endif return posixUnlock(id, eFileLock, 0); }