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

AV when sorting by field, calculated using recursive CTE [CORE1839] #2268

Closed
firebird-automations opened this issue Apr 16, 2008 · 6 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: @AlexPeshkoff

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.

Commits: 1b3d63e 75ea573 f0a837e FirebirdSQL/fbt-repository@43becf3

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

Added data with diactitic marks.

@firebird-automations
Copy link
Collaborator Author

Modified by: @AlexPeshkoff

assignee: Alexander Peshkov [ alexpeshkoff ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

summary: AV when sorting by field, calculated using resursive CTE => AV when sorting by field, calculated using recursive CTE

@firebird-automations
Copy link
Collaborator Author

Commented by: @AlexPeshkoff

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.

@firebird-automations
Copy link
Collaborator Author

Modified by: @AlexPeshkoff

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

resolution: Fixed [ 1 ]

Fix Version: 2.5 Alpha 1 [ 10224 ]

Fix Version: 2.1.1 [ 10223 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pcisar

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: Added data with diactitic marks.

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