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
a947a2bf
Commit
a947a2bf
authored
Sep 20, 2003
by
bell@laptop.sanja.is.com.ua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed processing aggregate functions with static tables (BUG#1318)
parent
aa7fd6f4
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
24 additions
and
3 deletions
+24
-3
mysql-test/r/func_group.result
mysql-test/r/func_group.result
+9
-0
mysql-test/r/subselect.result
mysql-test/r/subselect.result
+1
-0
mysql-test/t/func_group.test
mysql-test/t/func_group.test
+9
-0
sql/sql_select.cc
sql/sql_select.cc
+5
-3
No files found.
mysql-test/r/func_group.result
View file @
a947a2bf
...
@@ -618,3 +618,12 @@ select coercibility(max(a)) from t1;
...
@@ -618,3 +618,12 @@ select coercibility(max(a)) from t1;
coercibility(max(a))
coercibility(max(a))
3
3
drop table t1;
drop table t1;
create table t1 (a int);
insert into t1 values (1);
select max(a) as b from t1 having b=1;
b
1
select a from t1 having a=1;
a
1
drop table t1;
mysql-test/r/subselect.result
View file @
a947a2bf
...
@@ -1338,6 +1338,7 @@ insert into t1 values (1);
...
@@ -1338,6 +1338,7 @@ insert into t1 values (1);
insert into t2 values (1);
insert into t2 values (1);
select * from t1 where exists (select s1 from t2 having max(t2.s1)=t1.s1);
select * from t1 where exists (select s1 from t2 having max(t2.s1)=t1.s1);
s1
s1
1
drop table t1,t2;
drop table t1,t2;
create table t1 (s1 int);
create table t1 (s1 int);
create table t2 (s1 int);
create table t2 (s1 int);
...
...
mysql-test/t/func_group.test
View file @
a947a2bf
...
@@ -360,3 +360,12 @@ create table t1 (a char(10));
...
@@ -360,3 +360,12 @@ create table t1 (a char(10));
insert
into
t1
values
(
'a'
),(
'b'
),(
'c'
);
insert
into
t1
values
(
'a'
),(
'b'
),(
'c'
);
select
coercibility
(
max
(
a
))
from
t1
;
select
coercibility
(
max
(
a
))
from
t1
;
drop
table
t1
;
drop
table
t1
;
#
# aggregate functions on static tables
#
create
table
t1
(
a
int
);
insert
into
t1
values
(
1
);
select
max
(
a
)
as
b
from
t1
having
b
=
1
;
select
a
from
t1
having
a
=
1
;
drop
table
t1
;
sql/sql_select.cc
View file @
a947a2bf
...
@@ -5295,9 +5295,11 @@ do_select(JOIN *join,List<Item> *fields,TABLE *table,Procedure *procedure)
...
@@ -5295,9 +5295,11 @@ do_select(JOIN *join,List<Item> *fields,TABLE *table,Procedure *procedure)
join
->
send_records
=
0
;
join
->
send_records
=
0
;
if
(
join
->
tables
==
join
->
const_tables
)
if
(
join
->
tables
==
join
->
const_tables
)
{
{
if
(
!
join
->
select_lex
->
dependent
||
/*
((
!
join
->
conds
||
join
->
conds
->
val_int
())
&&
HAVING will be chcked after processing aggregate functions,
(
!
join
->
having
||
join
->
having
->
val_int
())))
But WHERE should checkd here (we alredy have read tables)
*/
if
(
!
join
->
conds
||
join
->
conds
->
val_int
())
{
{
if
(
!
(
error
=
(
*
end_select
)(
join
,
join_tab
,
0
))
||
error
==
-
3
)
if
(
!
(
error
=
(
*
end_select
)(
join
,
join_tab
,
0
))
||
error
==
-
3
)
error
=
(
*
end_select
)(
join
,
join_tab
,
1
);
error
=
(
*
end_select
)(
join
,
join_tab
,
1
);
...
...
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