Issue Details (XML | Word | Printable)

Key: CORE-1244
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Adriano dos Santos Fernandes
Reporter: Yakov Hrebtov
Votes: 0
Watchers: 1
Operations

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

Server crash on select * from <recursive CTE>

Created: 04/May/07 01:27 PM   Updated: 26/Jul/07 12:40 PM
Component/s: Engine
Affects Version/s: 2.1 Alpha 1
Fix Version/s: 2.1 Beta 1

Time Tracking:
Not Specified

Environment: LI-T2.1.0.15707 CS
Issue Links:
Relate
 


 Description  « Hide
Simple select from recursive CTE crashes the server when query uses asterisk.

with recursive
    Art_Tree as (
        select A.ArticleID
          from Articles A
         where A.ParentID is NULL

        union all

        select A.ArticleID
          from Articles A
               join Art_Tree T on (A.ParentID=T.ArticleID)
    )
select *
  from Art_Tree


 All   Comments   Work Log   Change History   Version Control   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Vlad Khorsun added a comment - 04/May/07 04:26 PM
It is broken in 1.316 version of dsql\pass1.cpp

AV source is in pass1_expand_select_node at line 4860 :

if (!hide_using ||
context->getImplicitJoinField(reinterpret_cast<dsql_str*>(
select_item->nod_arg[e_derived_field_name])->str_data, select_item))
{
stack.push(select_item);
}

here we have NULL context

Adriano, could you look at it ?

Adriano dos Santos Fernandes added a comment - 04/May/07 10:38 PM
Quick (but correct) fix without look yet why the derived table is without the context.

(Pavel: note the bug was not really with Alpha1 or Beta1, but with snapshot between two versions.)

Philippe Makowski added a comment - 26/Jul/07 12:40 PM
Q/A tested ok