~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/t/olap.test

  • Committer: Mark Atwood
  • Date: 2011-12-28 02:50:31 UTC
  • Revision ID: me@mark.atwood.name-20111228025031-eh4h1zwv4ig88g0i
fix tests/r/basic.result

Show diffs side-by-side

added added

removed removed

Lines of Context:
72
72
# Error handling
73
73
 
74
74
# Cube is not yet implemented
75
 
--error 1235
 
75
--error ER_PARSE_ERROR
76
76
select product, country_id , year, sum(profit) from t1 group by product, country_id, year with cube;
77
 
--error 1235
 
77
--error ER_PARSE_ERROR
78
78
explain select product, country_id , year, sum(profit) from t1 group by product, country_id, year with cube;
79
 
--error 1235
 
79
--error ER_PARSE_ERROR
80
80
select product, country_id , year, sum(profit) from t1 group by product, country_id, year with cube union all select product, country_id , year, sum(profit) from t1 group by product, country_id, year with rollup;
81
81
 
82
82
drop table t1,t2;
90
90
CREATE TABLE t2 (i int);
91
91
INSERT INTO t2 VALUES (100),(200);
92
92
SELECT i, COUNT(*) FROM t1 GROUP BY i WITH ROLLUP;
93
 
SELECT t1.i, t2.i, COUNT(*) FROM t1,t2 GROUP BY t1.i,t2.i WITH ROLLUP;
 
93
SELECT t1.i, t2.i, COUNT(*) FROM t1 CROSS JOIN t2 GROUP BY t1.i,t2.i WITH ROLLUP;
94
94
drop table t1,t2;
95
95
 
96
96
#bug #4767: ROLLUP with LEFT JOIN 
188
188
#                      a group by field declared as NOT NULL
189
189
#
190
190
 
191
 
CREATE TABLE t1 (a int(11) NOT NULL);
 
191
CREATE TABLE t1 (a int NOT NULL);
192
192
INSERT INTO t1 VALUES (1),(2);
193
193
 
194
194
SELECT a, SUM(a) m FROM  t1 GROUP BY a WITH ROLLUP;
201
201
# Tests for bug #7914: ROLLUP over expressions on temporary table
202
202
#
203
203
 
204
 
CREATE TABLE t1 (a int(11));
 
204
CREATE TABLE t1 (a int);
205
205
INSERT INTO t1 VALUES (1),(2);
206
206
 
207
207
SELECT a, SUM(a), SUM(a)+1 FROM (SELECT a FROM t1 UNION select 2) d 
224
224
# Tests for bug #7894: ROLLUP over expressions on group by attributes
225
225
#
226
226
 
227
 
CREATE TABLE t1 (a int(11));
 
227
CREATE TABLE t1 (a int);
228
228
INSERT INTO t1 VALUES (1),(2);
229
229
 
230
230
SELECT a, a+1, SUM(a) FROM t1 GROUP BY a WITH ROLLUP;
254
254
# Test for bug #11543: ROLLUP query with a repeated column in GROUP BY 
255
255
#
256
256
 
257
 
CREATE TABLE t1 (a INT(10) NOT NULL, b INT(10) NOT NULL);
 
257
CREATE TABLE t1 (a INT NOT NULL, b INT NOT NULL);
258
258
INSERT INTO t1 VALUES (1, 1);
259
259
INSERT INTO t1 VALUES (1, 2);
260
260
 
266
266
#                ROLLUP over expressions on not nullable group by attributes 
267
267
#
268
268
 
269
 
CREATE TABLE t1 (a int(11) NOT NULL);
 
269
CREATE TABLE t1 (a int NOT NULL);
270
270
INSERT INTO t1 VALUES (1),(2);
271
271
 
272
272
SELECT * FROM (SELECT a, a + 1, COUNT(*) FROM t1 GROUP BY a WITH ROLLUP) t;
314
314
# End of 4.1 tests
315
315
 
316
316
#
317
 
# Tests for bug #11639: ROLLUP over view executed through filesort
318
 
#
319
 
 
320
 
CREATE TABLE t1(id int, type char(1));
321
 
INSERT INTO t1 VALUES
322
 
  (1,"A"),(2,"C"),(3,"A"),(4,"A"),(5,"B"),
323
 
  (6,"B"),(7,"A"),(8,"C"),(9,"A"),(10,"C");
324
 
CREATE VIEW v1 AS SELECT * FROM t1;
325
 
 
326
 
SELECT type FROM t1 GROUP BY type WITH ROLLUP;
327
 
SELECT type FROM v1 GROUP BY type WITH ROLLUP;
328
 
EXPLAIN SELECT type FROM v1 GROUP BY type WITH ROLLUP;
329
 
 
330
 
DROP VIEW v1;
331
 
DROP TABLE t1;
332
 
 
333
 
#
334
 
# Bug #12885(2): view specified by a subquery with
335
 
#                ROLLUP over expressions on not nullable group by attributes 
336
 
#
337
 
 
338
 
CREATE TABLE t1 (a int(11) NOT NULL);
339
 
INSERT INTO t1 VALUES (1),(2);
340
 
 
341
 
CREATE VIEW v1 AS
342
 
  SELECT a, LENGTH(a), COUNT(*) FROM t1 GROUP BY a WITH ROLLUP;
343
 
 
344
 
DESC v1;
345
 
SELECT * FROM v1;
346
 
 
347
 
DROP VIEW v1;
348
 
DROP TABLE t1;
349
 
 
350
 
#
351
317
# Bug #26830: derived table with ROLLUP 
352
318
#
353
319