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
fd7cbdc4
Commit
fd7cbdc4
authored
Oct 06, 2010
by
Georgi Kodinov
Browse files
Options
Browse Files
Download
Plain Diff
merge
parents
86d35d20
5a9b624a
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
44 additions
and
11 deletions
+44
-11
mysql-test/r/ps.result
mysql-test/r/ps.result
+18
-0
mysql-test/t/ps.test
mysql-test/t/ps.test
+11
-0
sql/item_subselect.cc
sql/item_subselect.cc
+15
-11
No files found.
mysql-test/r/ps.result
View file @
fd7cbdc4
...
@@ -3025,6 +3025,24 @@ Warnings:
...
@@ -3025,6 +3025,24 @@ Warnings:
Note 1003 select 1 AS `1` from `test`.`t1` `t2` left join `test`.`t1` on(1) where 1
Note 1003 select 1 AS `1` from `test`.`t1` `t2` left join `test`.`t1` on(1) where 1
DEALLOCATE PREPARE stmt;
DEALLOCATE PREPARE stmt;
DROP TABLE t1;
DROP TABLE t1;
#
# Bug#54488 crash when using explain and prepared statements with subqueries
#
CREATE TABLE t1(f1 INT);
INSERT INTO t1 VALUES (1),(1);
PREPARE stmt FROM 'EXPLAIN SELECT 1 FROM t1 WHERE (SELECT (SELECT 1 FROM t1 GROUP BY f1))';
EXECUTE stmt;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 2
2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL No tables used
3 SUBQUERY t1 ALL NULL NULL NULL NULL 2 Using temporary; Using filesort
EXECUTE stmt;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 2
2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL No tables used
3 SUBQUERY t1 ALL NULL NULL NULL NULL 2 Using temporary; Using filesort
DEALLOCATE PREPARE stmt;
DROP TABLE t1;
End of 5.1 tests.
End of 5.1 tests.
...
...
mysql-test/t/ps.test
View file @
fd7cbdc4
...
@@ -3090,6 +3090,17 @@ EXECUTE stmt;
...
@@ -3090,6 +3090,17 @@ EXECUTE stmt;
DEALLOCATE
PREPARE
stmt
;
DEALLOCATE
PREPARE
stmt
;
DROP
TABLE
t1
;
DROP
TABLE
t1
;
--
echo
#
--
echo
# Bug#54488 crash when using explain and prepared statements with subqueries
--
echo
#
CREATE
TABLE
t1
(
f1
INT
);
INSERT
INTO
t1
VALUES
(
1
),(
1
);
PREPARE
stmt
FROM
'EXPLAIN SELECT 1 FROM t1 WHERE (SELECT (SELECT 1 FROM t1 GROUP BY f1))'
;
EXECUTE
stmt
;
EXECUTE
stmt
;
DEALLOCATE
PREPARE
stmt
;
DROP
TABLE
t1
;
--
echo
--
echo
--
echo
End
of
5.1
tests
.
--
echo
End
of
5.1
tests
.
...
...
sql/item_subselect.cc
View file @
fd7cbdc4
...
@@ -1911,7 +1911,10 @@ int subselect_single_select_engine::exec()
...
@@ -1911,7 +1911,10 @@ int subselect_single_select_engine::exec()
}
}
if
(
!
select_lex
->
uncacheable
&&
thd
->
lex
->
describe
&&
if
(
!
select_lex
->
uncacheable
&&
thd
->
lex
->
describe
&&
!
(
join
->
select_options
&
SELECT_DESCRIBE
)
&&
!
(
join
->
select_options
&
SELECT_DESCRIBE
)
&&
join
->
need_tmp
&&
item
->
const_item
())
join
->
need_tmp
)
{
item
->
update_used_tables
();
if
(
item
->
const_item
())
{
{
/*
/*
Force join->join_tmp creation, because this subquery will be replaced
Force join->join_tmp creation, because this subquery will be replaced
...
@@ -1924,6 +1927,7 @@ int subselect_single_select_engine::exec()
...
@@ -1924,6 +1927,7 @@ int subselect_single_select_engine::exec()
if
(
join
->
init_save_join_tab
())
if
(
join
->
init_save_join_tab
())
DBUG_RETURN
(
1
);
/* purecov: inspected */
DBUG_RETURN
(
1
);
/* purecov: inspected */
}
}
}
if
(
item
->
engine_changed
)
if
(
item
->
engine_changed
)
{
{
DBUG_RETURN
(
1
);
DBUG_RETURN
(
1
);
...
...
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