mirror of
https://github.com/MariaDB/server.git
synced 2025-01-18 21:12:26 +01:00
1f6ecc0cd3
Cleaned up test; Removed wrong DROP TABLE commands and use standard table and database names. changed store_warning() -> push_warning_print()
31 lines
1.3 KiB
Text
31 lines
1.3 KiB
Text
--disable_warnings
|
|
drop table if exists t1;
|
|
--enable_warnings
|
|
|
|
create table t1 ( product varchar(32), country varchar(32), year int, profit int);
|
|
insert into t1 values ( 'Computer', 'India',2000, 1200),
|
|
( 'TV', 'United States', 1999, 150),
|
|
( 'Calculator', 'United States', 1999,50),
|
|
( 'Computer', 'United States', 1999,1500),
|
|
( 'Computer', 'United States', 2000,1500),
|
|
( 'TV', 'United States', 2000, 150),
|
|
( 'TV', 'India', 2000, 100),
|
|
( 'TV', 'India', 2000, 100),
|
|
( 'Calculator', 'United States', 2000,75),
|
|
( 'Calculator', 'India', 2000,75),
|
|
( 'TV', 'India', 1999, 100),
|
|
( 'Computer', 'India', 1999,1200),
|
|
( 'Computer', 'United States', 2000,1500),
|
|
( 'Calculator', 'United States', 2000,75);
|
|
--error 1235
|
|
select product, country , year, sum(profit) from t1 group by product, country, year with cube;
|
|
--error 1235
|
|
explain select product, country , year, sum(profit) from t1 group by product, country, year with cube;
|
|
--error 1235
|
|
select product, country , year, sum(profit) from t1 group by product, country, year with rollup;
|
|
--error 1235
|
|
explain select product, country , year, sum(profit) from t1 group by product, country, year with rollup;
|
|
--error 1235
|
|
select product, country , year, sum(profit) from t1 group by product, country, year with cube union all select product, country , year, sum(profit) from t1 group by product, country, year with rollup;
|
|
drop table t1;
|
|
|