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
50e61c51
Commit
50e61c51
authored
Nov 30, 2002
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
a fix for a bug with HAVING sum_func IN (...)
parent
7dc2b70f
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
0 deletions
+18
-0
mysql-test/r/group_by.result
mysql-test/r/group_by.result
+7
-0
mysql-test/t/group_by.test
mysql-test/t/group_by.test
+1
-0
sql/item_cmpfunc.cc
sql/item_cmpfunc.cc
+8
-0
sql/item_cmpfunc.h
sql/item_cmpfunc.h
+2
-0
No files found.
mysql-test/r/group_by.result
View file @
50e61c51
...
...
@@ -30,6 +30,13 @@ Documentation 0
Host communication 0
kkkkkkkkkkk lllllllllll 3
Test Procedures 0
value description COUNT(bug_id)
BBBBBBBBBBBBB - conversion 2
BBBBBBBBBBBBB - eeeeeeeee 0
BBBBBBBBBBBBB - generic 2
Documentation 0
Host communication 0
Test Procedures 0
1+1 a count(*)
2 a 0
1+1 a count(*)
...
...
mysql-test/t/group_by.test
View file @
50e61c51
...
...
@@ -206,6 +206,7 @@ INSERT INTO t2 VALUES ('Web Interface','AAAAAAAA-AAA','id0001','','');
INSERT
INTO
t2
VALUES
(
'Host communication'
,
'AAAAA'
,
'id0001'
,
''
,
''
);
select
value
,
description
,
bug_id
from
t2
left
join
t1
on
t2
.
program
=
t1
.
product
and
t2
.
value
=
t1
.
component
where
program
=
"AAAAA"
;
select
value
,
description
,
COUNT
(
bug_id
)
from
t2
left
join
t1
on
t2
.
program
=
t1
.
product
and
t2
.
value
=
t1
.
component
where
program
=
"AAAAA"
group
by
value
;
select
value
,
description
,
COUNT
(
bug_id
)
from
t2
left
join
t1
on
t2
.
program
=
t1
.
product
and
t2
.
value
=
t1
.
component
where
program
=
"AAAAA"
group
by
value
having
COUNT
(
bug_id
)
IN
(
0
,
2
);
drop
table
t1
,
t2
;
...
...
sql/item_cmpfunc.cc
View file @
50e61c51
...
...
@@ -1029,6 +1029,14 @@ void Item_func_in::update_used_tables()
used_tables_cache
|=
item
->
used_tables
();
const_item_cache
&=
item
->
const_item
();
}
void
Item_func_in
::
split_sum_func
(
List
<
Item
>
&
fields
)
{
if
(
item
->
used_tables
()
||
item
->
type
()
==
SUM_FUNC_ITEM
)
{
fields
.
push_front
(
item
);
item
=
new
Item_ref
((
Item
**
)
fields
.
head_ref
(),
0
,
item
->
name
);
}
}
longlong
Item_func_bit_or
::
val_int
()
...
...
sql/item_cmpfunc.h
View file @
50e61c51
...
...
@@ -410,6 +410,7 @@ class Item_func_in :public Item_int_func
longlong
val_int
();
bool
fix_fields
(
THD
*
thd
,
struct
st_table_list
*
tlist
)
{
with_sum_func
=
with_sum_func
||
item
->
with_sum_func
;
return
(
item
->
fix_fields
(
thd
,
tlist
)
||
Item_func
::
fix_fields
(
thd
,
tlist
));
}
void
fix_length_and_dec
();
...
...
@@ -421,6 +422,7 @@ class Item_func_in :public Item_int_func
enum
Functype
functype
()
const
{
return
IN_FUNC
;
}
const
char
*
func_name
()
const
{
return
" IN "
;
}
void
update_used_tables
();
void
split_sum_func
(
List
<
Item
>
&
fields
);
};
...
...
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