Skip to content
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

Incorrect execution of expressions inside nested sub-queries inside derived tables [CORE2925] #3308

Closed
firebird-automations opened this issue Mar 15, 2010 · 9 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: John Kilin (johnkilin)

Duplicates CORE2893

Test case is below. Expected results are: {0, 1}. Wrong results are: {0, 0}.

select (select case when R.RDB$Relation_ID = 0 then 0 else 1 end from RDB$Database) TypeID
from RDB$Relations R
where R.RDB$Relation_ID < 2
-- correct

select *
from (
select (select case when R.RDB$Relation_ID = 0 then 0 else 1 end from RDB$Database) TypeID
from RDB$Relations R
where R.RDB$Relation_ID < 2
)
-- wrong

select *
from (
select (case when R.RDB$Relation_ID = 0 then 0 else 1 end) TypeID
from RDB$Relations R
where R.RDB$Relation_ID < 2
)
-- correct

====== Test Details ======

See test for core-2893.

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

reporter: Dmitry Yemanov [ dimitr ] => John Kilin [ johnkilin ]

@firebird-automations
Copy link
Collaborator Author

Commented by: @asfernandes

Is this already fixed in HEAD? The three queries returns {0, 1} for me.

@firebird-automations
Copy link
Collaborator Author

Commented by: @dyemanov

Yes, it seems to be fixed in HEAD.

@firebird-automations
Copy link
Collaborator Author

Modified by: @asfernandes

Link: This issue duplicates CORE2893 [ CORE2893 ]

@firebird-automations
Copy link
Collaborator Author

Commented by: @asfernandes

Duplicates CORE2893.

@firebird-automations
Copy link
Collaborator Author

Modified by: @asfernandes

status: Open [ 1 ] => Resolved [ 5 ]

resolution: Duplicate [ 3 ]

assignee: Adriano dos Santos Fernandes [ asfernandes ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pcisar

status: Resolved [ 5 ] => Closed [ 6 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

QA Status: No test

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

status: Closed [ 6 ] => Closed [ 6 ]

QA Status: No test => Covered by another test(s)

Test Details: See test for core-2893.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment