Original table name and column name and owner missing from aliased column in 
grouped query
------------------------------------------------------------------------------------------

                 Key: CORE-3973
                 URL: http://tracker.firebirdsql.org/browse/CORE-3973
             Project: Firebird Core
          Issue Type: Bug
          Components: Engine
    Affects Versions: 2.5.1
         Environment: WI-V2.5.1.26351 Firebird 2.5 (on Windows 7 64 bit)

            Reporter: Mark Rotteveel


The column description (sqlda / sql info) is missing the original tablename, 
original columnname and owner when the column has an alias and occurs in a 
grouped query. In Jaybird this is used to report the original table and column 
name in the ResultSetMetaData. See JDBC-278 for an issue triggered by this.

This can also be demonstrated in ISQL with SET SQLDA_DISPLAY ON:

1) Normal query with alias (both table, columnname, alias and owner are present 
for both columns):

SQL> select RDB$RELATION_ID AS R_ID, RDB$CHARACTER_SET_NAME FROM RDB$DATABASE;

INPUT  SQLDA version: 1 sqln: 10 sqld: 0

OUTPUT SQLDA version: 1 sqln: 20 sqld: 2
01: sqltype: 501 SHORT   Nullable sqlscale: 0 sqlsubtype: 0 sqllen: 2
  :  name: (15)RDB$RELATION_ID  alias: (4)R_ID
  : table: (12)RDB$DATABASE  owner: (6)SYSDBA
02: sqltype: 453 TEXT     Nullable sqlscale: 0 sqlsubtype: 3 sqllen: 93
  :  name: (22)RDB$CHARACTER_SET_NAME  alias: (22)RDB$CHARACTER_SET_NAME
  : table: (12)RDB$DATABASE  owner: (6)SYSDBA

2) Grouped query with alias (only non-aliased column has table, columnname and 
owner):

SQL> select RDB$RELATION_ID AS R_ID, RDB$CHARACTER_SET_NAME FROM RDB$DATABASE 
GROUP BY RDB$RELATION_ID, RDB$CHARACTER_SET_NAME;

INPUT  SQLDA version: 1 sqln: 10 sqld: 0

OUTPUT SQLDA version: 1 sqln: 20 sqld: 2
01: sqltype: 501 SHORT   Nullable sqlscale: 0 sqlsubtype: 0 sqllen: 2
  :  name: (0)  alias: (4)R_ID
  : table: (0)  owner: (0)
02: sqltype: 453 TEXT     Nullable sqlscale: 0 sqlsubtype: 3 sqllen: 93
  :  name: (22)RDB$CHARACTER_SET_NAME  alias: (22)RDB$CHARACTER_SET_NAME
  : table: (12)RDB$DATABASE  owner: (6)SYSDBA

EXPECTATION: In this case for entry 01 I would expect:
01: sqltype: 501 SHORT   Nullable sqlscale: 0 sqlsubtype: 0 sqllen: 2
  :  name: (22)RDB$CHARACTER_SET_NAME alias: (4)R_ID
  : table: (12)RDB$DATABASE  owner: (6)SYSDBA

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://tracker.firebirdsql.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

------------------------------------------------------------------------------
LogMeIn Central: Instant, anywhere, Remote PC access and management.
Stay in control, update software, and manage PCs from one command center
Diagnose problems and improve visibility into emerging IT issues
Automate, monitor and manage. Do more in less time with Central
http://p.sf.net/sfu/logmein12331_d2d
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to