Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6)

Unified Diff: third_party/sqlite/src/test/sort3.test

Issue 949043002: Add //third_party/sqlite to dirs_to_snapshot, remove net_sql.patch (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/sqlite/src/test/sort2.test ('k') | third_party/sqlite/src/test/sort4.test » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/sqlite/src/test/sort3.test
diff --git a/third_party/sqlite/src/test/sort3.test b/third_party/sqlite/src/test/sort3.test
new file mode 100644
index 0000000000000000000000000000000000000000..80d8bbca3f0e0d0717d4ce03305a2ec722ac1065
--- /dev/null
+++ b/third_party/sqlite/src/test/sort3.test
@@ -0,0 +1,67 @@
+# 2014 March 25.
+#
+# 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 tests in this file verify that sorting works when the library is
+# configured to use mmap(), but the temporary files generated by the
+# sorter are too large to be completely mapped.
+#
+
+set testdir [file dirname $argv0]
+source $testdir/tester.tcl
+set testprefix sort3
+
+# Sort roughly 20MB of data. Once with a mmap limit of 5MB and once without.
+#
+foreach {itest limit} {
+ 1 5000000
+ 2 0x7FFFFFFF
+} {
+ sqlite3_test_control SQLITE_TESTCTRL_SORTER_MMAP db $limit
+ do_execsql_test 1.$itest {
+ WITH r(x,y) AS (
+ SELECT 1, randomblob(1000)
+ UNION ALL
+ SELECT x+1, randomblob(1000) FROM r
+ LIMIT 20000
+ )
+ SELECT count(*), sum(length(y)) FROM r GROUP BY (x%5);
+ } {
+ 4000 4000000
+ 4000 4000000
+ 4000 4000000
+ 4000 4000000
+ 4000 4000000
+ }
+}
+
+# Sort more than 2GB of data. At one point this was causing a problem.
+# This test might take one minute or more to run.
+#
+do_execsql_test 2 {
+ PRAGMA cache_size = 20000;
+ WITH r(x,y) AS (
+ SELECT 1, randomblob(1000)
+ UNION ALL
+ SELECT x+1, randomblob(1000) FROM r
+ LIMIT 2200000
+ )
+ SELECT count(*), sum(length(y)) FROM r GROUP BY (x%5);
+} {
+ 440000 440000000
+ 440000 440000000
+ 440000 440000000
+ 440000 440000000
+ 440000 440000000
+}
+
+finish_test
+
« no previous file with comments | « third_party/sqlite/src/test/sort2.test ('k') | third_party/sqlite/src/test/sort4.test » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698