Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
7c9d00e0
Commit
7c9d00e0
authored
Jul 18, 2017
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug #24595639: INCORRECT BEHAVIOR IN QUERY WITH UNION AND GROUP BY
test case
parent
9b3360ea
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
0 deletions
+33
-0
mysql-test/r/union.result
mysql-test/r/union.result
+18
-0
mysql-test/t/union.test
mysql-test/t/union.test
+15
-0
No files found.
mysql-test/r/union.result
View file @
7c9d00e0
...
...
@@ -1978,3 +1978,21 @@ d
2016-06-04 00:00:00
drop table t1;
End of 5.0 tests
create table t1 (a int, b int);
insert into t1 values (1,1),(2,2),(3,3);
create table t2 (c varchar(30), d varchar(30));
insert into t1 values ('1','1'),('2','2'),('4','4');
create table t3 (e int, f int);
insert into t3 values (1,1),(2,2),(31,31),(32,32);
select e,f, (e , f) in (select e,b from t1 union select c,d from t2) as sub from t3;
e f sub
1 1 1
2 2 1
31 31 0
32 32 0
select avg(f), (e , f) in (select e,b from t1 union select c,d from t2) as sub from t3 group by sub;
avg(f) sub
31.5000 0
1.5000 1
drop table t1,t2,t3;
End of 5.5 tests
mysql-test/t/union.test
View file @
7c9d00e0
...
...
@@ -1370,3 +1370,18 @@ order by d;
drop
table
t1
;
--
echo
End
of
5.0
tests
#
# Bug #24595639: INCORRECT BEHAVIOR IN QUERY WITH UNION AND GROUP BY
#
create
table
t1
(
a
int
,
b
int
);
insert
into
t1
values
(
1
,
1
),(
2
,
2
),(
3
,
3
);
create
table
t2
(
c
varchar
(
30
),
d
varchar
(
30
));
insert
into
t1
values
(
'1'
,
'1'
),(
'2'
,
'2'
),(
'4'
,
'4'
);
create
table
t3
(
e
int
,
f
int
);
insert
into
t3
values
(
1
,
1
),(
2
,
2
),(
31
,
31
),(
32
,
32
);
select
e
,
f
,
(
e
,
f
)
in
(
select
e
,
b
from
t1
union
select
c
,
d
from
t2
)
as
sub
from
t3
;
select
avg
(
f
),
(
e
,
f
)
in
(
select
e
,
b
from
t1
union
select
c
,
d
from
t2
)
as
sub
from
t3
group
by
sub
;
drop
table
t1
,
t2
,
t3
;
--
echo
End
of
5.5
tests
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment