Bug #39626 Bad column case in a resultset of select from view

Submitted: 24 Sep 2008 11:17 Modified: 24 Sep 2008 12:40
Reporter: Sagi Bashari Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Views Severity:S2 (Serious)
Version:5.0.67, 5.0, 5.1, 6.0 bzr OS:Any
Assigned to: CPU Architecture:Any

[24 Sep 2008 11:17] Sagi Bashari
Description:
When I issue a query that selects from a view, and specify column names in a case that is different from their original case in the table, then MySQL returns the original column names and not the ones I specified. 

This only happens when selecting from view. When selecting from a regular table the columns return in the same case as specified in the query.

How to repeat:
CREATE DATABASE Test_DB;
USE Test_DB;
CREATE TABLE Test_Tbl (ID int(10) PRIMARY KEY, Name varchar(32)) TYPE=InnoDB;
INSERT INTO Test_Tbl VALUES(123, 'Abc');

mysql> SELECT id, name FROM Test_Tbl;
+-----+------+
| id  | name |
+-----+------+
| 123 | Abc  |
+-----+------+

=> column names are identical to the ones specified in the query

CREATE VIEW Test_View AS SELECT * FROM Test_Tbl;

mysql> SELECT id, name FROM Test_View;
+-----+------+
| ID  | Name |
+-----+------+
| 123 | Abc  |
+-----+------+

=> column names do not match the ones specified in the query
[24 Sep 2008 12:40] Sveta Smirnova
Thank you for the report.

Verified as described.

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

Page generated in 0.060 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.