]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Add new test file sqllimits1.test. (CVS 3952)
authordanielk1977 <danielk1977@noemail.net>
Tue, 8 May 2007 15:59:05 +0000 (15:59 +0000)
committerdanielk1977 <danielk1977@noemail.net>
Tue, 8 May 2007 15:59:05 +0000 (15:59 +0000)
FossilOrigin-Name: c8974603976ebc02edbc9ab271e87e57f8eb365e

manifest
manifest.uuid
test/all.test
test/quick.test
test/sqllimits1.test [new file with mode: 0644]

index 2b98eef1e9aa73f254c1f053bf3aac5fba1a1e2a..18439c6c6621eb5e743f5cf1bae8017fa35113e9 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Do\snot\sallocate\sso\smuch\ssurplus\smemory\sin\sthe\simplementation\sof\sthe\nreplace()\sfunction.\s(CVS\s3951)
-D 2007-05-08T15:46:18
+C Add\snew\stest\sfile\ssqllimits1.test.\s(CVS\s3952)
+D 2007-05-08T15:59:06
 F Makefile.in 87b200ad9970907f76df734d29dff3d294c10935
 F Makefile.linux-gcc 2d8574d1ba75f129aba2019f0b959db380a90935
 F README 9c4e2d6706bdcc3efdd773ce752a8cdab4f90028
@@ -144,7 +144,7 @@ F src/vtab.c c5ebebf615b2f29499fbe97a584c4bb342632aa0
 F src/where.c f3920748cc650fc25ac916215500bdb90dee568e
 F tclinstaller.tcl 4356d9d94d2b5ed5e68f9f0c80c4df3048dd7617
 F test/aggerror.test a867e273ef9e3d7919f03ef4f0e8c0d2767944f2
-F test/all.test a8dca528354b70a52f130e1bb33dedc6848862a1
+F test/all.test 1f54c95fea0baa503d5f4788d9d33ef4dd635c86
 F test/alter.test 088d82f140b7fcf0be2f712c826dd70387470aef
 F test/alter2.test 50c3f554b8236d179d72511c0a4f23c5eb7f2af3
 F test/alter3.test a6eec8f454be9b6ce73d8d7dc711453675a10ce7
@@ -316,7 +316,7 @@ F test/pragma.test fecb7085f58d9fb5172a5c0b63fd3b25c7bfb414
 F test/printf.test 71047b5fe8e2adfbe514e0d56e10adf12d84deff
 F test/progress.test 8b22b4974b0a95272566385f8cb8c341c7130df8 x
 F test/ptrchng.test 1c712dd6516e1377471744fa765e41c79a357da6
-F test/quick.test afa4339d08800d8aa3625df6cc2f059cc505f4c3
+F test/quick.test 616e8906598101acd1ebc9acbdabdbc1102d9ab1
 F test/quote.test 215897dbe8de1a6f701265836d6601cc6ed103e6
 F test/rdonly.test b34db316525440d3b42c32e83942c02c37d28ef0
 F test/reindex.test 38b138abe36bf9a08c791ed44d9f76cd6b97b78b
@@ -340,6 +340,7 @@ F test/shared_err.test cc528f6e78665787e93d9ce3a782a2ce5179d821
 F test/sort.test 0e4456e729e5a92a625907c63dcdedfbe72c5dc5
 F test/speed1.test 22e1b27af0683ed44dcd2f93ed817a9c3e65084a
 F test/speed2.test 53177056baf6556dcbdcf032bbdfc41c1aa74ded
+F test/sqllimits1.test 180c2bc1a13ae67adca747c333eba3211409abf3
 F test/subquery.test ae324ee928c5fb463a3ce08a8860d6e7f1ca5797
 F test/subselect.test 974e87f8fc91c5f00dd565316d396a5a6c3106c4
 F test/sync.test d05397b8f89f423dd6dba528692019ab036bc1c3
@@ -485,7 +486,7 @@ F www/tclsqlite.tcl bb0d1357328a42b1993d78573e587c6dcbc964b9
 F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0
 F www/version3.tcl 890248cf7b70e60c383b0e84d77d5132b3ead42b
 F www/whentouse.tcl fc46eae081251c3c181bd79c5faef8195d7991a5
