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

Side by Side Diff: third_party/sqlite/test/distinctagg.test

Issue 3108030: Move bundled copy of sqlite one level deeper to better separate it... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 10 years, 4 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « third_party/sqlite/test/diskfull.test ('k') | third_party/sqlite/test/enc.test » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 # 2005 September 11
2 #
3 # The author disclaims copyright to this source code. In place of
4 # a legal notice, here is a blessing:
5 #
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.
9 #
10 #***********************************************************************
11 # This file implements regression tests for SQLite library. The
12 # focus of this script is the DISTINCT modifier on aggregate functions.
13 #
14 # $Id: distinctagg.test,v 1.3 2009/02/09 13:19:28 drh Exp $
15
16
17 set testdir [file dirname $argv0]
18 source $testdir/tester.tcl
19
20 do_test distinctagg-1.1 {
21 execsql {
22 CREATE TABLE t1(a,b,c);
23 INSERT INTO t1 VALUES(1,2,3);
24 INSERT INTO t1 VALUES(1,3,4);
25 INSERT INTO t1 VALUES(1,3,5);
26 SELECT count(distinct a),
27 count(distinct b),
28 count(distinct c),
29 count(all a) FROM t1;
30 }
31 } {1 2 3 3}
32 do_test distinctagg-1.2 {
33 execsql {
34 SELECT b, count(distinct c) FROM t1 GROUP BY b ORDER BY b
35 }
36 } {2 1 3 2}
37 do_test distinctagg-1.3 {
38 execsql {
39 INSERT INTO t1 SELECT a+1, b+3, c+5 FROM t1;
40 INSERT INTO t1 SELECT a+2, b+6, c+10 FROM t1;
41 INSERT INTO t1 SELECT a+4, b+12, c+20 FROM t1;
42 SELECT count(*), count(distinct a), count(distinct b) FROM t1
43 }
44 } {24 8 16}
45 do_test distinctagg-1.4 {
46 execsql {
47 SELECT a, count(distinct c) FROM t1 GROUP BY a ORDER BY a
48 }
49 } {1 3 2 3 3 3 4 3 5 3 6 3 7 3 8 3}
50
51 do_test distinctagg-2.1 {
52 catchsql {
53 SELECT count(distinct) FROM t1;
54 }
55 } {1 {DISTINCT aggregates must have exactly one argument}}
56 do_test distinctagg-2.2 {
57 catchsql {
58 SELECT group_concat(distinct a,b) FROM t1;
59 }
60 } {1 {DISTINCT aggregates must have exactly one argument}}
61
62 finish_test
OLDNEW
« no previous file with comments | « third_party/sqlite/test/diskfull.test ('k') | third_party/sqlite/test/enc.test » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698