mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Test cleanup
mysql-test/r/case.result: Removed unnecessary drop commands mysql-test/t/case.test: Removed unnecessary drop commands
This commit is contained in:
@ -63,7 +63,6 @@ nothing 2
|
|||||||
one 1
|
one 1
|
||||||
two 1
|
two 1
|
||||||
drop table t1;
|
drop table t1;
|
||||||
drop table if exists t;
|
|
||||||
create table t1 (row int not null, col int not null, val varchar(255) not null);
|
create table t1 (row int not null, col int not null, val varchar(255) not null);
|
||||||
insert into t1 values (1,1,'orange'),(1,2,'large'),(2,1,'yellow'),(2,2,'medium'),(3,1,'green'),(3,2,'small');
|
insert into t1 values (1,1,'orange'),(1,2,'large'),(2,1,'yellow'),(2,2,'medium'),(3,1,'green'),(3,2,'small');
|
||||||
select max(case col when 1 then val else null end) as color from t1 group by row;
|
select max(case col when 1 then val else null end) as color from t1 group by row;
|
||||||
@ -71,4 +70,4 @@ color
|
|||||||
orange
|
orange
|
||||||
yellow
|
yellow
|
||||||
green
|
green
|
||||||
drop table if exists t;
|
drop table t1;
|
||||||
|
@ -30,8 +30,12 @@ insert into t1 values(1),(2),(3),(4);
|
|||||||
select case a when 1 then 2 when 2 then 3 else 0 end as fcase, count(*) from t1 group by fcase;
|
select case a when 1 then 2 when 2 then 3 else 0 end as fcase, count(*) from t1 group by fcase;
|
||||||
select case a when 1 then "one" when 2 then "two" else "nothing" end as fcase, count(*) from t1 group by fcase;
|
select case a when 1 then "one" when 2 then "two" else "nothing" end as fcase, count(*) from t1 group by fcase;
|
||||||
drop table t1;
|
drop table t1;
|
||||||
drop table if exists t1;
|
|
||||||
|
#
|
||||||
|
# Test MAX(CASE ... ) that can return null
|
||||||
|
#
|
||||||
|
|
||||||
create table t1 (row int not null, col int not null, val varchar(255) not null);
|
create table t1 (row int not null, col int not null, val varchar(255) not null);
|
||||||
insert into t1 values (1,1,'orange'),(1,2,'large'),(2,1,'yellow'),(2,2,'medium'),(3,1,'green'),(3,2,'small');
|
insert into t1 values (1,1,'orange'),(1,2,'large'),(2,1,'yellow'),(2,2,'medium'),(3,1,'green'),(3,2,'small');
|
||||||
select max(case col when 1 then val else null end) as color from t1 group by row;
|
select max(case col when 1 then val else null end) as color from t1 group by row;
|
||||||
drop table if exists t1;
|
drop table t1;
|
||||||
|
Reference in New Issue
Block a user