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
024dba64
Commit
024dba64
authored
Jul 09, 2010
by
Sergey Glukhov
Browse files
Options
Browse Files
Download
Plain Diff
5.1-bugteam->trunk-merge merge
parents
0d80d45a
01313636
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
38 additions
and
1 deletion
+38
-1
mysql-test/r/having.result
mysql-test/r/having.result
+16
-0
mysql-test/t/having.test
mysql-test/t/having.test
+21
-0
sql/sql_select.cc
sql/sql_select.cc
+1
-1
No files found.
mysql-test/r/having.result
View file @
024dba64
...
...
@@ -532,3 +532,19 @@ Warnings:
Warning 1292 Truncated incorrect INTEGER value: 'd'
DROP TABLE t1,t2;
End of 5.0 tests
#
# Bug#54416 MAX from JOIN with HAVING returning NULL with 5.1 and Empty set
#
CREATE TABLE t1 (f1 INT(11), f2 VARCHAR(1), PRIMARY KEY (f1));
INSERT INTO t1 VALUES (1,'f');
CREATE TABLE t2 (f1 INT(11), f2 VARCHAR(1));
INSERT INTO t2 VALUES (2,'m');
INSERT INTO t2 VALUES (3,'m');
INSERT INTO t2 VALUES (11,NULL);
INSERT INTO t2 VALUES (12,'k');
SELECT MAX(t1.f1) field1
FROM t1 JOIN t2 ON t2.f2 LIKE 'x'
HAVING field1 < 7;
field1
DROP TABLE t1,t2;
End of 5.1 tests
mysql-test/t/having.test
View file @
024dba64
...
...
@@ -544,3 +544,24 @@ ORDER BY t1.f2;
DROP
TABLE
t1
,
t2
;
--
echo
End
of
5.0
tests
--
echo
#
--
echo
# Bug#54416 MAX from JOIN with HAVING returning NULL with 5.1 and Empty set
--
echo
#
CREATE
TABLE
t1
(
f1
INT
(
11
),
f2
VARCHAR
(
1
),
PRIMARY
KEY
(
f1
));
INSERT
INTO
t1
VALUES
(
1
,
'f'
);
CREATE
TABLE
t2
(
f1
INT
(
11
),
f2
VARCHAR
(
1
));
INSERT
INTO
t2
VALUES
(
2
,
'm'
);
INSERT
INTO
t2
VALUES
(
3
,
'm'
);
INSERT
INTO
t2
VALUES
(
11
,
NULL
);
INSERT
INTO
t2
VALUES
(
12
,
'k'
);
SELECT
MAX
(
t1
.
f1
)
field1
FROM
t1
JOIN
t2
ON
t2
.
f2
LIKE
'x'
HAVING
field1
<
7
;
DROP
TABLE
t1
,
t2
;
--
echo
End
of
5.1
tests
sql/sql_select.cc
View file @
024dba64
...
...
@@ -1154,7 +1154,7 @@ JOIN::optimize()
elements may be lost during further having
condition transformation in JOIN::exec.
*/
if
(
having
&&
const_table_map
)
if
(
having
&&
const_table_map
&&
!
having
->
with_sum_func
)
{
having
->
update_used_tables
();
having
=
remove_eq_conds
(
thd
,
having
,
&
having_value
);
...
...
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