New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Original table name and column name and owner missing from SQLDA for aliased column in grouped query [CORE3973] #4306
Comments
Modified by: @mrotteveel |
Modified by: @mrotteveeldescription: 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 JDBC278 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 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 EXPECTATION: In this case for entry 01 I would expect: => 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 JDBC278 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 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 EXPECTATION: In this case for entry 01 I would expect: |
Commented by: Sean Leyne (seanleyne) Small correction to the subject provide better context. |
Modified by: Sean Leyne (seanleyne)summary: Original table name and column name and owner missing from aliased column in grouped query => Original table name and column name and owner missing from SQLDA for aliased column in grouped query |
Modified by: @asfernandesstatus: Open [ 1 ] => Resolved [ 5 ] resolution: Fixed [ 1 ] Fix Version: 3.0 Alpha 1 [ 10331 ] assignee: Adriano dos Santos Fernandes [ asfernandes ] |
Commented by: @pcisar Test created. |
Modified by: @pcisarstatus: Resolved [ 5 ] => Closed [ 6 ] |
Submitted by: @mrotteveel
Replaces JDBC278
Is related to QA580
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 JDBC278 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: (15)RDB$RELATION_ID alias: (4)R_ID
: table: (12)RDB$DATABASE owner: (6)SYSDBA
Commits: 745a457
The text was updated successfully, but these errors were encountered: