From 9eadb6c35511ff0f279234f5393e77ce3bb7b60c Mon Sep 17 00:00:00 2001 From: asfernandes Date: Tue, 19 Jan 2010 18:26:28 +0000 Subject: [PATCH] Move the code to below thanks to Dmitry review. This allow us to save a context number. --- src/dsql/pass1.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/dsql/pass1.cpp b/src/dsql/pass1.cpp index 0bf3254021..121de2d718 100644 --- a/src/dsql/pass1.cpp +++ b/src/dsql/pass1.cpp @@ -8015,17 +8015,6 @@ static dsql_nod* pass1_rse_impl( DsqlCompilerScratch* dsqlScratch, dsql_nod* inp } parent_context = FB_NEW(*tdbb->getDefaultPool()) dsql_ctx(*tdbb->getDefaultPool()); - - // Here we shouldn't have any window mapping. - size_t mapCount = parent_context->ctx_maps.getCount(); - fb_assert(mapCount <= 1); - - // If we have a map, copy it context number to ctx_context. If we haven't, generate it here. - if (mapCount == 1) - parent_context->ctx_context = parent_context->ctx_maps[0]->context; - else - parent_context->ctx_context = dsqlScratch->contextNumber++; - parent_context->ctx_scope_level = dsqlScratch->scopeLevel; // When we're in a outer-join part mark context for it. @@ -8214,6 +8203,17 @@ static dsql_nod* pass1_rse_impl( DsqlCompilerScratch* dsqlScratch, dsql_nod* inp #endif } rse = parent_rse; + + // Here we shouldn't have any window mapping. + size_t mapCount = parent_context->ctx_maps.getCount(); + fb_assert(mapCount <= 1); + + // If we have a map, copy it context number to ctx_context. If we haven't, generate it here. + // This is important for GEN/stuff_context. + if (mapCount == 1) + parent_context->ctx_context = parent_context->ctx_maps[0]->context; + else + parent_context->ctx_context = dsqlScratch->contextNumber++; } bool sortWindow = rse->nod_arg[e_rse_sort] &&