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
fa3d6193
Commit
fa3d6193
authored
Nov 29, 2002
by
bell@sanja.is.com.ua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed error handling bug
fixed naming bug fixed bug of subselect excluding
parent
e1cb8679
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
1 deletion
+17
-1
mysql-test/r/subselect.result
mysql-test/r/subselect.result
+8
-0
mysql-test/t/subselect.test
mysql-test/t/subselect.test
+4
-0
sql/item_subselect.cc
sql/item_subselect.cc
+2
-1
sql/sql_lex.cc
sql/sql_lex.cc
+3
-0
No files found.
mysql-test/r/subselect.result
View file @
fa3d6193
...
...
@@ -35,6 +35,14 @@ 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
SELECT * FROM (SELECT 1) WHERE 1 IN (SELECT 1,1);
Cardinality error (more/less than 1 columns)
SELECT 1 IN (SELECT 1);
1 IN (SELECT 1)
1
SELECT 1 FROM (SELECT 1 as a) WHERE 1 IN (SELECT (SELECT a));
1
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 @
fa3d6193
...
...
@@ -16,6 +16,10 @@ 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
);
--
error
1239
SELECT
*
FROM
(
SELECT
1
)
WHERE
1
IN
(
SELECT
1
,
1
);
SELECT
1
IN
(
SELECT
1
);
SELECT
1
FROM
(
SELECT
1
as
a
)
WHERE
1
IN
(
SELECT
(
SELECT
a
));
drop
table
if
exists
t1
,
t2
,
t3
,
t4
,
t5
,
t6
,
t7
,
t8
;
create
table
t1
(
a
int
);
...
...
sql/item_subselect.cc
View file @
fa3d6193
...
...
@@ -92,6 +92,7 @@ bool Item_subselect::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref)
if
(
substitution
)
{
(
*
ref
)
=
substitution
;
substitution
->
name
=
name
;
engine
->
exclude
();
return
substitution
->
fix_fields
(
thd
,
tables
,
ref
);
}
...
...
@@ -293,7 +294,7 @@ void Item_in_subselect::single_value_transformer(st_select_lex *select_lex,
if
(
sl
->
item_list
.
elements
>
1
)
{
my_error
(
ER_CARDINALITY_COL
,
MYF
(
0
),
1
);
item
=
0
;
// Item_asterisk_remover must fail
DBUG_VOID_RETURN
;
}
else
item
=
(
Item
*
)
sl
->
item_list
.
pop
();
...
...
sql/sql_lex.cc
View file @
fa3d6193
...
...
@@ -1071,7 +1071,10 @@ void st_select_lex_unit::exclude_level()
sl
->
link_next
->
link_prev
=
sl
->
link_prev
;
SELECT_LEX_UNIT
**
last
=
0
;
for
(
SELECT_LEX_UNIT
*
u
=
sl
->
first_inner_unit
();
u
;
u
=
u
->
next_unit
())
{
u
->
master
=
master
;
last
=
(
SELECT_LEX_UNIT
**
)
&
(
u
->
next
);
}
if
(
last
)
{
(
*
units_last
)
=
sl
->
first_inner_unit
();
...
...
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