~ubuntu-branches/ubuntu/maverick/sqlite3/maverick-updates

« back to all changes in this revision

Viewing changes to test/minmax.test

  • Committer: Bazaar Package Importer
  • Author(s): Otavio Salvador
  • Date: 2007-03-06 08:53:43 UTC
  • mfrom: (3.1.5 feisty)
  • Revision ID: james.westby@ubuntu.com-20070306085343-658sxlyhl4behigh
Tags: 3.3.8-1.1
* NMU
* Revert PRAGMA table_info format change on a minor version release
  (closes: #397531)

Show diffs side-by-side

added added

removed removed

Lines of Context:
13
13
# aggregate min() and max() functions and which are handled as
14
14
# as a special case.
15
15
#
16
 
# $Id: minmax.test,v 1.16 2005/01/21 04:25:47 danielk1977 Exp $
 
16
# $Id: minmax.test,v 1.19 2006/03/26 01:21:23 drh Exp $
17
17
 
18
18
set testdir [file dirname $argv0]
19
19
source $testdir/tester.tcl
143
143
  } {1 20}
144
144
  do_test minmax-4.2 {
145
145
    execsql {
146
 
      SELECT y, sum(x) FROM
147
 
        (SELECT null, y+1 FROM t1 UNION SELECT * FROM t1)
 
146
      SELECT y, coalesce(sum(x),0) FROM
 
147
        (SELECT null AS x, y+1 AS y FROM t1 UNION SELECT * FROM t1)
148
148
      GROUP BY y ORDER BY y;
149
149
    }
150
 
  } {1 1.0 2 5.0 3 22.0 4 92.0 5 90.0 6 0.0}
 
150
  } {1 1 2 5 3 22 4 92 5 90 6 0}
151
151
  do_test minmax-4.3 {
152
152
    execsql {
153
153
      SELECT y, count(x), count(*) FROM
154
 
        (SELECT null, y+1 FROM t1 UNION SELECT * FROM t1)
 
154
        (SELECT null AS x, y+1 AS y FROM t1 UNION SELECT * FROM t1)
155
155
      GROUP BY y ORDER BY y;
156
156
    }
157
157
  } {1 1 1 2 2 3 3 4 5 4 8 9 5 5 6 6 0 1}