aboutsummaryrefslogtreecommitdiff
path: root/testdata/tcl/bigsort.test
diff options
context:
space:
mode:
authorJan Mercl <0xjnml@gmail.com>2020-07-26 22:36:18 +0200
committerJan Mercl <0xjnml@gmail.com>2020-07-26 22:36:18 +0200
commitb406626c64313ae348996c243a0a05d3f6ed2c3c (patch)
tree0eaae4fa6348b150568725e6f2ec0b4c4203b5f8 /testdata/tcl/bigsort.test
parentd8d9f40ce80062793349c0ea47520b6878312f4a (diff)
release v1.4.0-beta1v1.4.0-beta1
Diffstat (limited to 'testdata/tcl/bigsort.test')
-rw-r--r--testdata/tcl/bigsort.test50
1 files changed, 50 insertions, 0 deletions
diff --git a/testdata/tcl/bigsort.test b/testdata/tcl/bigsort.test
new file mode 100644
index 0000000..c711515
--- /dev/null
+++ b/testdata/tcl/bigsort.test
@@ -0,0 +1,50 @@
+# 2014 November 26
+#
+# 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.
+#
+#***********************************************************************
+#
+
+set testdir [file dirname $argv0]
+source $testdir/tester.tcl
+set testprefix bigsort
+
+#--------------------------------------------------------------------
+# At one point there was an overflow problem if the product of the
+# cache-size and page-size was larger than 2^31. Causing an infinite
+# loop if the product was also an integer multiple of 2^32, or
+# inefficiency otherwise.
+#
+# This test causes thrashing on machines with smaller amounts of
+# memory. Make sure the host has at least 8GB available before running
+# this test.
+#
+if {[catch {exec free | grep Mem:} out] || [lindex $out 1]<8000000} {
+ finish_test
+ return
+}
+
+do_execsql_test 1.0 {
+ PRAGMA page_size = 1024;
+ CREATE TABLE t1(a, b);
+ BEGIN;
+ WITH data(x,y) AS (
+ SELECT 1, zeroblob(10000)
+ UNION ALL
+ SELECT x+1, y FROM data WHERE x < 300000
+ )
+ INSERT INTO t1 SELECT * FROM data;
+ COMMIT;
+}
+do_execsql_test 1.1 {
+ PRAGMA cache_size = 4194304;
+ CREATE INDEX i1 ON t1(a, b);
+}
+
+
+finish_test