Issue Details (XML | Word | Printable)

Key: CORE-1839
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Alexander Peshkov
Reporter: Alexander Peshkov
Votes: 0
Watchers: 0
Operations

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

AV when sorting by field, calculated using recursive CTE

Created: 16/Apr/08 08:10 AM   Updated: 18/Nov/08 12:23 PM
Component/s: None
Affects Version/s: 2.5 Initial, 2.1 RC2
Fix Version/s: 2.5 Alpha 1, 2.1.1

Time Tracking:
Not Specified

Environment: Any

Planning Status: Unspecified


 Description  « Hide
When the following field

FULLCAPTION Computed by: ((
 with recursive
  Hospitals_Recursive as (
   Select H.HospitalID, H.HospitalParentID, H.Caption,
    1 as ChildLevel
   From Hospitals H
   Where H.HospitalID = Hospitals.HospitalID

   union all

   Select H.HospitalID, H.HospitalParentID, H.Caption,
    Hr.ChildLevel + 1 as ChildLevel
   From Hospitals_Recursive HR inner join Hospitals H
    on HR.HospitalParentID = H.HospitalID
  ),
  Hospitals_List as (
   Select Caption
   From Hospitals_Recursive
   Order by ChildLevel desc
  )
 Select list(Caption, ', ')
 From Hospitals_List
))

is used in a query:

select HospitalID, FullCaption From Hospitals
Order by cast(FullCaption as varchar(32765));

access violation happens.

 All   Comments   Work Log   Change History   Version Control   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Alexander Peshkov added a comment - 16/Apr/08 08:29 AM
Bug happened only when table, used in CTE, contained records with different formats. Record, stored in rpb on stack, becomes invalid when format changes. New actual record should be always used instead.