mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-04-24 18:27:02 +03:00
102 lines
3.6 KiB
Plaintext
102 lines
3.6 KiB
Plaintext
# -------------------------------------------------------------- #
|
|
# Test case migrated from regression test suite: bug5228.sql
|
|
#
|
|
# Author: Daniel Lee, daniel.lee@mariadb.com
|
|
# -------------------------------------------------------------- #
|
|
#
|
|
--source ../include/have_columnstore.inc
|
|
#
|
|
USE tpch1;
|
|
#
|
|
--disable_warnings
|
|
drop table if exists uriage_inf;
|
|
--enable_warnings
|
|
create table uriage_inf(eigyo_shimei varchar(20),uriage numeric) engine=columnstore default charset=utf8;
|
|
|
|
insert into uriage_inf values('SMITH',1000); insert into uriage_inf values('ALLEN',2000); insert into uriage_inf values('JONES',3000); insert into uriage_inf values('SMITH',4000); insert into uriage_inf values('BLAKE',5000);
|
|
|
|
--disable_warnings
|
|
drop table if exists uriage_my;
|
|
--enable_warnings
|
|
create table uriage_my (eigyo_shimei varchar(20),uriage numeric) engine=myisam default charset=utf8;
|
|
|
|
insert into uriage_my values('SMITH',1000); insert into uriage_my values('ALLEN',2000); insert into uriage_my values('JONES',3000); insert into uriage_my values('SMITH',4000); insert into uriage_my values('BLAKE',5000);
|
|
|
|
SELECT
|
|
T1.`eigyo_shimei`,
|
|
(CASE (T1.`eigyo_shimei`) WHEN 'SMITH' THEN 1 WHEN 'ALLEN' THEN 2 WHEN 'JONES' THEN 3 ELSE 4 END),
|
|
SUM(T1.`uriage`)
|
|
FROM uriage_inf T1
|
|
GROUP BY
|
|
T1.`eigyo_shimei`,
|
|
(CASE (T1.`eigyo_shimei`) WHEN 'SMITH' THEN 1 WHEN 'ALLEN' THEN 2 WHEN 'JONES' THEN 3 ELSE 4 END)
|
|
ORDER BY
|
|
T1.`eigyo_shimei`,
|
|
(CASE (T1.`eigyo_shimei`) WHEN 'SMITH' THEN 1 WHEN 'ALLEN' THEN 2 WHEN 'JONES' THEN 3 ELSE 4 END);
|
|
|
|
SELECT
|
|
T1.`eigyo_shimei`,
|
|
(CASE (T1.eigyo_shimei) WHEN 'SMITH' THEN 1 WHEN 'ALLEN' THEN 2 WHEN 'JONES' THEN 3 ELSE 4 END),
|
|
SUM(T1.`uriage`)
|
|
FROM uriage_inf T1
|
|
GROUP BY
|
|
T1.`eigyo_shimei`,
|
|
(CASE (T1.`eigyo_shimei`) WHEN 'SMITH' THEN 1 WHEN 'ALLEN' THEN 2 WHEN 'JONES' THEN 3 ELSE 4 END)
|
|
ORDER BY
|
|
T1.`eigyo_shimei`,
|
|
(CASE (T1.`eigyo_shimei`) WHEN 'SMITH' THEN 1 WHEN 'ALLEN' THEN 2 WHEN 'JONES' THEN 3 ELSE 4 END);
|
|
|
|
SELECT
|
|
T1.`eigyo_shimei`,
|
|
(CASE (T1.`eigyo_shimei`) WHEN 'SMITH' THEN 1 WHEN 'ALLEN' THEN 2 WHEN 'JONES' THEN 3 ELSE 4 END) number,
|
|
SUM(T1.`uriage`)
|
|
FROM uriage_inf T1
|
|
GROUP BY
|
|
T1.`eigyo_shimei`,
|
|
(CASE (T1.`eigyo_shimei`) WHEN 'SMITH' THEN 1 WHEN 'ALLEN' THEN 2 WHEN 'JONES' THEN 3 ELSE 4 END)
|
|
ORDER BY
|
|
T1.`eigyo_shimei`,
|
|
(CASE (T1.`eigyo_shimei`) WHEN 'SMITH' THEN 1 WHEN 'ALLEN' THEN 2 WHEN 'JONES' THEN 3 ELSE 4 END);
|
|
|
|
SELECT
|
|
T1.`eigyo_shimei`,
|
|
(CASE (T1.`eigyo_shimei`) WHEN 'SMITH' THEN 1 WHEN 'ALLEN' THEN 2 WHEN 'JONES' THEN 3 ELSE 4 END),
|
|
SUM(T1.`uriage`)
|
|
FROM uriage_my T1
|
|
GROUP BY
|
|
T1.`eigyo_shimei`,
|
|
(CASE (T1.`eigyo_shimei`) WHEN 'SMITH' THEN 1 WHEN 'ALLEN' THEN 2 WHEN 'JONES' THEN 3 ELSE 4 END)
|
|
ORDER BY
|
|
T1.`eigyo_shimei`,
|
|
(CASE (T1.`eigyo_shimei`) WHEN 'SMITH' THEN 1 WHEN 'ALLEN' THEN 2 WHEN 'JONES' THEN 3 ELSE 4 END);
|
|
|
|
SELECT
|
|
T1.`eigyo_shimei`,
|
|
(CASE (T1.eigyo_shimei) WHEN 'SMITH' THEN 1 WHEN 'ALLEN' THEN 2 WHEN 'JONES' THEN 3 ELSE 4 END),
|
|
SUM(T1.`uriage`)
|
|
FROM uriage_my T1
|
|
GROUP BY
|
|
T1.`eigyo_shimei`,
|
|
(CASE (T1.`eigyo_shimei`) WHEN 'SMITH' THEN 1 WHEN 'ALLEN' THEN 2 WHEN 'JONES' THEN 3 ELSE 4 END)
|
|
ORDER BY
|
|
T1.`eigyo_shimei`,
|
|
(CASE (T1.`eigyo_shimei`) WHEN 'SMITH' THEN 1 WHEN 'ALLEN' THEN 2 WHEN 'JONES' THEN 3 ELSE 4 END);
|
|
|
|
SELECT
|
|
T1.`eigyo_shimei`,
|
|
(CASE (T1.eigyo_shimei) WHEN 'SMITH' THEN 1 WHEN 'ALLEN' THEN 2 WHEN 'JONES' THEN 3 ELSE 4 END) number,
|
|
SUM(T1.`uriage`)
|
|
FROM uriage_my T1
|
|
GROUP BY
|
|
T1.`eigyo_shimei`,
|
|
(CASE (T1.`eigyo_shimei`) WHEN 'SMITH' THEN 1 WHEN 'ALLEN' THEN 2 WHEN 'JONES' THEN 3 ELSE 4 END)
|
|
ORDER BY
|
|
T1.`eigyo_shimei`,
|
|
(CASE (T1.`eigyo_shimei`) WHEN 'SMITH' THEN 1 WHEN 'ALLEN' THEN 2 WHEN 'JONES' THEN 3 ELSE 4 END);
|
|
|
|
--disable_warnings
|
|
drop table uriage_inf;
|
|
drop table uriage_my;
|
|
--enable_warnings
|
|
#
|