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
RDB$DB_KEY not supported in derived tables and merge command [CORE1313] #1732
Comments
Modified by: @asfernandesassignee: Adriano dos Santos Fernandes [ asfernandes ] |
Commented by: @asfernandes Compilation problem of MERGE with RDB$DB_KEY's should be solved now. But anyway, your queries will not work well since it compare dbkeys from different tables. :-) |
Modified by: @asfernandesstatus: Open [ 1 ] => Resolved [ 5 ] resolution: Fixed [ 1 ] Fix Version: 2.1 Beta 1 [ 10141 ] |
Commented by: Alexander Tyutik (tut) Adriano, what did you meen about diffirent tables? |
Commented by: @asfernandes Second part of the fix is committed. |
Commented by: @asfernandes You're comparing T (or T2).RDB$DB_KEY with T1.RDB$DB_KEY. |
Commented by: Alexander Tyutik (tut) But all T, T1 and T2 are aliases for same table "TABLE". Such queries can be used for some performance tricks. Is there are some problems with DB_KEYs in such cases? |
Commented by: @asfernandes Your query confused-me, since it doesn't parse correctly. You used the reserved word TABLE without double-quoted. Now I see there is a problem with RDB$DB_KEY and aliases, not only with derived tables. |
Commented by: @pcisar Fix verified for Beta 1, test added. Can't reproduce the issue with first query, but it was included in test anyway. |
Modified by: @pcisarstatus: Resolved [ 5 ] => Closed [ 6 ] |
Modified by: @pcisarWorkflow: jira [ 12287 ] => Firebird [ 14792 ] |
Commented by: @hvlad Backported into 2.0.5 |
Modified by: @hvladFix Version: 2.0.5 [ 10222 ] |
Modified by: @pavel-zotovQA Status: No test |
Modified by: @pavel-zotovQA Status: No test => Done successfully |
Submitted by: Alexander Tyutik (tut)
Is related to QA139
I've got error when trying to run queries like this:
SELECT T1.*
FROM TABLE T1
RIGHT JOIN (SELECT T.RDB$DB_KEY AS DBKEY FROM TABLE T) T2 ON T2.DBKEY = T1.RDB$DB_KEY;
or this:
MERGE INTO TABLE T1
USING (SELECT T.RDB$DB_KEY AS DBKEY FROM TABLE T) T2
ON T2.DBKEY = T1.RDB$DB_KEY
WHEN NOT MATCHED THEN INSERT ...
Error is something like this:
Column unknown.
T.DB_KEY.
Commits: 6dfc7f8 564c288 ea48ea8
The text was updated successfully, but these errors were encountered: