MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / getWindowMap

Method getWindowMap

src/dsql/pass1.cpp:3017–3054  ·  view source on GitHub ↗

Returns (creating, if necessary) the WindowMap of a given partition (that may be NULL).

Source from the content-addressed store, hash-verified

3015
3016// Returns (creating, if necessary) the WindowMap of a given partition (that may be NULL).
3017WindowMap* dsql_ctx::getWindowMap(DsqlCompilerScratch* dsqlScratch, WindowClause* windowNode)
3018{
3019 thread_db* tdbb = JRD_get_thread_data();
3020 MemoryPool& pool = *tdbb->getDefaultPool();
3021
3022 bool isNullWindow = windowNode == NULL;
3023 WindowClause nullWindow(pool, NULL, NULL, NULL, NULL, WindowClause::Exclusion::NO_OTHERS);
3024
3025 if (isNullWindow)
3026 windowNode = &nullWindow;
3027
3028 WindowMap* windowMap = NULL;
3029
3030 for (Array<WindowMap*>::iterator i = ctx_win_maps.begin();
3031 !windowMap && i != ctx_win_maps.end();
3032 ++i)
3033 {
3034 if (PASS1_node_match(dsqlScratch, (*i)->window, windowNode, false))
3035 {
3036 windowMap = *i;
3037 }
3038 }
3039
3040 if (!windowMap)
3041 {
3042 if (isNullWindow)
3043 {
3044 windowNode = FB_NEW_POOL(pool) WindowClause(pool, NULL, NULL, NULL, NULL,
3045 WindowClause::Exclusion::NO_OTHERS);
3046 }
3047
3048 windowMap = FB_NEW_POOL(*tdbb->getDefaultPool()) WindowMap(windowNode);
3049 ctx_win_maps.add(windowMap);
3050 windowMap->context = dsqlScratch->contextNumber++;
3051 }
3052
3053 return windowMap;
3054}

Callers 1

PASS1_post_mapFunction · 0.80

Calls 8

JRD_get_thread_dataFunction · 0.85
PASS1_node_matchFunction · 0.85
WindowMapClass · 0.85
WindowClauseClass · 0.70
getDefaultPoolMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected