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
50481ebf
Commit
50481ebf
authored
Dec 23, 2002
by
bell@sanja.is.com.ua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
LIMIT is prohibited in IN/ALL/ANY/SOME
parent
bd925bbc
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
2 deletions
+30
-2
mysql-test/r/subselect.result
mysql-test/r/subselect.result
+7
-1
mysql-test/t/subselect.test
mysql-test/t/subselect.test
+9
-1
sql/item_subselect.cc
sql/item_subselect.cc
+14
-0
No files found.
mysql-test/r/subselect.result
View file @
50481ebf
...
...
@@ -32,7 +32,7 @@ a
1
SELECT 1 FROM (SELECT (SELECT a) b) c;
Unknown column 'a' in 'field list'
SELECT * FROM (SELECT 1 as id) b WHERE id IN (SELECT * FROM (SELECT 1 as id) c ORDER BY id
LIMIT 1
);
SELECT * FROM (SELECT 1 as id) b WHERE id IN (SELECT * FROM (SELECT 1 as id) c ORDER BY id);
id
1
SELECT * FROM (SELECT 1) a WHERE 1 IN (SELECT 1,1);
...
...
@@ -705,3 +705,9 @@ select 10.5 > ANY (SELECT * from t);
10.5 > ANY (SELECT * from t)
1
drop table t;
create table t (a float);
select 10.5 IN (SELECT * from t LIMIT 1);
This version of MySQL doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery'
select 10.5 IN (SELECT * from t LIMIT 1 UNION SELECT 1.5);
This version of MySQL doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery'
drop table t;
mysql-test/t/subselect.test
View file @
50481ebf
...
...
@@ -15,7 +15,7 @@ SELECT (SELECT 1), a;
SELECT
1
as
a
FROM
(
SELECT
1
)
as
b
HAVING
(
SELECT
a
)
=
1
;
--
error
1054
SELECT
1
FROM
(
SELECT
(
SELECT
a
)
b
)
c
;
SELECT
*
FROM
(
SELECT
1
as
id
)
b
WHERE
id
IN
(
SELECT
*
FROM
(
SELECT
1
as
id
)
c
ORDER
BY
id
LIMIT
1
);
SELECT
*
FROM
(
SELECT
1
as
id
)
b
WHERE
id
IN
(
SELECT
*
FROM
(
SELECT
1
as
id
)
c
ORDER
BY
id
);
--
error
1239
SELECT
*
FROM
(
SELECT
1
)
a
WHERE
1
IN
(
SELECT
1
,
1
);
SELECT
1
IN
(
SELECT
1
);
...
...
@@ -409,3 +409,11 @@ select 10.5 > ALL (SELECT * from t);
select
1.5
>
ANY
(
SELECT
*
from
t
);
select
10.5
>
ANY
(
SELECT
*
from
t
);
drop
table
t
;
#LIMIT is not supported now
create
table
t
(
a
float
);
--
error
1235
select
10.5
IN
(
SELECT
*
from
t
LIMIT
1
);
--
error
1235
select
10.5
IN
(
SELECT
*
from
t
LIMIT
1
UNION
SELECT
1.5
);
drop
table
t
;
\ No newline at end of file
sql/item_subselect.cc
View file @
50481ebf
...
...
@@ -318,6 +318,13 @@ void Item_in_subselect::single_value_transformer(st_select_lex *select_lex,
compare_func_creator
func
)
{
DBUG_ENTER
(
"Item_in_subselect::single_value_transformer"
);
if
(
select_lex
->
master_unit
()
->
global_parameters
->
select_limit
!=
HA_POS_ERROR
)
{
my_error
(
ER_NOT_SUPPORTED_YET
,
MYF
(
0
),
"LIMIT & IN/ALL/ANY/SOME subquery"
);
DBUG_VOID_RETURN
;
}
Item_in_optimizer
*
optimizer
;
substitution
=
optimizer
=
new
Item_in_optimizer
(
left_expr
,
this
);
if
(
!
optimizer
)
...
...
@@ -334,6 +341,13 @@ void Item_in_subselect::single_value_transformer(st_select_lex *select_lex,
select_lex
->
master_unit
()
->
dependent
=
1
;
for
(
SELECT_LEX
*
sl
=
select_lex
;
sl
;
sl
=
sl
->
next_select
())
{
if
(
select_lex
->
select_limit
!=
HA_POS_ERROR
)
{
my_error
(
ER_NOT_SUPPORTED_YET
,
MYF
(
0
),
"LIMIT & IN/ALL/ANY/SOME subquery"
);
DBUG_VOID_RETURN
;
}
select_lex
->
dependent
=
1
;
Item
*
item
;
if
(
sl
->
item_list
.
elements
>
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