From: drh Date: Sun, 1 Dec 2013 18:10:01 +0000 (+0000) Subject: Add some #if SQLITE_VERSION_NUMBER macros to test/speedtest1.c in order to X-Git-Tag: version-3.8.2~14 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=290ea4053a3b767ce90522386a861a098baddf09;p=thirdparty%2Fsqlite.git Add some #if SQLITE_VERSION_NUMBER macros to test/speedtest1.c in order to make it compatible with older versions of SQLite so that it can be used for historical speed comparisons. FossilOrigin-Name: a9e1627ae714156cf6bd419e41cf9b79fbbe99a9 --- diff --git a/manifest b/manifest index 7b389a5499..4bc50bd00e 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Fix\stypos\sin\sthe\sheader\scomment\son\sthe\ssqlite3Atoi64()\sroutine. -D 2013-12-01T01:18:29.458 +C Add\ssome\s#if\sSQLITE_VERSION_NUMBER\smacros\sto\stest/speedtest1.c\sin\sorder\sto\nmake\sit\scompatible\swith\solder\sversions\sof\sSQLite\sso\sthat\sit\scan\sbe\sused\sfor\nhistorical\sspeed\scomparisons. +D 2013-12-01T18:10:01.701 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in e1a9b4258bbde53f5636f4e238c65b7e11459e2b F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -820,7 +820,7 @@ F test/speed3.test d32043614c08c53eafdc80f33191d5bd9b920523 F test/speed4.test abc0ad3399dcf9703abed2fff8705e4f8e416715 F test/speed4p.explain 6b5f104ebeb34a038b2f714150f51d01143e59aa F test/speed4p.test 0e51908951677de5a969b723e03a27a1c45db38b -F test/speedtest1.c 184ded13ffe61df44d6e2ac9985b61a6417d5311 +F test/speedtest1.c aa1ff125bc9c4b8eb55db2e3cbb82ba76794dedf F test/spellfix.test 8c40b169b104086d8795781f670ba3c786d6d8be F test/sqllimits1.test b1aae27cc98eceb845e7f7adf918561256e31298 F test/stat.test c8eccfe8fcd3f3cfc864ce22d5b9e803a3c69940 @@ -1145,7 +1145,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 55ec474db8935ef36fae30da5d11f5701c60c088 -R d4e526e47db9fa86e2dd72e39606971c +P c85e0c546ea6c6be46deea5c7a716b5fb553c7b4 +R 3cfbbdfa905179d97133dd917fc5f770 U drh -Z 5cc45f2d22e4b0c01c22c0dac659e6ce +Z aec8d6f2ae39d50473657768f7788a16 diff --git a/manifest.uuid b/manifest.uuid index 2023f47b7b..e66ea9881c 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -c85e0c546ea6c6be46deea5c7a716b5fb553c7b4 \ No newline at end of file +a9e1627ae714156cf6bd419e41cf9b79fbbe99a9 \ No newline at end of file diff --git a/test/speedtest1.c b/test/speedtest1.c index ea9ec2e351..473b3d191e 100644 --- a/test/speedtest1.c +++ b/test/speedtest1.c @@ -79,6 +79,12 @@ static int hexDigitValue(char c){ return -1; } +/* Provide an alternative to sqlite3_stricmp() in older versions of +** SQLite */ +#if SQLITE_VERSION_NUMBER<3007011 +# define sqlite3_stricmp strcmp +#endif + /* ** Interpret zArg as an integer value, possibly with suffixes. */ @@ -131,7 +137,7 @@ sqlite3_int64 speedtest1_timestamp(void){ static sqlite3_vfs *clockVfs = 0; sqlite3_int64 t; if( clockVfs==0 ) clockVfs = sqlite3_vfs_find(0); - if( clockVfs->iVersion>=1 && clockVfs->xCurrentTimeInt64!=0 ){ + if( clockVfs->iVersion>=2 && clockVfs->xCurrentTimeInt64!=0 ){ clockVfs->xCurrentTimeInt64(clockVfs, &t); }else{ double r; @@ -898,6 +904,7 @@ int main(int argc, char **argv){ /* Database connection statistics printed after both prepared statements ** have been finalized */ +#if SQLITE_VERSION_NUMBER>=3007009 if( showStats ){ sqlite3_db_status(g.db, SQLITE_DBSTATUS_LOOKASIDE_USED, &iCur, &iHi, 0); printf("-- Lookaside Slots Used: %d (max %d)\n", iCur,iHi); @@ -920,6 +927,7 @@ int main(int argc, char **argv){ sqlite3_db_status(g.db, SQLITE_DBSTATUS_STMT_USED, &iCur, &iHi, 0); printf("-- Statement Heap Usage: %d bytes\n", iCur); } +#endif sqlite3_close(g.db);