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
56a98396
Commit
56a98396
authored
May 06, 2005
by
jani@ibmlab.site
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed bugs 9820, 9799 and 9800.
parent
5aa0edf3
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
54 additions
and
1 deletion
+54
-1
mysql-test/r/select.result
mysql-test/r/select.result
+21
-0
mysql-test/t/select.test
mysql-test/t/select.test
+27
-0
sql/item_sum.cc
sql/item_sum.cc
+6
-1
No files found.
mysql-test/r/select.result
View file @
56a98396
...
...
@@ -2455,3 +2455,24 @@ a
select x.a, y.a, z.a from ( (t1 x inner join t2 y on x.a=y.a) inner join t2 z on y.a=z.a) WHERE x.a=1;
a a a
drop table t1,t2;
create table t1 (s1 varchar(5));
insert into t1 values ('Wall');
select min(s1) from t1 group by s1 with rollup;
min(s1)
Wall
Wall
drop table t1;
create table t1 (s1 int) engine=myisam;
insert into t1 values (0);
select avg(distinct s1) from t1 group by s1 with rollup;
avg(distinct s1)
0.0000
0.0000
drop table t1;
create table t1 (s1 int);
insert into t1 values (null),(1);
select distinct avg(s1) as x from t1 group by s1 with rollup;
x
NULL
1.0000
drop table t1;
mysql-test/t/select.test
View file @
56a98396
...
...
@@ -2029,3 +2029,30 @@ select t1.a from (t1 inner join t2 on t1.a=t2.a) where t2.a=1;
select
t1
.
a
from
((
t1
inner
join
t2
on
t1
.
a
=
t2
.
a
))
where
t2
.
a
=
1
;
select
x
.
a
,
y
.
a
,
z
.
a
from
(
(
t1
x
inner
join
t2
y
on
x
.
a
=
y
.
a
)
inner
join
t2
z
on
y
.
a
=
z
.
a
)
WHERE
x
.
a
=
1
;
drop
table
t1
,
t2
;
#
# Bug#9820
#
create
table
t1
(
s1
varchar
(
5
));
insert
into
t1
values
(
'Wall'
);
select
min
(
s1
)
from
t1
group
by
s1
with
rollup
;
drop
table
t1
;
#
# Bug#9799
#
create
table
t1
(
s1
int
)
engine
=
myisam
;
insert
into
t1
values
(
0
);
select
avg
(
distinct
s1
)
from
t1
group
by
s1
with
rollup
;
drop
table
t1
;
#
# Bug#9800
#
create
table
t1
(
s1
int
);
insert
into
t1
values
(
null
),(
1
);
select
distinct
avg
(
s1
)
as
x
from
t1
group
by
s1
with
rollup
;
drop
table
t1
;
sql/item_sum.cc
View file @
56a98396
...
...
@@ -240,6 +240,8 @@ Item_sum_hybrid::Item_sum_hybrid(THD *thd, Item_sum_hybrid *item)
case
REAL_RESULT
:
sum
=
item
->
sum
;
break
;
case
STRING_RESULT
:
// This can happen with ROLLUP. Note that the value is already
break
;
// copied at function call.
case
ROW_RESULT
:
default:
DBUG_ASSERT
(
0
);
...
...
@@ -585,7 +587,10 @@ bool Item_sum_distinct::setup(THD *thd)
DBUG_ENTER
(
"Item_sum_distinct::setup"
);
DBUG_ASSERT
(
tree
==
0
);
/* setup can not be called twice */
/*
Setup can be called twice for ROLLUP items. This is a bug.
Please add DBUG_ASSERT(tree == 0) here when it's fixed.
*/
/*
Virtual table and the tree are created anew on each re-execution of
...
...
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