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
c16410d3
Commit
c16410d3
authored
Oct 12, 2005
by
evgen@moonbone.local
Browse files
Options
Browse Files
Download
Plain Diff
Manual merge, fix for bug #7672
parents
a5feed98
6bfc2d4b
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
31 additions
and
0 deletions
+31
-0
mysql-test/r/select.result
mysql-test/r/select.result
+10
-0
mysql-test/t/select.test
mysql-test/t/select.test
+9
-0
sql/item.cc
sql/item.cc
+10
-0
sql/sql_lex.cc
sql/sql_lex.cc
+1
-0
sql/sql_lex.h
sql/sql_lex.h
+1
-0
No files found.
mysql-test/r/select.result
View file @
c16410d3
...
...
@@ -2617,3 +2617,13 @@ select found_rows();
found_rows()
1
DROP TABLE t1;
CREATE TABLE t1 (a INT, b INT);
(SELECT a, b AS c FROM t1) ORDER BY c+1;
a c
(SELECT a, b AS c FROM t1) ORDER BY b+1;
a c
SELECT a, b AS c FROM t1 ORDER BY c+1;
a c
SELECT a, b AS c FROM t1 ORDER BY b+1;
a c
drop table t1;
mysql-test/t/select.test
View file @
c16410d3
...
...
@@ -2052,6 +2052,7 @@ AND FK_firma_id = 2;
drop
table
t1
;
#
#
# Test for Bug#8009, SELECT failed on bigint unsigned when using HEX
#
...
...
@@ -2165,3 +2166,11 @@ select found_rows();
DROP
TABLE
t1
;
# End of 4.1 tests
# Bug 7672 Unknown column error in order clause
#
CREATE
TABLE
t1
(
a
INT
,
b
INT
);
(
SELECT
a
,
b
AS
c
FROM
t1
)
ORDER
BY
c
+
1
;
(
SELECT
a
,
b
AS
c
FROM
t1
)
ORDER
BY
b
+
1
;
SELECT
a
,
b
AS
c
FROM
t1
ORDER
BY
c
+
1
;
SELECT
a
,
b
AS
c
FROM
t1
ORDER
BY
b
+
1
;
drop
table
t1
;
sql/item.cc
View file @
c16410d3
...
...
@@ -1760,6 +1760,16 @@ bool Item_field::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref)
if
((
tmp
=
find_field_in_tables
(
thd
,
this
,
tables
,
&
where
,
0
))
==
not_found_field
)
{
if
(
thd
->
lex
.
select_lex
.
is_item_list_lookup
)
{
Item
**
res
=
find_item_in_list
(
this
,
thd
->
lex
.
select_lex
.
item_list
);
if
(
res
&&
*
res
&&
(
*
res
)
->
type
()
==
Item
::
FIELD_ITEM
)
{
set_field
((
*
((
Item_field
**
)
res
))
->
field
);
return
0
;
}
}
/*
We can't find table field in table list of current select,
consequently we have to find it in outer subselect(s).
...
...
sql/sql_lex.cc
View file @
c16410d3
...
...
@@ -160,6 +160,7 @@ void lex_start(THD *thd, uchar *buf,uint length)
lex
->
duplicates
=
DUP_ERROR
;
lex
->
ignore
=
0
;
lex
->
proc_list
.
first
=
0
;
lex
->
select_lex
.
is_item_list_lookup
=
0
;
}
void
lex_end
(
LEX
*
lex
)
...
...
sql/sql_lex.h
View file @
c16410d3
...
...
@@ -426,6 +426,7 @@ public:
List
<
Item
>
item_list
;
/* list of fields & expressions */
List
<
String
>
interval_list
,
use_index
,
*
use_index_ptr
,
ignore_index
,
*
ignore_index_ptr
;
bool
is_item_list_lookup
;
/*
Usualy it is pointer to ftfunc_list_alloc, but in union used to create fake
select_lex for calling mysql_select under results of union
...
...
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