mirror of
https://github.com/sqlite/sqlite.git
synced 2025-07-29 08:01:23 +03:00
Minor changes and coverge tests for "SELECT count(*)" optimization. (CVS 6324)
FossilOrigin-Name: a3695b98f63fb776c3b7f77f0553e8a38bcc6f78
This commit is contained in:
@ -11,7 +11,7 @@
|
||||
# This file implements regression tests for SQLite library. The
|
||||
# focus of this file is testing "SELECT count(*)" statements.
|
||||
#
|
||||
# $Id: count.test,v 1.2 2009/02/24 18:33:15 danielk1977 Exp $
|
||||
# $Id: count.test,v 1.3 2009/02/25 08:56:47 danielk1977 Exp $
|
||||
|
||||
set testdir [file dirname $argv0]
|
||||
source $testdir/tester.tcl
|
||||
@ -138,6 +138,14 @@ do_test count-2.13 {
|
||||
uses_op_count {SELECT count(*) FROM t1, t2}
|
||||
} {0}
|
||||
|
||||
ifcapable vtab {
|
||||
register_echo_module [sqlite3_connection_pointer db]
|
||||
do_test count-2.14 {
|
||||
execsql { CREATE VIRTUAL TABLE techo USING echo(t1); }
|
||||
uses_op_count {SELECT count(*) FROM techo}
|
||||
} {0}
|
||||
}
|
||||
|
||||
do_test count-3.1 {
|
||||
execsql {
|
||||
CREATE TABLE t3(a, b);
|
||||
@ -150,5 +158,28 @@ do_test count-3.2 {
|
||||
}
|
||||
} {}
|
||||
|
||||
do_test count-4.1 {
|
||||
execsql {
|
||||
CREATE TABLE t4(a, b);
|
||||
INSERT INTO t4 VALUES('a', 'b');
|
||||
CREATE INDEX t4i1 ON t4(b, a);
|
||||
SELECT count(*) FROM t4;
|
||||
}
|
||||
} {1}
|
||||
do_test count-4.2 {
|
||||
execsql {
|
||||
CREATE INDEX t4i2 ON t4(b);
|
||||
SELECT count(*) FROM t4;
|
||||
}
|
||||
} {1}
|
||||
do_test count-4.3 {
|
||||
execsql {
|
||||
DROP INDEX t4i1;
|
||||
CREATE INDEX t4i1 ON t4(b, a);
|
||||
SELECT count(*) FROM t4;
|
||||
}
|
||||
} {1}
|
||||
|
||||
|
||||
finish_test
|
||||
|
||||
|
Reference in New Issue
Block a user