8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-22 22:43:03 +01:00

Rename type/variable to reflect recent changes.

This commit is contained in:
Adriano dos Santos Fernandes 2016-09-23 13:43:41 -03:00
parent a9378178fd
commit 796a2b1eec
4 changed files with 31 additions and 31 deletions

View File

@ -6847,8 +6847,8 @@ void DsqlMapNode::genBlr(DsqlCompilerScratch* dsqlScratch)
{ {
dsqlScratch->appendUChar(blr_fid); dsqlScratch->appendUChar(blr_fid);
if (map->map_partition) if (map->map_window)
dsqlScratch->appendUChar(map->map_partition->context); dsqlScratch->appendUChar(map->map_window->context);
else else
GEN_stuff_context(dsqlScratch, context); GEN_stuff_context(dsqlScratch, context);

View File

@ -678,9 +678,9 @@ public:
dsql_ctx* visibleInContext; dsql_ctx* visibleInContext;
}; };
struct PartitionMap struct WindowMap
{ {
PartitionMap(WindowClause* aWindow) WindowMap(WindowClause* aWindow)
: partitionRemapped(NULL), : partitionRemapped(NULL),
window(aWindow), window(aWindow),
map(NULL), map(NULL),
@ -726,7 +726,7 @@ public:
DsqlContextStack ctx_childs_derived_table; // Childs derived table context DsqlContextStack ctx_childs_derived_table; // Childs derived table context
Firebird::GenericMap<Firebird::Pair<Firebird::Left< Firebird::GenericMap<Firebird::Pair<Firebird::Left<
Firebird::MetaName, ImplicitJoin*> > > ctx_imp_join; // Map of USING fieldname to ImplicitJoin Firebird::MetaName, ImplicitJoin*> > > ctx_imp_join; // Map of USING fieldname to ImplicitJoin
Firebird::Array<PartitionMap*> ctx_win_maps; // Maps for window functions Firebird::Array<WindowMap*> ctx_win_maps; // Maps for window functions
Firebird::GenericMap<NamedWindowClause> ctx_named_windows; Firebird::GenericMap<NamedWindowClause> ctx_named_windows;
dsql_ctx& operator=(dsql_ctx& v) dsql_ctx& operator=(dsql_ctx& v)
@ -762,7 +762,7 @@ public:
} }
bool getImplicitJoinField(const Firebird::MetaName& name, NestConst<ValueExprNode>& node); bool getImplicitJoinField(const Firebird::MetaName& name, NestConst<ValueExprNode>& node);
PartitionMap* getPartitionMap(DsqlCompilerScratch* dsqlScratch, WindowClause* windowNode); WindowMap* getWindowMap(DsqlCompilerScratch* dsqlScratch, WindowClause* windowNode);
}; };
// Flag values for ctx_flags // Flag values for ctx_flags
@ -784,7 +784,7 @@ public:
dsql_map* map_next; // Next map in item dsql_map* map_next; // Next map in item
NestConst<ValueExprNode> map_node; // Value for map item NestConst<ValueExprNode> map_node; // Value for map item
USHORT map_position; // Position in map USHORT map_position; // Position in map
NestConst<PartitionMap> map_partition; // Partition NestConst<WindowMap> map_window; // Partition
}; };
// Message block used in communicating with a running request // Message block used in communicating with a running request

View File

