Bug #4608 Views: View can have duplicate column names

Submitted: 18 Jul 2004 23:57 Modified: 21 Jul 2004 21:47
Reporter: Trudy Pelzer Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:5.0.1-alpha-debug OS:Linux (SuSE 8.2)
Assigned to: Oleksandr Byelkin CPU Architecture:Any

[18 Jul 2004 23:57] Trudy Pelzer
Description:
MySQL allows the creation of  a view with duplicate column names. This makes it impossible to specify the column one wants to retrieve later. For example, for the view definition below:

mysql> select * from v;
+---+---+
| a | a |
+---+---+
| a | a |
+---+---+
1 row in set (0.00 sec)

mysql> select a from v;
+---+
| a |
+---+
| a |
+---+
1 row in set (0.00 sec)
Which column a is being retrieved?

How to repeat:
create view v (a,a) as select 'a','a';
select * from v;
select a from v;
[19 Jul 2004 19:13] Aleksey Kishkin
verified on slackware 9
[21 Jul 2004 11:17] Oleksandr Byelkin
ChangeSet 
  1.1718 04/07/21 12:14:45 bell@sanja.is.com.ua +3 -0 
  test of duplicate field names (BUG#4608)
[21 Jul 2004 21:47] Oleksandr Byelkin
Thank you for bugreport. bug is fixed, patch is pushed into our source repository.

Portions of this website are copyright © 2001, 2002 The PHP Group

Page generated in 0.039 sec. using MySQL 8.4.7-u6-cloud

Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.