-P 42e6c826998e69462462b0787d3650246d36f3b5
-R 1e9068e3e524fdba724ca45c93150d52
-U drh
-Z 4f1deed1abb3d0cd324c190974c006a2
+P 0cf518ceebda8e7421d054813f97cc447d292344
+R ddfeace665d99b6082fb9407968ef94f
+U danielk1977
+Z f31fe2890398ab75828f21106fdbea89
index 41c2689c943dc320a56a2876b7183996a4f3d7ff..403273df89ebb323b5215f32b4dcc80c44e80d55 100644 (file)
@@ -1 +1 @@
-0cf518ceebda8e7421d054813f97cc447d292344
\ No newline at end of file
+c8974603976ebc02edbc9ab271e87e57f8eb365e
\ No newline at end of file
index 9cff8c63e5295f042bc264ed152f48a4a7bc388b..3b30875c9467957348afbd07ffbb82acdc60fc90 100644 (file)
@@ -10,7 +10,7 @@
 #***********************************************************************
 # This file runs all tests.
 #
-# $Id: all.test,v 1.40 2007/04/16 17:07:55 drh Exp $
+# $Id: all.test,v 1.41 2007/05/08 15:59:06 danielk1977 Exp $
 
 set testdir [file dirname $argv0]
 source $testdir/tester.tcl
@@ -59,6 +59,7 @@ set EXCLUDE {
   malloc.test
   misuse.test
   memleak.test
+  sqllimits1.test
 }
 
 # Files to include in the test.  If this list is empty then everything
index 44b9c6f9a8bdf2f4b1e64696ecf559d1164ac371..da70c724d1e66febd6ffcde25dd131f09c4588c1 100644 (file)
@@ -6,7 +6,7 @@
 #***********************************************************************
 # This file runs all tests.
 #
-# $Id: quick.test,v 1.53 2007/04/28 15:47:45 danielk1977 Exp $
+# $Id: quick.test,v 1.54 2007/05/08 15:59:06 danielk1977 Exp $
 
 proc lshift {lvar} {
   upvar $lvar l
@@ -55,6 +55,7 @@ set EXCLUDE {
   quick.test
   speed1.test
   speed2.test
+  sqllimits1.test
 
   incrvacuum_ioerr.test
   autovacuum_crash.test
diff --git a/test/sqllimits1.test b/test/sqllimits1.test
new file mode 100644 (file)
index 0000000..0369ebc
--- /dev/null
@@ -0,0 +1,57 @@
+# 2007 May 8
+#
+# 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 contains tests to verify that the limits defined in
+# sqlite source file limits.h are enforced.
+#
+# $Id: sqllimits1.test,v 1.1 2007/05/08 15:59:06 danielk1977 Exp $
+
+set testdir [file dirname $argv0]
+source $testdir/tester.tcl
+
+#--------------------------------------------------------------------
+# Test cases sqllimits-1.* test that the SQLITE_MAX_LENGTH limit
+# is enforced.
+#
+do_test sqllimits-1.1 {
+  catchsql { SELECT randomblob(2147483647) }
+} {1 {string or blob too big}}
+
+# Large, but allowable, blob-size.
+#
+set ::LARGESIZE [expr $SQLITE_MAX_LENGTH - 1] 
+
+do_test sqllimits-1.2 {
+  catchsql { SELECT LENGTH(randomblob($::LARGESIZE)) }
+} "0 $::LARGESIZE"
+
+do_test sqllimits-1.3 {
+  catchsql { SELECT quote(randomblob($::LARGESIZE)) }
+} {1 {string or blob too big}}
+
+do_test sqllimits-1.4 {
+  set ::str [string repeat A 65537]
+  set ::rep [string repeat B 65537]
+  catchsql { SELECT replace($::str, 'A', $::rep) }
+} {1 {string or blob too big}}
+
+#--------------------------------------------------------------------
+# Test cases sqllimits-1.* test that the SQLITE_MAX_SQL limit
+# is enforced.
+#
+do_test sqllimits-2.1 {
+  set    sql "SELECT 1 WHERE 1==1"
+  append sql [string repeat " AND 1==1" 200000]
+  catchsql $sql
+} {1 {String or BLOB exceeded size limit}}
+
+finish_test
+