From: drh Date: Fri, 11 Apr 2014 17:41:08 +0000 (+0000) Subject: Add the --verify option to speedtest1. Add verification test cases to X-Git-Tag: version-3.13.0~148^2~145^2~17 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=eb7c4f2aea0b1d39c9e7207012c7660155d4a30e;p=thirdparty%2Fsqlite.git Add the --verify option to speedtest1. Add verification test cases to the "rtree" testset and a case that uses a custom geometry callback. FossilOrigin-Name: 9d485c4207a81f32334857d4a608c5c511dd2b83 --- diff --git a/manifest b/manifest index 1a7e491bc3..12cad8c970 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Update\scomments\sin\sthe\sR-Tree\smodule\sin\spreparation\sfor\ssome\sbig\schanges.\nAdd\san\s"rtree"\sperformance\stest\sto\sspeedtest1. -D 2014-04-11T16:14:54.092 +C Add\sthe\s--verify\soption\sto\sspeedtest1.\s\sAdd\sverification\stest\scases\sto\nthe\s"rtree"\stestset\sand\sa\scase\sthat\suses\sa\scustom\sgeometry\scallback. +D 2014-04-11T17:41:08.614 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in e4ee6d36cdf6136aee0158675a3b24dd3bf31a5a F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -840,7 +840,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 3e06b48e8c578eaa61a01e8c7c4d8734c9dd3776 +F test/speedtest1.c 017473605f9df5f4770dd60ddb4038e6d6829916 F test/spellfix.test 61309f5efbec53603b3f86457d34a504f80abafe F test/sqllimits1.test b1aae27cc98eceb845e7f7adf918561256e31298 F test/stat.test 76fd746b85459e812a0193410fb599f0531f22de @@ -1174,10 +1174,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh d1a6de74685f360ab718efda6265994b99bbea01 F tool/win/sqlite.vsix 030f3eeaf2cb811a3692ab9c14d021a75ce41fff -P 9515c8344a6743bbb0c6a6e49fb79fb3139090df -R 57f2249bba89c44cd5839664eafe6658 -T *branch * rtree-enhancements -T *sym-rtree-enhancements * -T -sym-sessions * +P 20a73ec0b2f56609a4504052e198e32803d30207 +R 47999e8bbddb67bbaef79a4f5741e58b U drh -Z bdd5cbefa0a4dcc9a9cc6ed610b85f71 +Z 73dffdddfd99e7f86f5cf9f646a8ff0c diff --git a/manifest.uuid b/manifest.uuid index d8135897dd..0d054cdd30 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -20a73ec0b2f56609a4504052e198e32803d30207 \ No newline at end of file +9d485c4207a81f32334857d4a608c5c511dd2b83 \ No newline at end of file diff --git a/test/speedtest1.c b/test/speedtest1.c index a32f12f923..0680e9599f 100644 --- a/test/speedtest1.c +++ b/test/speedtest1.c @@ -29,6 +29,7 @@ static const char zHelp[] = " --trace Turn on SQL tracing\n" " --utf16be Set text encoding to UTF-16BE\n" " --utf16le Set text encoding to UTF-16LE\n" + " --verify Run additional verification steps.\n" " --without-rowid Use WITHOUT ROWID where appropriate\n" ; @@ -51,6 +52,7 @@ static struct Global { int bReprepare; /* True to reprepare the SQL on each rerun */ int bSqlOnly; /* True to print the SQL once only */ int bExplain; /* Print SQL with EXPLAIN prefix */ + int bVerify; /* Try to verify that results are correct */ int szTest; /* Scale factor for test iterations */ const char *zWR; /* Might be WITHOUT ROWID */ const char *zNN; /* Might be NOT NULL */ @@ -951,6 +953,26 @@ static void twoCoords( *pX1 = x1; } +/* The following routine is an R-Tree geometry callback. It returns +** true if the object overlaps a slice on the Y coordinate between the +** two values given as arguments. In other words +** +** SELECT count(*) FROM rt1 WHERE id MATCH xslice(10,20); +** +** Is the same as saying: +** +** SELECT count(*) FROM rt1 WHERE y1>=10 AND y0<=20; +*/ +static int xsliceGeometryCallback( + sqlite3_rtree_geometry *p, + int nCoord, + double *aCoord, + int *pRes +){ + *pRes = aCoord[3]>=p->aParam[0] && aCoord[2]<=p->aParam[1]; + return SQLITE_OK; +} + /* ** A testset for the R-Tree virtual table */ @@ -958,6 +980,8 @@ void testset_rtree(void){ unsigned i, n; unsigned mxCoord; unsigned x0, x1, y0, y1, z0, z1; + unsigned iStep; + int *aCheck = sqlite3_malloc( sizeof(int)*g.szTest*100 ); mxCoord = g.szTest*600; n = g.szTest*100; @@ -982,23 +1006,83 @@ void testset_rtree(void){ speedtest1_exec("COMMIT"); speedtest1_end_test(); + speedtest1_begin_test(101, "Copy from rtree to a regular table"); + speedtest1_exec("CREATE TABLE t1(id INTEGER PRIMARY KEY,x0,x1,y0,y1,z0,z1)"); + speedtest1_exec("INSERT INTO t1 SELECT * FROM rt1"); + speedtest1_end_test(); + n = g.szTest*20; speedtest1_begin_test(110, "%d one-dimensional intersect slice queries", n); speedtest1_prepare("SELECT count(*) FROM rt1 WHERE x0>=?1 AND x1<=?2"); - for(i=0; i=?1 AND x1<=?2"); + iStep = mxCoord/n; + for(i=0; i=?1 AND y0<=?2"); - for(i=0; i=?1 AND y0<=?2"); + iStep = mxCoord/n; + for(i=0; i=?1 AND x0<=?2" " AND y1>=?1 AND y0<=?2 AND z1>=?1 AND z0<=?2"); - for(i=0; i