@ -2225,15 +2225,15 @@ static RseNode* pass1_rse_impl(DsqlCompilerScratch* dsqlScratch, RecordSourceNod
// Remap the nodes to the partition context // Remap the nodes to the partition context
for (FB_SIZE_T i = 0, mapCount = parent_context->ctx_win_maps.getCount(); i < mapCount; ++i) 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, windowMap->partitionRemapped = Node::doDsqlPass(dsqlScratch,
partitionMap->window->partition); windowMap->window->partition);
FieldRemapper remapper2(dsqlScratch, parent_context, true, partitionMap->window); FieldRemapper remapper2(dsqlScratch, parent_context, true, windowMap->window);
ExprNode::doDsqlFieldRemapper(remapper2, partitionMap->partitionRemapped); ExprNode::doDsqlFieldRemapper(remapper2, windowMap->partitionRemapped);
} }
} }
@ -2539,7 +2539,7 @@ static RseNode* pass1_union(DsqlCompilerScratch* dsqlScratch, UnionSourceNode* i
fb_assert(count != 0); // no wrap, please! fb_assert(count != 0); // no wrap, please!
map->map_node = *uptr++; map->map_node = *uptr++;
map->map_next = union_context->ctx_map; map->map_next = union_context->ctx_map;
map->map_partition = NULL; map->map_window = NULL;
union_context->ctx_map = map; union_context->ctx_map = map;
*ptr = FB_NEW_POOL(pool) DsqlMapNode(pool, union_context, 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(); thread_db* tdbb = JRD_get_thread_data();
PartitionMap* partitionMap = NULL; WindowMap* windowMap = NULL;
dsql_map* map = NULL; dsql_map* map = NULL;
if (dsqlScratch->processingWindow) if (dsqlScratch->processingWindow)
{ {
partitionMap = context->getPartitionMap(dsqlScratch, windowNode); windowMap = context->getWindowMap(dsqlScratch, windowNode);
map = partitionMap->map; map = windowMap->map;
} }
else else
map = context->ctx_map; map = context->ctx_map;
@ -2852,7 +2852,7 @@ DsqlMapNode* PASS1_post_map(DsqlCompilerScratch* dsqlScratch, ValueExprNode* nod
if (!map) if (!map)
{ {
dsql_map** next = partitionMap ? &partitionMap->map : &context->ctx_map; dsql_map** next = windowMap ? &windowMap->map : &context->ctx_map;
if (*next) if (*next)
{ {
@ -2863,7 +2863,7 @@ DsqlMapNode* PASS1_post_map(DsqlCompilerScratch* dsqlScratch, ValueExprNode* nod
map = *next = FB_NEW_POOL(*tdbb->getDefaultPool()) dsql_map; map = *next = FB_NEW_POOL(*tdbb->getDefaultPool()) dsql_map;
map->map_position = count; map->map_position = count;
map->map_node = node; map->map_node = node;
map->map_partition = partitionMap; map->map_window = windowMap;
} }
MAKE_desc(dsqlScratch, &node->nodDesc, node); MAKE_desc(dsqlScratch, &node->nodDesc, node);
@ -2948,8 +2948,8 @@ bool dsql_ctx::getImplicitJoinField(const MetaName& name, NestConst<ValueExprNod
return true; return true;
} }
// Returns (creating, if necessary) the PartitionMap of a given partition (that may be NULL). // Returns (creating, if necessary) the WindowMap of a given partition (that may be NULL).
PartitionMap* dsql_ctx::getPartitionMap(DsqlCompilerScratch* dsqlScratch, WindowClause* windowNode) WindowMap* dsql_ctx::getWindowMap(DsqlCompilerScratch* dsqlScratch, WindowClause* windowNode)
{ {
thread_db* tdbb = JRD_get_thread_data(); thread_db* tdbb = JRD_get_thread_data();
MemoryPool& pool = *tdbb->getDefaultPool(); MemoryPool& pool = *tdbb->getDefaultPool();
@ -2960,19 +2960,19 @@ PartitionMap* dsql_ctx::getPartitionMap(DsqlCompilerScratch* dsqlScratch, Window
if (isNullWindow) if (isNullWindow)
windowNode = &nullWindow; windowNode = &nullWindow;
PartitionMap* partitionMap = NULL; WindowMap* windowMap = NULL;
for (Array<PartitionMap*>::iterator i = ctx_win_maps.begin(); for (Array<WindowMap*>::iterator i = ctx_win_maps.begin();
!partitionMap && i != ctx_win_maps.end(); !windowMap && i != ctx_win_maps.end();
++i) ++i)
{ {
if (PASS1_node_match((*i)->window, windowNode, false)) if (PASS1_node_match((*i)->window, windowNode, false))
{ {
partitionMap = *i; windowMap = *i;
} }
} }
if (!partitionMap) if (!windowMap)
{ {
if (isNullWindow) if (isNullWindow)
{ {
@ -2980,10 +2980,10 @@ PartitionMap* dsql_ctx::getPartitionMap(DsqlCompilerScratch* dsqlScratch, Window
WindowClause::EXCLUDE_NO_OTHERS); WindowClause::EXCLUDE_NO_OTHERS);
} }
partitionMap = FB_NEW_POOL(*tdbb->getDefaultPool()) PartitionMap(windowNode); windowMap = FB_NEW_POOL(*tdbb->getDefaultPool()) WindowMap(windowNode);
ctx_win_maps.add(partitionMap); ctx_win_maps.add(windowMap);
partitionMap->context = dsqlScratch->contextNumber++; windowMap->context = dsqlScratch->contextNumber++;
} }
return partitionMap; return windowMap;
} }

View File

@ -1325,7 +1325,7 @@ void AggregateSourceNode::genBlr(DsqlCompilerScratch* dsqlScratch)
fb_assert(dsqlContext->ctx_win_maps.hasData()); fb_assert(dsqlContext->ctx_win_maps.hasData());
dsqlScratch->appendUChar(dsqlContext->ctx_win_maps.getCount()); // number of windows dsqlScratch->appendUChar(dsqlContext->ctx_win_maps.getCount()); // number of windows
for (Array<PartitionMap*>::iterator i = dsqlContext->ctx_win_maps.begin(); for (Array<WindowMap*>::iterator i = dsqlContext->ctx_win_maps.begin();
i != dsqlContext->ctx_win_maps.end(); i != dsqlContext->ctx_win_maps.end();
++i) ++i)
{ {