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

Method planCheck

src/jrd/RecordSourceNodes.cpp:3391–3416  ·  view source on GitHub ↗

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.

Source from the content-addressed store, hash-verified

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.
3391void 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

Callers

nothing calls this directly

Calls 6

GdsClass · 0.85
StrClass · 0.85
ERR_postFunction · 0.70
getStreamMethod · 0.45
toStringMethod · 0.45
getNameMethod · 0.45

Tested by

no test coverage detected