wasCSharpSQLite – Blame information for rev 1

Subversion Repositories:
Rev:
Rev Author Line No. Line
1 office 1 # 2008 February 15
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 #
12 # Ticket #2942.
13 #
14 # Queries of the form:
15 #
16 # SELECT group_concat(x) FROM (SELECT * FROM table ORDER BY 1);
17 #
18 # The ORDER BY would be dropped by the query flattener. This used
19 # to not matter because aggregate functions sum(), min(), max(), avg(),
20 # and so forth give the same result regardless of the order of inputs.
21 # But with the addition of the group_concat() function, suddenly the
22 # order does matter.
23 #
24 # $Id: tkt2942.test,v 1.1 2008/02/15 14:33:04 drh Exp $
25 #
26  
27 set testdir [file dirname $argv0]
28 source $testdir/tester.tcl
29  
30 ifcapable !subquery {
31 finish_test
32 return
33 }
34  
35 do_test tkt2942.1 {
36 execsql {
37 create table t1(num int);
38 insert into t1 values (2);
39 insert into t1 values (1);
40 insert into t1 values (3);
41 insert into t1 values (4);
42 SELECT group_concat(num) FROM (SELECT num FROM t1 ORDER BY num DESC);
43 }
44 } {4,3,2,1}
45 do_test tkt2942.2 {
46 execsql {
47 SELECT group_concat(num) FROM (SELECT num FROM t1 ORDER BY num);
48 }
49 } {1,2,3,4}
50 do_test tkt2942.3 {
51 execsql {
52 SELECT group_concat(num) FROM (SELECT num FROM t1);
53 }
54 } {2,1,3,4}
55 do_test tkt2942.4 {
56 execsql {
57 SELECT group_concat(num) FROM (SELECT num FROM t1 ORDER BY rowid DESC);
58 }
59 } {4,3,1,2}
60  
61  
62 finish_test