Have "PRAGMA quick_check" compare the number of entries in tables and indexes.
[sqlite.git] / test / vtabdistinct.test
blobe18e121e50e6292d25fc36cb3d0b3c68fcf516d8
1 # 2022-01-21
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 #***********************************************************************
11
12 # This file implements tests for sqlite3_vtab_distinct() interface.
15 set testdir [file dirname $argv0]
16 source $testdir/tester.tcl
17 set testprefix vtabdistinct
19 ifcapable !vtab {
20   finish_test
21   return
23 load_static_extension db qpvtab
25 do_execsql_test 1.1 {
26   SELECT ix FROM qpvtab WHERE vn='sqlite3_vtab_distinct';
27 } {0}
28 do_execsql_test 1.2 {
29   SELECT DISTINCT ix FROM qpvtab WHERE vn='sqlite3_vtab_distinct';
30 } {2}
31 do_execsql_test 1.3 {
32   SELECT distinct vn, ix FROM qpvtab(3)
33    WHERE +vn IN ('sqlite3_vtab_distinct','nOrderBy');
34 } {nOrderBy 2 sqlite3_vtab_distinct 2}
35 do_execsql_test 1.4 {
36   SELECT vn, ix FROM qpvtab
37    GROUP BY vn
38   HAVING vn='sqlite3_vtab_distinct';
39 } {sqlite3_vtab_distinct 1}
41 finish_test