-C Fix\sa\sC++ism\sin\sfunc.c.\s(CVS\s3970)
-D 2007-05-10T13:23:23
+C Add\snew\stest\sfile\sfuzz.test,\sto\stest\sSQLite\swith\sfuzzily\sgenerated\sSQL.\s(CVS\s3971)
+D 2007-05-10T15:37:53
F Makefile.in 87b200ad9970907f76df734d29dff3d294c10935
F Makefile.linux-gcc 2d8574d1ba75f129aba2019f0b959db380a90935
F README 9c4e2d6706bdcc3efdd773ce752a8cdab4f90028
F src/vdbeaux.c 62011e2ccf5fa9b3dcc7fa6ff5f0e0638d324a70
F src/vdbeblob.c 96f3572fdc45eda5be06e6372b612bc30742d9f0
F src/vdbefifo.c 3ca8049c561d5d67cbcb94dc909ae9bb68c0bf8f
-F src/vdbemem.c f9ef7a16993130e610dd994a1a76b1e831857e27
+F src/vdbemem.c 2d59bc2b6356cf3721077f75da92fedee458c4e1
F src/vtab.c c5ebebf615b2f29499fbe97a584c4bb342632aa0
F src/where.c f3920748cc650fc25ac916215500bdb90dee568e
F tclinstaller.tcl 4356d9d94d2b5ed5e68f9f0c80c4df3048dd7617
F test/fts2m.test 4b30142ead6f3ed076e880a2a464064c5ad58c51
F test/fts2n.test a70357e72742681eaebfdbe9007b87ff3b771638
F test/func.test 6f230b25b235cc1afcc7bd5a41baf7317018a8d1
+F test/fuzz.test 71f1a03e8249f14f15b39562525e5450a1713fd5
F test/hook.test 7e7645fd9a033f79cce8fdff151e32715e7ec50a
F test/icu.test e6bfae7f625c88fd14df6f540fe835bdfc1e4329
F test/in.test 369cb2aa1eab02296b4ec470732fe8c131260b1d
F test/printf.test 71047b5fe8e2adfbe514e0d56e10adf12d84deff
F test/progress.test 8b22b4974b0a95272566385f8cb8c341c7130df8 x
F test/ptrchng.test 1c712dd6516e1377471744fa765e41c79a357da6
-F test/quick.test 616e8906598101acd1ebc9acbdabdbc1102d9ab1
+F test/quick.test 9f5bb4e95460472dc379f5dd8932c743407501ef
F test/quote.test 215897dbe8de1a6f701265836d6601cc6ed103e6
F test/rdonly.test b34db316525440d3b42c32e83942c02c37d28ef0
F test/reindex.test 38b138abe36bf9a08c791ed44d9f76cd6b97b78b
F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0
F www/version3.tcl 890248cf7b70e60c383b0e84d77d5132b3ead42b
F www/whentouse.tcl fc46eae081251c3c181bd79c5faef8195d7991a5
-P 5800d0327ebc122e679ef860b58098b3c08eb709
-R 96efbe11ded0fcf2087a2e2cc7c73f86
-U drh
-Z dd77a8dbef149aca71589b484f8de078
+P 9c0050a10c6bea75ada902c16eb28eb3cf864718
+R 862728ba028801203dde1e64535d126a
+U danielk1977
+Z 6effd6cb91351315b8bd943713c44c7f
-9c0050a10c6bea75ada902c16eb28eb3cf864718
\ No newline at end of file
+1e9e6fe75d01d8cf4e1a23505c45f28491f1e902
\ No newline at end of file
pMem->z = pNew;
pMem->n += pMem->u.i;
pMem->u.i = 0;
- pMem->flags &= MEM_Zero|MEM_Static|MEM_Ephem|MEM_Short;
- pMem->flags |= MEM_Term|MEM_Dyn;
+ pMem->flags &= ~(MEM_Zero|MEM_Static|MEM_Ephem|MEM_Short);
+ pMem->flags |= (MEM_Term|MEM_Dyn);
}
return SQLITE_OK;
}
int fg = pMem->flags;
char *z = pMem->zShort;
+ assert( !(fg&MEM_Zero) );
assert( !(fg&(MEM_Str|MEM_Blob)) );
assert( fg&(MEM_Int|MEM_Real) );
pMem->n = 0;
pMem->u.i = n;
pMem->z = pMem->zShort;
+ pMem->enc = SQLITE_UTF8;
}
/*
--- /dev/null
+
+# 2001 September 15
+#
+# 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. The
+# focus of this file is testing the SELECT statement.
+#
+# $Id: fuzz.test,v 1.1 2007/05/10 15:37:53 danielk1977 Exp $
+
+set testdir [file dirname $argv0]
+source $testdir/tester.tcl
+
+proc fuzz {TemplateList} {
+ set n [llength $TemplateList]
+ set i [expr {int(rand()*$n)}]
+ return [subst -novar [lindex $TemplateList $i]]
+}
+
+proc Value {} {
+ set TemplateList {
+ 456 0 -456 1 -1
+ 2147483648 2147483647 2147483649 -2147483647 -2147483648 -2147483649
+ 'The' 'first' 'experiments' 'in' 'hardware' 'fault' 'injection'
+ zeroblob(1000)
+ NULL
+ 56.1 -56.1
+ 123456789.1234567899
+ }
+ fuzz $TemplateList
+}
+
+proc UnaryOp {} {
+ set TemplateList {+ - NOT}
+ fuzz $TemplateList
+}
+
+proc BinaryOp {} {
+ set TemplateList {+ - % * / AND OR LIKE GLOB}
+ fuzz $TemplateList
+}
+
+set ::ExprDepth 0
+proc Expr {} {
+ incr ::ExprDepth
+
+ set TemplateList {[Value]}
+ if {$::ExprDepth < 100} {
+ lappend TemplateList \
+ {[Expr] [BinaryOp] [Expr]} \
+ {[UnaryOp] [Expr]} \
+ {([Select])} \
+ {[Value]}
+ }
+ if {$::SelectDepth < 10} {
+ lappend TemplateList {([Select])}
+ }
+ set res [fuzz $TemplateList]
+ incr ::ExprDepth -1
+ return $res
+}
+
+set ::SelectDepth 0
+proc Select {} {
+ incr ::SelectDepth
+ set TemplateList {
+ {SELECT [Expr]}
+ }
+ set res [fuzz $TemplateList]
+ incr ::SelectDepth -1
+ set res
+}
+
+do_test fuzz-1.1 {
+ execsql {
+ SELECT 'abc' LIKE X'ABCD';
+ }
+} {0}
+do_test fuzz-1.2 {
+ execsql {
+ SELECT 'abc' LIKE zeroblob(10);
+ }
+} {0}
+do_test fuzz-1.3 {
+ execsql {
+ SELECT zeroblob(10) LIKE 'abc';
+ }
+} {0}
+do_test fuzz-1.4 {
+ execsql {
+ SELECT (- -21) % NOT (456 LIKE zeroblob(10));
+ }
+} {0}
+
+do_test fuzz-2.1 {
+ for {set ii 0} {$ii < 2000} {incr ii} {
+ set ::expr [Expr]
+ execsql "SELECT $::expr"
+ }
+ set a ""
+} {}
+
+finish_test
+
#***********************************************************************
# This file runs all tests.
#
-# $Id: quick.test,v 1.54 2007/05/08 15:59:06 danielk1977 Exp $
+# $Id: quick.test,v 1.55 2007/05/10 15:37:53 danielk1977 Exp $
proc lshift {lvar} {
upvar $lvar l
crash.test
crash2.test
exclusive3.test
+ fuzz.test
loadext.test
malloc.test
malloc2.test