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
eca8b1a6
Commit
eca8b1a6
authored
Mar 09, 2007
by
holyfoot/hf@hfmain.(none)
Browse files
Options
Browse Files
Download
Plain Diff
Merge mysql.com:/home/hf/work/mrg/mysql-5.0-opt
into mysql.com:/home/hf/work/mrg/mysql-5.1-opt
parents
71e6d696
e10d74cf
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
1 deletion
+30
-1
mysql-test/r/union.result
mysql-test/r/union.result
+11
-0
mysql-test/t/union.test
mysql-test/t/union.test
+13
-0
sql/item.cc
sql/item.cc
+6
-1
No files found.
mysql-test/r/union.result
View file @
eca8b1a6
...
...
@@ -1426,4 +1426,15 @@ select _utf8'12' union select _latin1'12345';
12
12
12345
CREATE TABLE t1 (a int);
INSERT INTO t1 VALUES (3),(1),(2),(4),(1);
SELECT a FROM (SELECT a FROM t1 UNION SELECT a FROM t1 ORDER BY a) AS test;
a
1
2
3
4
SELECT a FROM (SELECT a FROM t1 UNION SELECT a FROM t1 ORDER BY c) AS test;
ERROR 42S22: Unknown column 'c' in 'order clause'
DROP TABLE t1;
End of 5.0 tests
mysql-test/t/union.test
View file @
eca8b1a6
...
...
@@ -900,4 +900,17 @@ drop table t1, t2;
#
select
_utf8
'12'
union
select
_latin1
'12345'
;
#
# Bug #26661: UNION with ORDER BY undefined column in FROM list
#
CREATE
TABLE
t1
(
a
int
);
INSERT
INTO
t1
VALUES
(
3
),(
1
),(
2
),(
4
),(
1
);
SELECT
a
FROM
(
SELECT
a
FROM
t1
UNION
SELECT
a
FROM
t1
ORDER
BY
a
)
AS
test
;
--
error
1054
SELECT
a
FROM
(
SELECT
a
FROM
t1
UNION
SELECT
a
FROM
t1
ORDER
BY
c
)
AS
test
;
DROP
TABLE
t1
;
--
echo
End
of
5.0
tests
sql/item.cc
View file @
eca8b1a6
...
...
@@ -3475,7 +3475,12 @@ Item_field::fix_outer_field(THD *thd, Field **from_field, Item **reference)
*/
Name_resolution_context
*
last_checked_context
=
context
;
Item
**
ref
=
(
Item
**
)
not_found_item
;
Name_resolution_context
*
outer_context
=
context
->
outer_context
;
SELECT_LEX
*
current_sel
=
(
SELECT_LEX
*
)
thd
->
lex
->
current_select
;
Name_resolution_context
*
outer_context
=
0
;
/* Currently derived tables cannot be correlated */
if
(
current_sel
->
master_unit
()
->
first_select
()
->
linkage
!=
DERIVED_TABLE_TYPE
)
outer_context
=
context
->
outer_context
;
for
(;
outer_context
;
outer_context
=
outer_context
->
outer_context
)
...
...
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