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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
d6c476b8
Commit
d6c476b8
authored
Jun 19, 2008
by
Tatiana A. Nurnberg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed bug #37004.
The value of JOIN::tables must be set to 0 when there is no matching min/max row.
parent
69662273
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
0 deletions
+21
-0
mysql-test/r/subselect.result
mysql-test/r/subselect.result
+7
-0
mysql-test/t/subselect.test
mysql-test/t/subselect.test
+12
-0
sql/sql_select.cc
sql/sql_select.cc
+2
-0
No files found.
mysql-test/r/subselect.result
View file @
d6c476b8
...
...
@@ -4391,3 +4391,10 @@ SELECT * FROM t1 WHERE _utf8'a' = ANY (SELECT s1 FROM t1);
s1
a
DROP TABLE t1;
CREATE TABLE t1(c int, KEY(c));
CREATE TABLE t2(a int, b int);
INSERT INTO t2 VALUES (1, 10), (2, NULL);
INSERT INTO t1 VALUES (1), (3);
SELECT * FROM t2 WHERE b NOT IN (SELECT max(t.c) FROM t1, t1 t WHERE t.c>10);
a b
DROP TABLE t1,t2;
mysql-test/t/subselect.test
View file @
d6c476b8
...
...
@@ -3273,3 +3273,15 @@ INSERT INTO t1 VALUES ('a');
SELECT
*
FROM
t1
WHERE
_utf8
'a'
=
ANY
(
SELECT
s1
FROM
t1
);
DROP
TABLE
t1
;
#
# Bug #37004: NOT IN subquery with MAX over an empty set
#
CREATE
TABLE
t1
(
c
int
,
KEY
(
c
));
CREATE
TABLE
t2
(
a
int
,
b
int
);
INSERT
INTO
t2
VALUES
(
1
,
10
),
(
2
,
NULL
);
INSERT
INTO
t1
VALUES
(
1
),
(
3
);
SELECT
*
FROM
t2
WHERE
b
NOT
IN
(
SELECT
max
(
t
.
c
)
FROM
t1
,
t1
t
WHERE
t
.
c
>
10
);
DROP
TABLE
t1
,
t2
;
sql/sql_select.cc
View file @
d6c476b8
...
...
@@ -888,6 +888,7 @@ JOIN::optimize()
{
DBUG_PRINT
(
"info"
,(
"No matching min/max row"
));
zero_result_cause
=
"No matching min/max row"
;
tables
=
0
;
error
=
0
;
DBUG_RETURN
(
0
);
}
...
...
@@ -901,6 +902,7 @@ JOIN::optimize()
{
DBUG_PRINT
(
"info"
,(
"No matching min/max row"
));
zero_result_cause
=
"No matching min/max row"
;
tables
=
0
;
error
=
0
;
DBUG_RETURN
(
0
);
}
...
...
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