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
isc_info_sql_relation_alias reports incorrect alias for CTE or nested queries [CORE5655] #5921
Comments
Modified by: @mrotteveeldescription: For the following query with CTE as (SELECT column1 from TABLEA T) isc_info_sql_relation_alias reports an incorrect alias. It reports 'CT T', while 'CT' is expected. Note that this also applies for all variants with/without an explicit alias, for example with CTE as (SELECT column1 from TABLEA) will report 'CTE TABLEA' instead of 'CTE' This is especially a problem if you use the alias information to generate enhancements for a base query (see JDBC513). => For the following query with CTE as (SELECT column1 from TABLEA T) isc_info_sql_relation_alias reports an incorrect alias. It reports 'CT T', while 'CT' is expected. Note that this also applies for all variants with/without an explicit alias, for example with CTE as (SELECT column1 from TABLEA) will report 'CTE TABLEA' instead of 'CTE' And for nested queries, eg select * from (select column1 from tablea t) d will return an alias 'd t' instead of 't'. This is especially a problem if you use the alias information to generate enhancements for a base query (see JDBC513). summary: isc_info_sql_relation_alias reports incorrect alias for CTE => isc_info_sql_relation_alias reports incorrect alias for CTE or nested queryies |
Modified by: @mrotteveeldescription: For the following query with CTE as (SELECT column1 from TABLEA T) isc_info_sql_relation_alias reports an incorrect alias. It reports 'CT T', while 'CT' is expected. Note that this also applies for all variants with/without an explicit alias, for example with CTE as (SELECT column1 from TABLEA) will report 'CTE TABLEA' instead of 'CTE' And for nested queries, eg select * from (select column1 from tablea t) d will return an alias 'd t' instead of 't'. This is especially a problem if you use the alias information to generate enhancements for a base query (see JDBC513). => For the following query with CTE as (SELECT column1 from TABLEA T) isc_info_sql_relation_alias reports an incorrect alias. It reports 'CT T', while 'CT' is expected. Note that this also applies for all variants with/without an explicit alias, for example with CTE as (SELECT column1 from TABLEA) will report 'CTE TABLEA' instead of 'CTE' And for nested queries, eg select * from (select column1 from tablea t) d will return an alias 'd t' instead of 'd'. This is especially a problem if you use the alias information to generate enhancements for a base query (see JDBC513). |
Commented by: @mrotteveel Interestingly, if you take it one level deeper, then you lose the alias information entirely, eg for select e.column1 from (select d.column1 from (select t.column1 from tablea t) d) e it reports an empty string ('') as the table alias of the first column. |
Modified by: @mrotteveelsummary: isc_info_sql_relation_alias reports incorrect alias for CTE or nested queryies => isc_info_sql_relation_alias reports incorrect alias for CTE or nested queries |
Modified by: @mrotteveel |
Modified by: @hvladassignee: Vlad Khorsun [ hvlad ] |
Commented by: @hvlad Patch is committed into master. |
Commented by: @mrotteveel Vlad, I tested it against Firebird 4.0.0.825-0_x64 and it works OK. |
Modified by: @hvladstatus: Open [ 1 ] => Resolved [ 5 ] resolution: Fixed [ 1 ] Fix Version: 3.0.3 [ 10810 ] Fix Version: 4.0 Beta 1 [ 10750 ] |
Commented by: @mrotteveel Will this also be backported to 2.5.x? |
Commented by: @hvlad Looking into it |
Commented by: @hvlad Mark, |
Commented by: @mrotteveel Tested against 2.5.8.27082-0_x64 works OK to. |
Commented by: @mrotteveel Also tested against 3.0.3.32852-0_x64, and works OK to. |
Commented by: @hvlad Thanks |
Modified by: @hvladVersion: 3.0.1 [ 10730 ] Version: 2.5.6 [ 10721 ] Version: 3.0.0 [ 10740 ] Version: 4.0 Initial [ 10621 ] Version: 2.5.5 [ 10670 ] Version: 2.5.4 [ 10585 ] Version: 2.5.3 Update 1 [ 10650 ] Version: 2.1.7 [ 10651 ] Version: 2.5.3 [ 10461 ] Version: 2.5.2 Update 1 [ 10521 ] Version: 2.5.2 [ 10450 ] Version: 2.5.1 [ 10333 ] Version: 2.5.0 [ 10221 ] Fix Version: 2.5.8 [ 10809 ] |
Modified by: @pavel-zotovstatus: Resolved [ 5 ] => Resolved [ 5 ] QA Status: No test => Covered by another test(s) Test Details: See test for CORE5667 |
Modified by: @pavel-zotovstatus: Resolved [ 5 ] => Resolved [ 5 ] Test Details: See test for CORE5667 => See test for CORE5667. |
Modified by: @pavel-zotovstatus: Resolved [ 5 ] => Closed [ 6 ] |
Submitted by: @mrotteveel
Is duplicated by JDBC513
Votes: 1
For the following query
with CTE as (SELECT column1 from TABLEA T)
select CT.column1 from CTE CT
isc_info_sql_relation_alias reports an incorrect alias. It reports 'CT T', while 'CT' is expected.
Note that this also applies for all variants with/without an explicit alias, for example
with CTE as (SELECT column1 from TABLEA)
select column1 from CTE
will report 'CTE TABLEA' instead of 'CTE'
And for nested queries, eg
select * from (select column1 from tablea t) d
will return an alias 'd t' instead of 'd'.
This is especially a problem if you use the alias information to generate enhancements for a base query (see JDBC513).
Commits: ae6d1ba bf220ea d57fef5 FirebirdSQL/jaybird@71d5918 FirebirdSQL/fbt-repository@de47679
====== Test Details ======
See test for CORE5667.
Two samples from here were added into core_5667.fbt.
The text was updated successfully, but these errors were encountered: