Bug #22757 RSMD.getColumnName() returns empty string for select statement that uses AS
Submitted: 27 Sep 2006 19:06 Modified: 27 Sep 2006 19:11
Reporter: Paul Bonfanti Email Updates:
Status: Duplicate Impact on me:
None 
Category:Connector / J Severity:S2 (Serious)
Version:5.0.3 OS:Windows (Windows XP)
Assigned to: CPU Architecture:Any

[27 Sep 2006 19:06] Paul Bonfanti
Description:
When performing a select statement like the following I would expect both ResultSetMetaData.getColumnLabel() and ResultSetMetaData.getColumnName() to return "n":

select now() as n

Instead only getColumnLabel() is returning "n".  getColumnName() is returning an empty string.  With the 3.1.13 version of the driver both methods return "n".  I also checked the following JDBC drivers with the appropriate database and they also returned "n" for both methods:

JDBC-ODBC bridge
JTurbo
Oracle
PostgreSql

How to repeat:
Execute the statement "select now() as n" and then call ResultSetMetaData.getColumnName().
[27 Sep 2006 19:11] Mark Matthews
Dupe of BUG#21379, which is already fixed in the source repository, and has been available in nightly snapshot builds for awhile now.