Issue Details (XML | Word | Printable)

Key: CORE-2584
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Adriano dos Santos Fernandes
Reporter: Dmitry Yemanov
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Firebird Core

Wrong results for CASE used together with GROUP BY

Created: 05/Aug/09 06:17 AM   Updated: 05/Aug/09 08:12 PM
Return to search
Component/s: Engine
Affects Version/s: 2.5 Beta 1, 2.5 Beta 2
Fix Version/s: 2.5 RC1

Time Tracking:
Not Specified

Issue Links:
Relate
 

Planning Status: Unspecified


 Description  « Hide
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


 All   Comments   Work Log   Change History   Version Control      Sort Order: Ascending order - Click to sort in descending order
Dmitry Yemanov made changes - 05/Aug/09 06:19 AM
Field Original Value New Value
Assignee Adriano dos Santos Fernandes [ asfernandes ]
Dmitry Yemanov made changes - 05/Aug/09 06:22 AM
Affects Version/s 2.5 Beta 2 [ 10300 ]
Affects Version/s  2.5 Beta 1 [ 10251 ]
Claudio Valderrama C. added a comment - 05/Aug/09 06:45 AM
What a funny output:

      A B CNT
======= ====== ============
      0 0 43
      1 2 42
      2 3 41
      3 4 38
      4 4 29

Dmitry Yemanov added a comment - 05/Aug/09 06:58 AM
This is a regression introduced after Alpha 1, probably related to other bugfixes in the grouping area happened that time.

Dmitry Yemanov made changes - 05/Aug/09 06:58 AM
Affects Version/s  2.5 Beta 1 [ 10251 ]
Adriano dos Santos Fernandes added a comment - 05/Aug/09 07:05 AM
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.

Adriano dos Santos Fernandes added a comment - 05/Aug/09 09:34 AM
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 CORE-501 attached test and will be investigated.

Adriano dos Santos Fernandes made changes - 05/Aug/09 09:35 AM
Link This issue is related to CORE-501 [ CORE-501 ]
Adriano dos Santos Fernandes made changes - 05/Aug/09 09:35 AM
Link This issue is related to CORE-1343 [ CORE-1343 ]
Adriano dos Santos Fernandes made changes - 05/Aug/09 09:35 AM
Link This issue is related to CORE-2041 [ CORE-2041 ]
Adriano dos Santos Fernandes made changes - 05/Aug/09 09:35 AM
Link This issue is related to CORE-2051 [ CORE-2051 ]
Adriano dos Santos Fernandes made changes - 05/Aug/09 08:12 PM
Fix Version/s 2.5 RC1 [ 10362 ]
Resolution Fixed [ 1 ]
Status Open [ 1 ] Resolved [ 5 ]