| 363 | |
| 364 | |
| 365 | PlanNode* PlanNode::dsqlPass(DsqlCompilerScratch* dsqlScratch) |
| 366 | { |
| 367 | MemoryPool& pool = dsqlScratch->getPool(); |
| 368 | |
| 369 | PlanNode* node = FB_NEW_POOL(pool) PlanNode(pool, type); |
| 370 | |
| 371 | if (accessType) |
| 372 | { |
| 373 | node->accessType = FB_NEW_POOL(pool) AccessType(pool, accessType->type); |
| 374 | node->accessType->items = accessType->items; |
| 375 | } |
| 376 | |
| 377 | node->recordSourceNode = recordSourceNode; |
| 378 | |
| 379 | for (NestConst<PlanNode>* i = subNodes.begin(); i != subNodes.end(); ++i) |
| 380 | node->subNodes.add((*i)->dsqlPass(dsqlScratch)); |
| 381 | |
| 382 | if (dsqlNames) |
| 383 | { |
| 384 | node->dsqlNames = FB_NEW_POOL(pool) ObjectsArray<MetaName>(pool); |
| 385 | *node->dsqlNames = *dsqlNames; |
| 386 | |
| 387 | dsql_ctx* context = dsqlPassAliasList(dsqlScratch); |
| 388 | |
| 389 | if (context->ctx_relation) |
| 390 | { |
| 391 | RelationSourceNode* relNode = FB_NEW_POOL(pool) RelationSourceNode(pool); |
| 392 | relNode->dsqlContext = context; |
| 393 | node->recordSourceNode = relNode; |
| 394 | } |
| 395 | else if (context->ctx_procedure) |
| 396 | { |
| 397 | ProcedureSourceNode* procNode = FB_NEW_POOL(pool) ProcedureSourceNode(pool); |
| 398 | procNode->dsqlContext = context; |
| 399 | node->recordSourceNode = procNode; |
| 400 | } |
| 401 | //// TODO: LocalTableSourceNode |
| 402 | |
| 403 | // ASF: I think it's a error to let node->recordSourceNode be NULL here, but it happens |
| 404 | // at least since v2.5. See gen.cpp/gen_plan for more information. |
| 405 | ///fb_assert(node->recordSourceNode); |
| 406 | } |
| 407 | |
| 408 | if (node->recordSourceNode) |
| 409 | node->recordSourceNode->dsqlFlags |= RecordSourceNode::DFLAG_PLAN_ITEM; |
| 410 | |
| 411 | return node; |
| 412 | } |
| 413 | |
| 414 | // The passed alias list fully specifies a relation. The first alias represents a relation |
| 415 | // specified in the from list at this scope levels. Subsequent contexts, if there are any, |
nothing calls this directly
no test coverage detected