Check that all streams in the RseNode have a plan specified for them. If they are not, there are streams in the RseNode which were not mentioned in the plan.
| 3389 | // Check that all streams in the RseNode have a plan specified for them. |
| 3390 | // If they are not, there are streams in the RseNode which were not mentioned in the plan. |
| 3391 | void RseNode::planCheck(const CompilerScratch* csb) const |
| 3392 | { |
| 3393 | // if any streams are not marked with a plan, give an error |
| 3394 | |
| 3395 | for (const auto node : rse_relations) |
| 3396 | { |
| 3397 | if (nodeIs<RelationSourceNode>(node) || nodeIs<ProcedureSourceNode>(node)) |
| 3398 | { |
| 3399 | const auto stream = node->getStream(); |
| 3400 | |
| 3401 | const auto relation = csb->csb_rpt[stream].csb_relation; |
| 3402 | const auto procedure = csb->csb_rpt[stream].csb_procedure; |
| 3403 | fb_assert(relation || procedure); |
| 3404 | |
| 3405 | if (!csb->csb_rpt[stream].csb_plan) |
| 3406 | { |
| 3407 | const auto name = relation ? relation->rel_name : |
| 3408 | procedure ? procedure->getName().toString() : ""; |
| 3409 | |
| 3410 | ERR_post(Arg::Gds(isc_no_stream_plan) << Arg::Str(name)); |
| 3411 | } |
| 3412 | } |
| 3413 | else if (const auto rse = nodeAs<RseNode>(node)) |
| 3414 | rse->planCheck(csb); |
| 3415 | } |
| 3416 | } |
| 3417 | |
| 3418 | // Go through the streams in the plan, find the corresponding streams in the RseNode and store the |
| 3419 | // plan for that stream. Do it once and only once to make sure there is a one-to-one correspondence |