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

Unified Diff: third_party/sqlite/sqlite-src-3100200/test/selectG.test

Issue 1610543003: [sql] Import reference version of SQLite 3.10.2. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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
Index: third_party/sqlite/sqlite-src-3100200/test/selectG.test
diff --git a/third_party/sqlite/sqlite-src-3100200/test/selectG.test b/third_party/sqlite/sqlite-src-3100200/test/selectG.test
new file mode 100644
index 0000000000000000000000000000000000000000..86d89b121b658a00d59fca0a45aa9503a2bc599a
--- /dev/null
+++ b/third_party/sqlite/sqlite-src-3100200/test/selectG.test
@@ -0,0 +1,39 @@
+# 2015-01-05
+#
+# 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 verifies that INSERT operations with a very large number of
+# VALUE terms works and does not hit the SQLITE_LIMIT_COMPOUND_SELECT limit.
+#
+
+set testdir [file dirname $argv0]
+source $testdir/tester.tcl
+set testprefix selectG
+
+# Do an INSERT with a VALUES clause that contains 100,000 entries. Verify
+# that this insert happens quickly (in less than 10 seconds). Actually, the
+# insert will normally happen in less than 0.5 seconds on a workstation, but
+# we allow plenty of overhead for slower machines. The speed test checks
+# for an O(N*N) inefficiency that was once in the code and that would make
+# the insert run for over a minute.
+#
+do_test 100 {
+ set sql "CREATE TABLE t1(x);\nINSERT INTO t1(x) VALUES"
+ for {set i 1} {$i<100000} {incr i} {
+ append sql "($i),"
+ }
+ append sql "($i);"
+ set microsec [lindex [time {db eval $sql}] 0]
+ db eval {
+ SELECT count(x), sum(x), avg(x), $microsec<10000000 FROM t1;
+ }
+} {100000 5000050000 50000.5 1}
+
+finish_test
« no previous file with comments | « third_party/sqlite/sqlite-src-3100200/test/selectF.test ('k') | third_party/sqlite/sqlite-src-3100200/test/server1.test » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698