From: danielk1977 Date: Tue, 24 Feb 2009 10:48:27 +0000 (+0000) Subject: Add test file test/count.test for testing "SELECT count(*)" statements. It is not... X-Git-Tag: version-3.6.15~432 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4d9c1dd262e46a340a8eba3070c0f4b385d921dc;p=thirdparty%2Fsqlite.git Add test file test/count.test for testing "SELECT count(*)" statements. It is not properly populated yet. (CVS 6318) FossilOrigin-Name: a195d74ff9ce836447dba4da7edcc6f1cdae5574 --- diff --git a/manifest b/manifest index e7ff4bcc4b..b1238d9919 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Reverse\scommit\s(6315)\sfor\snow.\s(CVS\s6317) -D 2009-02-24T10:14:40 +C Add\stest\sfile\stest/count.test\sfor\stesting\s"SELECT\scount(*)"\sstatements.\sIt\sis\snot\sproperly\spopulated\syet.\s(CVS\s6318) +D 2009-02-24T10:48:28 F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0 F Makefile.in d64baddbf55cdf33ff030e14da837324711a4ef7 F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654 @@ -286,6 +286,7 @@ F test/corrupt9.test 794d284109c65c8f10a2b275479045e02d163bae F test/corruptA.test 99e95620b980161cb3e79f06a884a4bb8ae265ff F test/corruptB.test 505331779fe7a96fe38ecbb817f19c63bc27d171 F test/corruptC.test c798aa395a8d052fba88bd1be8e1945309e3f94a +F test/count.test 51c69ee6b3394dfba27dbc1e30f25fb41d66200d F test/crash.test 1b6ac8410689ff78028887f445062dc897c9ac89 F test/crash2.test 5b14d4eb58b880e231361d3b609b216acda86651 F test/crash3.test 776f9363554c029fcce71d9e6600fa0ba6359ce7 @@ -701,7 +702,7 @@ F tool/speedtest16.c c8a9c793df96db7e4933f0852abb7a03d48f2e81 F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224 F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e -P d4aa6593183224b6868a322511511c0bbf63b598 -R b3564712467a40fda442fb8ac57c5565 +P 0e7c369c23a8767b4d3e5cdd47c14716992fb71a +R 71f287412eb030dfd9b14d26e52b17fb U danielk1977 -Z 82d1200daf27b985fd03c599faf3c6c4 +Z e2d5b34166a5d213f9445c572c8e416e diff --git a/manifest.uuid b/manifest.uuid index b68d63ebb0..b237de885f 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -0e7c369c23a8767b4d3e5cdd47c14716992fb71a \ No newline at end of file +a195d74ff9ce836447dba4da7edcc6f1cdae5574 \ No newline at end of file diff --git a/test/count.test b/test/count.test new file mode 100644 index 0000000000..cf947f23e7 --- /dev/null +++ b/test/count.test @@ -0,0 +1,76 @@ +# 2009 February 24 +# +# 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 +# focus of this file is testing "SELECT count(*)" statements. +# +# $Id: count.test,v 1.1 2009/02/24 10:48:28 danielk1977 Exp $ + +set testdir [file dirname $argv0] +source $testdir/tester.tcl + +set iTest 0 +foreach zIndex [list { + /* no-op */ +} { + CREATE INDEX i1 ON t1(a); +}] { + incr iTest + do_test count-1.$iTest.1 { + execsql { + DROP TABLE IF EXISTS t1; + CREATE TABLE t1(a, b); + } + execsql $zIndex + execsql { + INSERT INTO t1 VALUES(1, 2); + INSERT INTO t1 VALUES(3, 4); + SELECT count(*) FROM t1; + } + } {2} + + do_test count-1.$iTest.2 { + execsql { + INSERT INTO t1 SELECT * FROM t1; -- 4 + INSERT INTO t1 SELECT * FROM t1; -- 8 + INSERT INTO t1 SELECT * FROM t1; -- 16 + INSERT INTO t1 SELECT * FROM t1; -- 32 + INSERT INTO t1 SELECT * FROM t1; -- 64 + INSERT INTO t1 SELECT * FROM t1; -- 128 + INSERT INTO t1 SELECT * FROM t1; -- 256 + SELECT count(*) FROM t1; + } + } {256} + + do_test count-1.$iTest.3 { + execsql { + INSERT INTO t1 SELECT * FROM t1; -- 512 + INSERT INTO t1 SELECT * FROM t1; -- 1024 + INSERT INTO t1 SELECT * FROM t1; -- 2048 + INSERT INTO t1 SELECT * FROM t1; -- 4096 + SELECT count(*) FROM t1; + } + } {4096} + + do_test count-1.$iTest.4 { + execsql { + BEGIN; + INSERT INTO t1 SELECT * FROM t1; -- 8192 + INSERT INTO t1 SELECT * FROM t1; -- 16384 + INSERT INTO t1 SELECT * FROM t1; -- 32768 + INSERT INTO t1 SELECT * FROM t1; -- 65536 + COMMIT; + SELECT count(*) FROM t1; + } + } {65536} +} + +finish_test +