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
67509885
Commit
67509885
authored
Dec 17, 2002
by
Sinisa@sinisa.nasamreza.org
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix for fix_fields in derived tables with UNION's ....
parent
52a9fd52
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
1 deletion
+9
-1
mysql-test/r/derived.result
mysql-test/r/derived.result
+4
-0
mysql-test/t/derived.test
mysql-test/t/derived.test
+4
-0
sql/item.cc
sql/item.cc
+1
-1
No files found.
mysql-test/r/derived.result
View file @
67509885
...
@@ -125,3 +125,7 @@ a a
...
@@ -125,3 +125,7 @@ a a
1 NULL
1 NULL
SELECT * FROM (SELECT 1 UNION SELECT a) b;
SELECT * FROM (SELECT 1 UNION SELECT a) b;
Unknown column 'a' in 'field list'
Unknown column 'a' in 'field list'
SELECT 1 as a FROM (SELECT a UNION SELECT 1) b;
Unknown column 'a' in 'field list'
SELECT 1 as a FROM (SELECT 1 UNION SELECT a) b;
Unknown column 'a' in 'field list'
mysql-test/t/derived.test
View file @
67509885
...
@@ -45,3 +45,7 @@ SELECT * FROM (SELECT (SELECT * FROM (SELECT 1 as a) as a )) as b;
...
@@ -45,3 +45,7 @@ SELECT * FROM (SELECT (SELECT * FROM (SELECT 1 as a) as a )) as b;
select
*
from
(
select
1
as
a
)
b
left
join
(
select
2
as
a
)
c
using
(
a
);
select
*
from
(
select
1
as
a
)
b
left
join
(
select
2
as
a
)
c
using
(
a
);
--
error
1054
--
error
1054
SELECT
*
FROM
(
SELECT
1
UNION
SELECT
a
)
b
;
SELECT
*
FROM
(
SELECT
1
UNION
SELECT
a
)
b
;
--
error
1054
SELECT
1
as
a
FROM
(
SELECT
a
UNION
SELECT
1
)
b
;
--
error
1054
SELECT
1
as
a
FROM
(
SELECT
1
UNION
SELECT
a
)
b
;
sql/item.cc
View file @
67509885
...
@@ -573,7 +573,7 @@ bool Item_field::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref)
...
@@ -573,7 +573,7 @@ bool Item_field::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref)
Item
**
refer
=
(
Item
**
)
not_found_item
;
Item
**
refer
=
(
Item
**
)
not_found_item
;
// Prevent using outer fields in subselects, that is not supported now
// Prevent using outer fields in subselects, that is not supported now
SELECT_LEX
*
cursel
=
(
SELECT_LEX
*
)
thd
->
lex
.
current_select
;
SELECT_LEX
*
cursel
=
(
SELECT_LEX
*
)
thd
->
lex
.
current_select
;
if
(
cursel
->
linkage
!=
DERIVED_TABLE_TYPE
)
if
(
cursel
->
master_unit
()
->
first_select
()
->
linkage
!=
DERIVED_TABLE_TYPE
)
for
(
SELECT_LEX
*
sl
=
cursel
->
outer_select
();
for
(
SELECT_LEX
*
sl
=
cursel
->
outer_select
();
sl
;
sl
;
sl
=
sl
->
outer_select
())
sl
=
sl
->
outer_select
())
...
...
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