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
62fa6c5e
Commit
62fa6c5e
authored
Sep 13, 2005
by
evgen@moonbone.local
Browse files
Options
Browse Files
Download
Plain Diff
Merge
parents
1ec68721
75841099
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
0 deletions
+20
-0
mysql-test/r/view.result
mysql-test/r/view.result
+6
-0
mysql-test/t/view.test
mysql-test/t/view.test
+9
-0
sql/sql_base.cc
sql/sql_base.cc
+5
-0
No files found.
mysql-test/r/view.result
View file @
62fa6c5e
...
@@ -2190,3 +2190,9 @@ create table t1 (s1 int);
...
@@ -2190,3 +2190,9 @@ create table t1 (s1 int);
create view abc as select * from t1 as abc;
create view abc as select * from t1 as abc;
drop table t1;
drop table t1;
drop view abc;
drop view abc;
create table t1(f1 char(1));
create view v1 as select * from t1;
select * from (select f1 as f2 from v1) v where v.f2='a';
f2
drop view v1;
drop table t1;
mysql-test/t/view.test
View file @
62fa6c5e
...
@@ -2068,3 +2068,12 @@ create table t1 (s1 int);
...
@@ -2068,3 +2068,12 @@ create table t1 (s1 int);
create
view
abc
as
select
*
from
t1
as
abc
;
create
view
abc
as
select
*
from
t1
as
abc
;
drop
table
t1
;
drop
table
t1
;
drop
view
abc
;
drop
view
abc
;
#
# Bug #12993 View column rename broken in subselect
#
create
table
t1
(
f1
char
(
1
));
create
view
v1
as
select
*
from
t1
;
select
*
from
(
select
f1
as
f2
from
v1
)
v
where
v
.
f2
=
'a'
;
drop
view
v1
;
drop
table
t1
;
sql/sql_base.cc
View file @
62fa6c5e
...
@@ -2650,10 +2650,15 @@ find_field_in_view(THD *thd, TABLE_LIST *table_list,
...
@@ -2650,10 +2650,15 @@ find_field_in_view(THD *thd, TABLE_LIST *table_list,
*ref != NULL means that *ref contains the item that we need to
*ref != NULL means that *ref contains the item that we need to
replace. If the item was aliased by the user, set the alias to
replace. If the item was aliased by the user, set the alias to
the replacing item.
the replacing item.
We need to set alias on both ref itself and on ref real item.
*/
*/
if
(
*
ref
&&
!
(
*
ref
)
->
is_autogenerated_name
)
if
(
*
ref
&&
!
(
*
ref
)
->
is_autogenerated_name
)
{
item
->
set_name
((
*
ref
)
->
name
,
(
*
ref
)
->
name_length
,
item
->
set_name
((
*
ref
)
->
name
,
(
*
ref
)
->
name_length
,
system_charset_info
);
system_charset_info
);
item
->
real_item
()
->
set_name
((
*
ref
)
->
name
,
(
*
ref
)
->
name_length
,
system_charset_info
);
}
if
(
register_tree_change
)
if
(
register_tree_change
)
thd
->
change_item_tree
(
ref
,
item
);
thd
->
change_item_tree
(
ref
,
item
);
else
else
...
...
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