diff --git a/src/dsql/ExprNodes.cpp b/src/dsql/ExprNodes.cpp index baa6be4f81..055c688338 100644 --- a/src/dsql/ExprNodes.cpp +++ b/src/dsql/ExprNodes.cpp @@ -6847,8 +6847,8 @@ void DsqlMapNode::genBlr(DsqlCompilerScratch* dsqlScratch) { dsqlScratch->appendUChar(blr_fid); - if (map->map_partition) - dsqlScratch->appendUChar(map->map_partition->context); + if (map->map_window) + dsqlScratch->appendUChar(map->map_window->context); else GEN_stuff_context(dsqlScratch, context); diff --git a/src/dsql/dsql.h b/src/dsql/dsql.h index c4e1683318..32efb16b42 100644 --- a/src/dsql/dsql.h +++ b/src/dsql/dsql.h @@ -678,9 +678,9 @@ public: dsql_ctx* visibleInContext; }; -struct PartitionMap +struct WindowMap { - PartitionMap(WindowClause* aWindow) + WindowMap(WindowClause* aWindow) : partitionRemapped(NULL), window(aWindow), map(NULL), @@ -726,7 +726,7 @@ public: DsqlContextStack ctx_childs_derived_table; // Childs derived table context Firebird::GenericMap > > ctx_imp_join; // Map of USING fieldname to ImplicitJoin - Firebird::Array ctx_win_maps; // Maps for window functions + Firebird::Array ctx_win_maps; // Maps for window functions Firebird::GenericMap ctx_named_windows; dsql_ctx& operator=(dsql_ctx& v) @@ -762,7 +762,7 @@ public: } bool getImplicitJoinField(const Firebird::MetaName& name, NestConst& node); - PartitionMap* getPartitionMap(DsqlCompilerScratch* dsqlScratch, WindowClause* windowNode); + WindowMap* getWindowMap(DsqlCompilerScratch* dsqlScratch, WindowClause* windowNode); }; // Flag values for ctx_flags @@ -784,7 +784,7 @@ public: dsql_map* map_next; // Next map in item NestConst map_node; // Value for map item USHORT map_position; // Position in map - NestConst map_partition; // Partition + NestConst map_window; // Partition }; // Message block used in communicating with a running request diff --git a/src/dsql/pass1.cpp b/src/dsql/pass1.cpp index 7cb4b36563..c067d8760a 100644 --- a/src/dsql/pass1.cpp +++ b/src/dsql/pass1.cpp @@ -2225,15 +2225,15 @@ static RseNode* pass1_rse_impl(DsqlCompilerScratch* dsqlScratch, RecordSourceNod // Remap the nodes to the partition context for (FB_SIZE_T i = 0, mapCount = parent_context->ctx_win_maps.getCount(); i < mapCount; ++i) { - PartitionMap* partitionMap = parent_context->ctx_win_maps[i]; + WindowMap* windowMap = parent_context->ctx_win_maps[i]; - if (partitionMap->window && partitionMap->window->partition) + if (windowMap->window && windowMap->window->partition) { - partitionMap->partitionRemapped = Node::doDsqlPass(dsqlScratch, - partitionMap->window->partition); + windowMap->partitionRemapped = Node::doDsqlPass(dsqlScratch, + windowMap->window->partition); - FieldRemapper remapper2(dsqlScratch, parent_context, true, partitionMap->window); - ExprNode::doDsqlFieldRemapper(remapper2, partitionMap->partitionRemapped); + FieldRemapper remapper2(dsqlScratch, parent_context, true, windowMap->window); + ExprNode::doDsqlFieldRemapper(remapper2, windowMap->partitionRemapped); } } @@ -2539,7 +2539,7 @@ static RseNode* pass1_union(DsqlCompilerScratch* dsqlScratch, UnionSourceNode* i fb_assert(count != 0); // no wrap, please! map->map_node = *uptr++; map->map_next = union_context->ctx_map; - map->map_partition = NULL; + map->map_window = NULL; union_context->ctx_map = map; *ptr = FB_NEW_POOL(pool) DsqlMapNode(pool, union_context, map); @@ -2828,13 +2828,13 @@ DsqlMapNode* PASS1_post_map(DsqlCompilerScratch* dsqlScratch, ValueExprNode* nod thread_db* tdbb = JRD_get_thread_data(); - PartitionMap* partitionMap = NULL; + WindowMap* windowMap = NULL; dsql_map* map = NULL; if (dsqlScratch->processingWindow) { - partitionMap = context->getPartitionMap(dsqlScratch, windowNode); - map = partitionMap->map; + windowMap = context->getWindowMap(dsqlScratch, windowNode); + map = windowMap->map; } else map = context->ctx_map; @@ -2852,7 +2852,7 @@ DsqlMapNode* PASS1_post_map(DsqlCompilerScratch* dsqlScratch, ValueExprNode* nod if (!map) { - dsql_map** next = partitionMap ? &partitionMap->map : &context->ctx_map; + dsql_map** next = windowMap ? &windowMap->map : &context->ctx_map; if (*next) { @@ -2863,7 +2863,7 @@ DsqlMapNode* PASS1_post_map(DsqlCompilerScratch* dsqlScratch, ValueExprNode* nod map = *next = FB_NEW_POOL(*tdbb->getDefaultPool()) dsql_map; map->map_position = count; map->map_node = node; - map->map_partition = partitionMap; + map->map_window = windowMap; } MAKE_desc(dsqlScratch, &node->nodDesc, node); @@ -2948,8 +2948,8 @@ bool dsql_ctx::getImplicitJoinField(const MetaName& name, NestConstgetDefaultPool(); @@ -2960,19 +2960,19 @@ PartitionMap* dsql_ctx::getPartitionMap(DsqlCompilerScratch* dsqlScratch, Window if (isNullWindow) windowNode = &nullWindow; - PartitionMap* partitionMap = NULL; + WindowMap* windowMap = NULL; - for (Array::iterator i = ctx_win_maps.begin(); - !partitionMap && i != ctx_win_maps.end(); + for (Array::iterator i = ctx_win_maps.begin(); + !windowMap && i != ctx_win_maps.end(); ++i) { if (PASS1_node_match((*i)->window, windowNode, false)) { - partitionMap = *i; + windowMap = *i; } } - if (!partitionMap) + if (!windowMap) { if (isNullWindow) { @@ -2980,10 +2980,10 @@ PartitionMap* dsql_ctx::getPartitionMap(DsqlCompilerScratch* dsqlScratch, Window WindowClause::EXCLUDE_NO_OTHERS); } - partitionMap = FB_NEW_POOL(*tdbb->getDefaultPool()) PartitionMap(windowNode); - ctx_win_maps.add(partitionMap); - partitionMap->context = dsqlScratch->contextNumber++; + windowMap = FB_NEW_POOL(*tdbb->getDefaultPool()) WindowMap(windowNode); + ctx_win_maps.add(windowMap); + windowMap->context = dsqlScratch->contextNumber++; } - return partitionMap; + return windowMap; } diff --git a/src/jrd/RecordSourceNodes.cpp b/src/jrd/RecordSourceNodes.cpp index 88fc22e5ed..20505d5420 100644 --- a/src/jrd/RecordSourceNodes.cpp +++ b/src/jrd/RecordSourceNodes.cpp @@ -1325,7 +1325,7 @@ void AggregateSourceNode::genBlr(DsqlCompilerScratch* dsqlScratch) fb_assert(dsqlContext->ctx_win_maps.hasData()); dsqlScratch->appendUChar(dsqlContext->ctx_win_maps.getCount()); // number of windows - for (Array::iterator i = dsqlContext->ctx_win_maps.begin(); + for (Array::iterator i = dsqlContext->ctx_win_maps.begin(); i != dsqlContext->ctx_win_maps.end(); ++i) {