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
bf78fd54
Commit
bf78fd54
authored
Jan 07, 2006
by
igor@rurik.mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge rurik.mysql.com:/home/igor/dev/mysql-4.1-0
into rurik.mysql.com:/home/igor/dev/mysql-5.0-0
parents
d2cfad16
05947d99
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
1 deletion
+26
-1
mysql-test/r/having.result
mysql-test/r/having.result
+13
-0
mysql-test/t/having.test
mysql-test/t/having.test
+12
-0
sql/sql_select.cc
sql/sql_select.cc
+1
-1
No files found.
mysql-test/r/having.result
View file @
bf78fd54
...
...
@@ -128,6 +128,19 @@ id description c
1 test 0
2 test2 0
drop table t1,t2,t3;
CREATE TABLE t1 (a int);
INSERT INTO t1 VALUES (3), (4), (1), (3), (1);
SELECT SUM(a) FROM t1 GROUP BY a HAVING SUM(a)>0;
SUM(a)
2
6
4
SELECT SUM(a) FROM t1 GROUP BY a HAVING SUM(a);
SUM(a)
2
6
4
DROP TABLE t1;
create table t1 (col1 int, col2 varchar(5), col_t1 int);
create table t2 (col1 int, col2 varchar(5), col_t2 int);
create table t3 (col1 int, col2 varchar(5), col_t3 int);
...
...
mysql-test/t/having.test
View file @
bf78fd54
...
...
@@ -123,6 +123,18 @@ group by a.id, a.description
having
(
a
.
description
is
not
null
)
and
(
c
=
0
);
drop
table
t1
,
t2
,
t3
;
#
# Bug #14274: HAVING clause containing only set function
#
CREATE
TABLE
t1
(
a
int
);
INSERT
INTO
t1
VALUES
(
3
),
(
4
),
(
1
),
(
3
),
(
1
);
SELECT
SUM
(
a
)
FROM
t1
GROUP
BY
a
HAVING
SUM
(
a
)
>
0
;
SELECT
SUM
(
a
)
FROM
t1
GROUP
BY
a
HAVING
SUM
(
a
);
DROP
TABLE
t1
;
# End of 4.1 tests
#
...
...
sql/sql_select.cc
View file @
bf78fd54
...
...
@@ -365,7 +365,7 @@ JOIN::prepare(Item ***rref_pointer_array,
if
(
having_fix_rc
||
thd
->
net
.
report_error
)
DBUG_RETURN
(
-
1
);
/* purecov: inspected */
if
(
having
->
with_sum_func
)
having
->
split_sum_func
(
thd
,
ref_pointer_array
,
all_fields
);
having
->
split_sum_func
2
(
thd
,
ref_pointer_array
,
all_fields
,
&
having
);
thd
->
lex
->
allow_sum_func
=
save_allow_sum_func
;
}
if
(
select_lex
->
inner_sum_func_list
)
...
...
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