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
8fc01031
Commit
8fc01031
authored
Jun 25, 2010
by
Georgi Kodinov
Browse files
Options
Browse Files
Download
Plain Diff
merge
parents
2a86768e
93013ae6
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
44 additions
and
1 deletion
+44
-1
mysql-test/r/subselect.result
mysql-test/r/subselect.result
+17
-0
mysql-test/t/subselect.test
mysql-test/t/subselect.test
+25
-0
sql/sql_select.cc
sql/sql_select.cc
+2
-1
No files found.
mysql-test/r/subselect.result
View file @
8fc01031
...
@@ -4717,3 +4717,20 @@ t1_id total_amount
...
@@ -4717,3 +4717,20 @@ t1_id total_amount
DROP TABLE t3;
DROP TABLE t3;
DROP TABLE t2;
DROP TABLE t2;
DROP TABLE t1;
DROP TABLE t1;
#
# Bug #52711: Segfault when doing EXPLAIN SELECT with
# union...order by (select... where...)
#
CREATE TABLE t1 (a VARCHAR(10), FULLTEXT KEY a (a));
INSERT INTO t1 VALUES (1),(2);
CREATE TABLE t2 (b INT);
INSERT INTO t2 VALUES (1),(2);
# Should not crash
EXPLAIN
SELECT * FROM t2 UNION SELECT * FROM t2
ORDER BY (SELECT * FROM t1 WHERE MATCH(a) AGAINST ('+abc' IN BOOLEAN MODE));
# Should not crash
SELECT * FROM t2 UNION SELECT * FROM t2
ORDER BY (SELECT * FROM t1 WHERE MATCH(a) AGAINST ('+abc' IN BOOLEAN MODE));
DROP TABLE t1,t2;
End of 5.1 tests
mysql-test/t/subselect.test
View file @
8fc01031
...
@@ -3701,3 +3701,28 @@ GROUP BY
...
@@ -3701,3 +3701,28 @@ GROUP BY
DROP
TABLE
t3
;
DROP
TABLE
t3
;
DROP
TABLE
t2
;
DROP
TABLE
t2
;
DROP
TABLE
t1
;
DROP
TABLE
t1
;
--
echo
#
--
echo
# Bug #52711: Segfault when doing EXPLAIN SELECT with
--
echo
# union...order by (select... where...)
--
echo
#
CREATE
TABLE
t1
(
a
VARCHAR
(
10
),
FULLTEXT
KEY
a
(
a
));
INSERT
INTO
t1
VALUES
(
1
),(
2
);
CREATE
TABLE
t2
(
b
INT
);
INSERT
INTO
t2
VALUES
(
1
),(
2
);
--
echo
# Should not crash
--
disable_result_log
EXPLAIN
SELECT
*
FROM
t2
UNION
SELECT
*
FROM
t2
ORDER
BY
(
SELECT
*
FROM
t1
WHERE
MATCH
(
a
)
AGAINST
(
'+abc'
IN
BOOLEAN
MODE
));
--
echo
# Should not crash
SELECT
*
FROM
t2
UNION
SELECT
*
FROM
t2
ORDER
BY
(
SELECT
*
FROM
t1
WHERE
MATCH
(
a
)
AGAINST
(
'+abc'
IN
BOOLEAN
MODE
));
DROP
TABLE
t1
,
t2
;
--
enable_result_log
--
echo
End
of
5.1
tests
sql/sql_select.cc
View file @
8fc01031
...
@@ -7238,7 +7238,8 @@ remove_const(JOIN *join,ORDER *first_order, COND *cond,
...
@@ -7238,7 +7238,8 @@ remove_const(JOIN *join,ORDER *first_order, COND *cond,
*
simple_order
=
0
;
// Must do a temp table to sort
*
simple_order
=
0
;
// Must do a temp table to sort
else
if
(
!
(
order_tables
&
not_const_tables
))
else
if
(
!
(
order_tables
&
not_const_tables
))
{
{
if
(
order
->
item
[
0
]
->
with_subselect
)
if
(
order
->
item
[
0
]
->
with_subselect
&&
!
(
join
->
select_lex
->
options
&
SELECT_DESCRIBE
))
order
->
item
[
0
]
->
val_str
(
&
order
->
item
[
0
]
->
str_value
);
order
->
item
[
0
]
->
val_str
(
&
order
->
item
[
0
]
->
str_value
);
DBUG_PRINT
(
"info"
,(
"removing: %s"
,
order
->
item
[
0
]
->
full_name
()));
DBUG_PRINT
(
"info"
,(
"removing: %s"
,
order
->
item
[
0
]
->
full_name
()));
continue
;
// skip const item
continue
;
// skip const item
...
...
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