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

Wrong results for CASE used together with GROUP BY [CORE2584] #2994

Closed
firebird-automations opened this issue Aug 5, 2009 · 15 comments
Closed

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: @dyemanov

Is related to CORE501
Is related to CORE1343
Is related to CORE2041
Is related to CORE2051
Is related to QA411

Test case:

select
rdb$field_position as a,
case rdb$field_position when 0 then '0'
when 1 then '1'
when 2 then '2'
when 3 then '3'
when 4 then '4' end as b,
count(*) as cnt
from rdb$relation_fields
where rdb$field_position < 5
group by 1, 2

Commits: 88495f2

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

Changed code to make it independent of system tables content.

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

assignee: Adriano dos Santos Fernandes [ asfernandes ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

Version: 2.5 Beta 2 [ 10300 ]

Version: 2.5 Beta 1 [ 10251 ] =>

@firebird-automations
Copy link
Collaborator Author

Commented by: Claudio Valderrama C. (robocop)

What a funny output:

  A B               CNT

======= ====== ============
0 0 43
1 2 42
2 3 41
3 4 38
4 4 29

@firebird-automations
Copy link
Collaborator Author

Commented by: @dyemanov

This is a regression introduced after Alpha 1, probably related to other bugfixes in the grouping area happened that time.

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

Version: 2.5 Beta 1 [ 10251 ]

@firebird-automations
Copy link
Collaborator Author

Commented by: @asfernandes

Not difficult to imagine, as when this problem is happening I need to manually start finding the old related bugs, and manually run/interpret results of before/after changes. A better exercice than extend fbtcs or even run (never did that) the qm*thing.

@firebird-automations
Copy link
Collaborator Author

Commented by: @asfernandes

The bug is caused by the line in pass1.cpp with this comment:
// we do not want to reprocess last parameter later

Reason for this change is in CORE501 attached test and will be investigated.

@firebird-automations
Copy link
Collaborator Author

Modified by: @asfernandes

Link: This issue is related to CORE501 [ CORE501 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @asfernandes

Link: This issue is related to CORE1343 [ CORE1343 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @asfernandes

Link: This issue is related to CORE2041 [ CORE2041 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @asfernandes

Link: This issue is related to CORE2051 [ CORE2051 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @asfernandes

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

resolution: Fixed [ 1 ]

Fix Version: 2.5 RC1 [ 10362 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pcisar

Link: This issue is related to QA411 [ QA411 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pmakowski

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

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

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

QA Status: Done successfully

Test Details: Changed code to make it independent of system tables content.

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