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

Method parse

src/jrd/RecordSourceNodes.cpp:614–651  ·  view source on GitHub ↗

Parse a local table reference.

Source from the content-addressed store, hash-verified

612
613// Parse a local table reference.
614LocalTableSourceNode* LocalTableSourceNode::parse(thread_db* tdbb, CompilerScratch* csb,
615 const SSHORT blrOp, bool parseContext)
616{
617 const USHORT tableNumber = csb->csb_blr_reader.getWord();
618
619 if (tableNumber >= csb->csb_localTables.getCount())
620 PAR_error(csb, Arg::Gds(isc_bad_loctab_num) << Arg::Num(tableNumber));
621
622 // Make a relation reference node
623
624 const auto node = FB_NEW_POOL(*tdbb->getDefaultPool()) LocalTableSourceNode(
625 *tdbb->getDefaultPool());
626
627 node->tableNumber = tableNumber;
628
629 AutoPtr<string> aliasString(FB_NEW_POOL(csb->csb_pool) string(csb->csb_pool));
630 csb->csb_blr_reader.getString(*aliasString);
631
632 if (aliasString->hasData())
633 node->alias = *aliasString;
634 else
635 aliasString.reset();
636
637 // generate a stream for the relation reference, assuming it is a real reference
638
639 if (parseContext)
640 {
641 node->stream = PAR_context(csb, &node->context);
642
643 if (tableNumber >= csb->csb_localTables.getCount() || !csb->csb_localTables[tableNumber])
644 PAR_error(csb, Arg::Gds(isc_bad_loctab_num) << Arg::Num(tableNumber));
645
646 csb->csb_rpt[node->stream].csb_format = csb->csb_localTables[tableNumber]->format;
647 csb->csb_rpt[node->stream].csb_alias = aliasString.release();
648 }
649
650 return node;
651}
652
653string LocalTableSourceNode::internalPrint(NodePrinter& printer) const
654{

Callers 1

JStatementMethod · 0.45

Calls 15

GdsClass · 0.85
NumClass · 0.85
PAR_contextFunction · 0.85
SET_TDBBFunction · 0.85
StrClass · 0.85
PAR_dependencyFunction · 0.85
PAR_warningFunction · 0.85
WarningClass · 0.85
ProcedureSourceNodeClass · 0.85
PAR_procedure_parmsFunction · 0.85
AggregateSourceNodeClass · 0.85

Tested by

no test coverage detected