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
8e8678be
Commit
8e8678be
authored
Nov 28, 2002
by
bell@sanja.is.com.ua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed bug IN subselect with ORDER
parent
0b8054ac
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
4 deletions
+16
-4
mysql-test/r/subselect.result
mysql-test/r/subselect.result
+3
-0
mysql-test/t/subselect.test
mysql-test/t/subselect.test
+2
-0
sql/item_subselect.cc
sql/item_subselect.cc
+11
-4
No files found.
mysql-test/r/subselect.result
View file @
8e8678be
...
...
@@ -32,6 +32,9 @@ a
1
SELECT 1 FROM (SELECT (SELECT a));
Unknown column 'a' in 'field list'
SELECT * FROM (SELECT 1 as id) WHERE id IN (SELECT * FROM (SELECT 1 as id) ORDER BY id LIMIT 1);
id
1
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8;
create table t1 (a int);
create table t2 (a int, b int);
...
...
mysql-test/t/subselect.test
View file @
8e8678be
...
...
@@ -15,6 +15,8 @@ SELECT (SELECT 1), a;
SELECT
1
as
a
FROM
(
SELECT
1
)
HAVING
(
SELECT
a
)
=
1
;
--
error
1054
SELECT
1
FROM
(
SELECT
(
SELECT
a
));
SELECT
*
FROM
(
SELECT
1
as
id
)
WHERE
id
IN
(
SELECT
*
FROM
(
SELECT
1
as
id
)
ORDER
BY
id
LIMIT
1
);
drop
table
if
exists
t1
,
t2
,
t3
,
t4
,
t5
,
t6
,
t7
,
t8
;
create
table
t1
(
a
int
);
create
table
t2
(
a
int
,
b
int
);
...
...
sql/item_subselect.cc
View file @
8e8678be
...
...
@@ -300,15 +300,22 @@ void Item_in_subselect::single_value_transformer(st_select_lex *select_lex,
Item
*
expr
=
new
Item_outer_select_context_saver
(
left_expr
);
if
(
sl
->
having
||
sl
->
with_sum_func
||
sl
->
group_list
.
first
)
if
(
sl
->
having
||
sl
->
with_sum_func
||
sl
->
group_list
.
first
||
sl
->
order_list
.
first
)
{
sl
->
item_list
.
push_back
(
item
);
item
=
(
*
func
)(
expr
,
new
Item_ref
(
sl
->
item_list
.
head_ref
(),
0
,
(
char
*
)
"<result>"
));
if
(
sl
->
having
)
sl
->
having
=
new
Item_cond_and
(
sl
->
having
,
item
);
if
(
sl
->
having
||
sl
->
with_sum_func
||
sl
->
group_list
.
first
)
if
(
sl
->
having
)
sl
->
having
=
new
Item_cond_and
(
sl
->
having
,
item
);
else
sl
->
having
=
item
;
else
sl
->
having
=
item
;
if
(
sl
->
where
)
sl
->
where
=
new
Item_cond_and
(
sl
->
having
,
item
);
else
sl
->
where
=
item
;
}
else
{
...
...
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