Update test file walprotocol.test to account for the changes in the wal
[sqlite.git] / test / selectG.test
blob86d89b121b658a00d59fca0a45aa9503a2bc599a
1 # 2015-01-05
3 # The author disclaims copyright to this source code.  In place of
4 # a legal notice, here is a blessing:
6 #    May you do good and not evil.
7 #    May you find forgiveness for yourself and forgive others.
8 #    May you share freely, never taking more than you give.
10 #***********************************************************************
12 # This file verifies that INSERT operations with a very large number of
13 # VALUE terms works and does not hit the SQLITE_LIMIT_COMPOUND_SELECT limit.
16 set testdir [file dirname $argv0]
17 source $testdir/tester.tcl
18 set testprefix selectG
20 # Do an INSERT with a VALUES clause that contains 100,000 entries.  Verify
21 # that this insert happens quickly (in less than 10 seconds).  Actually, the
22 # insert will normally happen in less than 0.5 seconds on a workstation, but
23 # we allow plenty of overhead for slower machines.  The speed test checks
24 # for an O(N*N) inefficiency that was once in the code and that would make
25 # the insert run for over a minute.
27 do_test 100 {
28   set sql "CREATE TABLE t1(x);\nINSERT INTO t1(x) VALUES"
29   for {set i 1} {$i<100000} {incr i} {
30     append sql "($i),"
31   }
32   append sql "($i);"
33   set microsec [lindex [time {db eval $sql}] 0]
34   db eval {
35     SELECT count(x), sum(x), avg(x), $microsec<10000000 FROM t1;
36   }
37 } {100000 5000050000 50000.5 1}
38   
39 finish_test