Skip to content

Commit

Permalink
Fix another (related to CORE-1246 and CORE-2339) issue with derived e…
Browse files Browse the repository at this point in the history
…xpressions, reported by Dmitry:

select
 *
from
(select
  coalesce(sum(r1.RDB$RELATION_ID), 0) as RDB$RELATION_ID
from
  (select *
  from
  rdb$database ) r1 ) r2

wrongly returns NULL
  • Loading branch information
asfernandes committed Mar 13, 2009
1 parent 3057006 commit f32516e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/dsql/pass1.cpp
Expand Up @@ -10113,7 +10113,13 @@ static void remap_streams_to_parent_context( dsql_nod* input, dsql_ctx* parent_c
break;

case nod_derived_table:
// nothing to do here.
{
dsql_nod* list = input->nod_arg[e_derived_table_rse]->nod_arg[e_rse_streams];
dsql_nod** ptr = list->nod_arg;

for (const dsql_nod* const* const end = ptr + list->nod_count; ptr < end; ptr++)
remap_streams_to_parent_context(*ptr, parent_context);
}
break;

default:
Expand Down

0 comments on commit f32516e

Please sign in to comment.