From: drh Date: Mon, 5 Jan 2009 19:36:30 +0000 (+0000) Subject: Reenable fuzz testing for all.test. Make sure the query flattener copies X-Git-Tag: version-3.6.10~72 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=66cd1822fe430c3fcdf91e89d140700fad284128;p=thirdparty%2Fsqlite.git Reenable fuzz testing for all.test. Make sure the query flattener copies over aggregate information from expressions on outer query terms while flattening. (CVS 6112) FossilOrigin-Name: e02323b3629545a3e7e7db0d4edc76807ae903aa --- diff --git a/manifest b/manifest index 951efc442f..cb27c2d6cd 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Make\ssure\sthe\sMEM_Zero\sflags\sis\scleared\swhenever\sremoving\sMEM_Blob.\s(CVS\s6111) -D 2009-01-05T18:02:27 +C Reenable\sfuzz\stesting\sfor\sall.test.\s\sMake\ssure\sthe\squery\sflattener\scopies\nover\saggregate\sinformation\sfrom\sexpressions\son\souter\squery\sterms\swhile\nflattening.\s(CVS\s6112) +D 2009-01-05T19:36:30 F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0 F Makefile.in 05461a9b5803d5ad10c79f989801e9fd2cc3e592 F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654 @@ -154,7 +154,7 @@ F src/printf.c 9866a9a9c4a90f6d4147407f373df3fd5d5f9b6f F src/random.c 676b9d7ac820fe81e6fb2394ac8c10cff7f38628 F src/resolve.c 18dc9f0df1d60048e012ce6632251063e0dd356a F src/rowset.c 2256fa4a928f750e2f3d6fc733523034beceb1d6 -F src/select.c 6c2a5675c21bef11d8160f3dc97e1adfbf26bbb9 +F src/select.c 75d6404cc176a340746364ca246bcfc65ab63bb0 F src/shell.c 65d19f8996a160f288087e31810f24025439c62a F src/sqlite.h.in 6cd2489e40fe97ba58c60044a4ced377e08b6d09 F src/sqlite3ext.h 1db7d63ab5de4b3e6b83dd03d1a4e64fef6d2a17 @@ -211,7 +211,7 @@ F src/where.c b25a7ecf75cfdd7de430934f62f9e17083b9b806 F tclinstaller.tcl 4356d9d94d2b5ed5e68f9f0c80c4df3048dd7617 F test/aggerror.test a867e273ef9e3d7919f03ef4f0e8c0d2767944f2 F test/alias.test 597662c5d777a122f9a3df0047ea5c5bd383a911 -F test/all.test ca6dd2c8474d3f393c499c7da45a8e6157f33a38 +F test/all.test 57f7cc607c3afbb4596a7e9098cb099d93e86621 F test/alter.test 6353aae6839e486c9b7d8f73b1f4a1e98e57332c F test/alter2.test dd55146e812622c8fc51fd2216bcd8dca8880752 F test/alter3.test 25b95a136708f22b87184fa6a4309eea03d65153 @@ -372,10 +372,10 @@ F test/fts3expr.test 000f05df771e203187ceac49ad21c303c720b783 F test/fts3expr2.test 8501de895a4c0631e7226c9bac055cd49c9f6646 F test/fts3near.test dc196dd17b4606f440c580d45b3d23aa975fd077 F test/func.test a50f0a4b69ac251debe1dce3ba29da7476dc8c52 -F test/fuzz.test 62fc19dd36a427777fd671b569df07166548628a +F test/fuzz.test 2b61d118b522ac13b6fec307352ec31edd060da2 F test/fuzz2.test ea38692ce2da99ad79fe0be5eb1a452c1c4d37bb F test/fuzz3.test aec64345184d1662bd30e6a17851ff659d596dc5 -F test/fuzz_common.tcl ff4bc2dfc465f6878f8e2d819620914365382731 +F test/fuzz_common.tcl a87dfbb88c2a6b08a38e9a070dabd129e617b45b F test/fuzz_malloc.test 4eca9d345f06d5b0b0105f7a2ef9e7f22658827b F test/hook.test a9961ccfcf7271cd7fc72352de77aff822359e66 F test/icu.test f51d0f4407ff8bb1e872f51a0e8b08fdc5a6897e @@ -692,7 +692,7 @@ F tool/speedtest16.c c8a9c793df96db7e4933f0852abb7a03d48f2e81 F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224 F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e -P 77dc19cfabca54353509ff346b12975044d416d5 -R 2a41e3988f61c793d4dad4e5b4435e22 +P b2131e868a3a948ba81f7458270493085da1ae60 +R 1fa18bdeafa91fbbe120bff65ee7745c U drh -Z 89b2b05de23be25cd3f5c45e5c034efb +Z 20ff9d208929f79b9a7e14a4a2f0a57a diff --git a/manifest.uuid b/manifest.uuid index cc91bd5477..4855773cb3 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -b2131e868a3a948ba81f7458270493085da1ae60 \ No newline at end of file +e02323b3629545a3e7e7db0d4edc76807ae903aa \ No newline at end of file diff --git a/src/select.c b/src/select.c index e83dda11d6..ccecdf973b 100644 --- a/src/select.c +++ b/src/select.c @@ -12,7 +12,7 @@ ** This file contains C code routines that are called by the parser ** to handle SELECT statements in SQLite. ** -** $Id: select.c,v 1.495 2008/12/23 23:56:22 drh Exp $ +** $Id: select.c,v 1.496 2009/01/05 19:36:30 drh Exp $ */ #include "sqliteInt.h" @@ -2406,6 +2406,8 @@ static void substExpr( sqlite3TokenCopy(db, &pExpr->span, &pNew->span); pExpr->pSelect = sqlite3SelectDup(db, pNew->pSelect); pExpr->flags = pNew->flags; + pExpr->pAggInfo = pNew->pAggInfo; + pNew->pAggInfo = 0; } }else{ substExpr(db, pExpr->pLeft, iTable, pEList); diff --git a/test/all.test b/test/all.test index 2d3de3a152..183ef66ea5 100644 --- a/test/all.test +++ b/test/all.test @@ -10,7 +10,7 @@ #*********************************************************************** # This file runs all tests. # -# $Id: all.test,v 1.60 2009/01/05 17:19:03 drh Exp $ +# $Id: all.test,v 1.61 2009/01/05 19:36:30 drh Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl @@ -64,7 +64,6 @@ lappend EXCLUDE malloc.test ;# Run seperately later. lappend EXCLUDE misuse.test ;# Run seperately later. lappend EXCLUDE memleak.test ;# Alternate test driver script lappend EXCLUDE permutations.test ;# Run seperately later. -lappend EXCLUDE fuzz.test lappend EXCLUDE soak.test ;# Takes a very long time (default 1 hr) lappend EXCLUDE fts3.test ;# Wrapper for muliple fts3*.tests lappend EXCLUDE mallocAll.test ;# Wrapper for running all malloc tests diff --git a/test/fuzz.test b/test/fuzz.test index 76e3aad90d..5f06cd095a 100644 --- a/test/fuzz.test +++ b/test/fuzz.test @@ -19,7 +19,7 @@ # # The most complicated trees are for SELECT statements. # -# $Id: fuzz.test,v 1.14 2007/05/30 10:36:47 danielk1977 Exp $ +# $Id: fuzz.test,v 1.15 2009/01/05 19:36:30 drh Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl @@ -32,6 +32,7 @@ if {[info exists ::ISQUICK]} { } source $testdir/fuzz_common.tcl +expr srand(0) #---------------------------------------------------------------- # These tests caused errors that were first caught by the tests @@ -173,6 +174,80 @@ do_test fuzz-1.14.2 { } } {} +# Making sure previously discovered errors have been fixed. +# +do_test fuzz-1.15 { + execsql { + SELECT hex(CAST(zeroblob(1000) AS integer)) + } +} {30} + +do_test fuzz-1.16.1 { + execsql { + CREATE TABLE abc(a, b, c); + CREATE TABLE def(a, b, c); + CREATE TABLE ghi(a, b, c); + } +} {} +do_test fuzz-1.16.2 { +breakpoint + catchsql { + SELECT DISTINCT EXISTS( + SELECT 1 + FROM ( + SELECT C FROM (SELECT 1) + ) + WHERE (SELECT c) + ) + FROM abc + } +} {0 {}} +do_test fuzz-1.16.3 { + catchsql { + SELECT DISTINCT substr(-456 ISNULL,zeroblob(1000), EXISTS( + SELECT DISTINCT EXISTS( + SELECT DISTINCT b FROM abc + ORDER BY EXISTS ( + SELECT DISTINCT 2147483647 UNION ALL SELECT -2147483648 + ) ASC + ) + FROM ( + SELECT c, c FROM ( + SELECT 456, 'injection' ORDER BY 56.1 ASC, -56.1 DESC + ) + ) + GROUP BY (SELECT ALL (SELECT DISTINCT 'hardware')) + HAVING ( + SELECT DISTINCT c + FROM ( + SELECT ALL -2147483648, 'experiments' + ORDER BY -56.1 ASC, -56.1 DESC + ) + GROUP BY (SELECT DISTINCT 456) IN + (SELECT DISTINCT 'injection') NOT IN (SELECT ALL -456) + HAVING EXISTS ( + SELECT ALL 'injection' + ) + ) + UNION ALL + SELECT a IN ( + SELECT -2147483647 + UNION ALL + SELECT ALL 'injection' + ) + FROM sqlite_master + ) -- end EXISTS + ) /* end SUBSTR() */, c NOTNULL ISNULL + FROM abc + ORDER BY CAST(-56.1 AS blob) ASC + } +} {0 {}} +do_test fuzz-1.16.4 { + execsql { + DROP TABLE abc; DROP TABLE def; DROP TABLE ghi; + } +} {} + #---------------------------------------------------------------- # Test some fuzzily generated expressions. # diff --git a/test/fuzz_common.tcl b/test/fuzz_common.tcl index b552129acb..4ab7dff5c9 100644 --- a/test/fuzz_common.tcl +++ b/test/fuzz_common.tcl @@ -9,7 +9,7 @@ # #*********************************************************************** # -# $Id: fuzz_common.tcl,v 1.1 2007/05/30 10:36:47 danielk1977 Exp $ +# $Id: fuzz_common.tcl,v 1.2 2009/01/05 19:36:30 drh Exp $ proc fuzz {TemplateList} { set n [llength $TemplateList] @@ -374,7 +374,7 @@ proc do_fuzzy_test {testname args} { if {$rc} { set e 0 foreach error $::fuzzyopts(-errorlist) { - if {0 == [string first $error $msg]} { + if {[string first $error $msg]>=0} { set e 1 break } @@ -389,4 +389,3 @@ proc do_fuzzy_test {testname args} { } {1} } } -