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
f928e0b0
Commit
f928e0b0
authored
Jan 28, 2010
by
Alexander Nozdrin
Browse files
Options
Browse Files
Download
Plain Diff
Auto-merge from mysql-trunk-merge.
parents
547269cf
d2f61748
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
0 deletions
+29
-0
mysql-test/r/subselect.result
mysql-test/r/subselect.result
+13
-0
mysql-test/t/subselect.test
mysql-test/t/subselect.test
+15
-0
sql/sql_select.cc
sql/sql_select.cc
+1
-0
No files found.
mysql-test/r/subselect.result
View file @
f928e0b0
...
@@ -4873,4 +4873,17 @@ SELECT 1 FROM t1 GROUP BY
...
@@ -4873,4 +4873,17 @@ SELECT 1 FROM t1 GROUP BY
1
1
1
1
DROP TABLE t1;
DROP TABLE t1;
#
# Bug #49512 : subquery with aggregate function crash
# subselect_single_select_engine::exec()
CREATE TABLE t1(a INT);
INSERT INTO t1 VALUES();
# should not crash
SELECT 1 FROM t1 WHERE a <> SOME
(
SELECT MAX((SELECT a FROM t1 LIMIT 1)) AS d
FROM t1,t1 a
);
1
DROP TABLE t1;
End of 5.1 tests.
End of 5.1 tests.
mysql-test/t/subselect.test
View file @
f928e0b0
...
@@ -3805,4 +3805,19 @@ SELECT 1 FROM t1 GROUP BY
...
@@ -3805,4 +3805,19 @@ SELECT 1 FROM t1 GROUP BY
(
SELECT
LAST_INSERT_ID
()
FROM
t1
ORDER
BY
MIN
(
a
)
ASC
LIMIT
1
);
(
SELECT
LAST_INSERT_ID
()
FROM
t1
ORDER
BY
MIN
(
a
)
ASC
LIMIT
1
);
DROP
TABLE
t1
;
DROP
TABLE
t1
;
--
echo
#
--
echo
# Bug #49512 : subquery with aggregate function crash
--
echo
# subselect_single_select_engine::exec()
CREATE
TABLE
t1
(
a
INT
);
INSERT
INTO
t1
VALUES
();
--
echo
# should not crash
SELECT
1
FROM
t1
WHERE
a
<>
SOME
(
SELECT
MAX
((
SELECT
a
FROM
t1
LIMIT
1
))
AS
d
FROM
t1
,
t1
a
);
DROP
TABLE
t1
;
--
echo
End
of
5.1
tests
.
--
echo
End
of
5.1
tests
.
sql/sql_select.cc
View file @
f928e0b0
...
@@ -945,6 +945,7 @@ JOIN::optimize()
...
@@ -945,6 +945,7 @@ JOIN::optimize()
DBUG_PRINT
(
"info"
,(
"Select tables optimized away"
));
DBUG_PRINT
(
"info"
,(
"Select tables optimized away"
));
zero_result_cause
=
"Select tables optimized away"
;
zero_result_cause
=
"Select tables optimized away"
;
tables_list
=
0
;
// All tables resolved
tables_list
=
0
;
// All tables resolved
const_tables
=
tables
;
/*
/*
Extract all table-independent conditions and replace the WHERE
Extract all table-independent conditions and replace the WHERE
clause with them. All other conditions were computed by opt_sum_query
clause with them. All other conditions were computed by opt_sum_query
...
...
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