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

Method internalOpen

src/jrd/recsrc/ProcedureScan.cpp:58–147  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

56}
57
58void ProcedureScan::internalOpen(thread_db* tdbb) const
59{
60 if (!m_procedure->isImplemented())
61 {
62 status_exception::raise(
63 Arg::Gds(isc_proc_pack_not_implemented) <<
64 Arg::Str(m_procedure->getName().identifier) << Arg::Str(m_procedure->getName().package));
65 }
66 else if (!m_procedure->isDefined())
67 {
68 status_exception::raise(
69 Arg::Gds(isc_prcnotdef) << Arg::Str(m_procedure->getName().toString()) <<
70 Arg::Gds(isc_modnotfound));
71 }
72
73 const_cast<jrd_prc*>(m_procedure)->checkReload(tdbb);
74
75 // Procedure could be altered and its record format changed since current instance of
76 // ProcedureScan was created. Here it is not the right place to check if new format is
77 // compatible with caller's expectations, so we just use correct (possible new) format.
78
79 m_format = m_procedure->prc_record_format;
80
81 Request* const request = tdbb->getRequest();
82 Impure* const impure = request->getImpure<Impure>(m_impure);
83
84 impure->irsb_flags = irsb_open;
85
86 record_param* const rpb = &request->req_rpb[m_stream];
87 rpb->getWindow(tdbb).win_flags = 0;
88
89 // get rid of any lingering record
90
91 delete rpb->rpb_record;
92 rpb->rpb_record = NULL;
93
94 ULONG iml;
95 const UCHAR* im;
96
97 if (m_sourceList)
98 {
99 iml = m_message->format->fmt_length;
100 im = request->getImpure<UCHAR>(m_message->impureOffset);
101
102 const NestConst<ValueExprNode>* const sourceEnd = m_sourceList->items.end();
103 const NestConst<ValueExprNode>* sourcePtr = m_sourceList->items.begin();
104 const NestConst<ValueExprNode>* targetPtr = m_targetList->items.begin();
105
106 for (; sourcePtr != sourceEnd; ++sourcePtr, ++targetPtr)
107 EXE_assignment(tdbb, *sourcePtr, *targetPtr);
108 }
109 else
110 {
111 iml = 0;
112 im = NULL;
113 }
114
115 Request* const proc_request = m_procedure->getStatement()->findRequest(tdbb);

Callers

nothing calls this directly

Calls 15

raiseFunction · 0.85
GdsClass · 0.85
StrClass · 0.85
EXE_assignmentFunction · 0.85
EXE_startFunction · 0.85
EXE_sendFunction · 0.85
isImplementedMethod · 0.80
isDefinedMethod · 0.80
checkReloadMethod · 0.80
findRequestMethod · 0.80
getNameMethod · 0.45
toStringMethod · 0.45

Tested by

no test coverage detected