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

Method internalGetRecord

src/jrd/recsrc/Union.cpp:98–141  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

96}
97
98bool Union::internalGetRecord(thread_db* tdbb) const
99{
100 JRD_reschedule(tdbb);
101
102 Request* const request = tdbb->getRequest();
103 record_param* const rpb = &request->req_rpb[m_stream];
104 Impure* const impure = request->getImpure<Impure>(m_impure);
105
106 if (!(impure->irsb_flags & irsb_open))
107 {
108 rpb->rpb_number.setValid(false);
109 return false;
110 }
111
112 // March thru the sub-streams looking for a record
113
114 while (!m_args[impure->irsb_count]->getRecord(tdbb))
115 {
116 m_args[impure->irsb_count]->close(tdbb);
117 impure->irsb_count++;
118 if (impure->irsb_count >= m_args.getCount())
119 {
120 rpb->rpb_number.setValid(false);
121 return false;
122 }
123 m_args[impure->irsb_count]->open(tdbb);
124 }
125
126 // We've got a record, map it into the target record
127
128 const MapNode* const map = m_maps[impure->irsb_count];
129 const NestConst<ValueExprNode>* const sourceEnd = map->sourceList.end();
130
131 for (const NestConst<ValueExprNode>* source = map->sourceList.begin(),
132 *target = map->targetList.begin();
133 source != sourceEnd;
134 ++source, ++target)
135 {
136 EXE_assignment(tdbb, *source, *target);
137 }
138
139 rpb->rpb_number.setValid(true);
140 return true;
141}
142
143bool Union::refetchRecord(thread_db* tdbb) const
144{

Callers

nothing calls this directly

Calls 10

JRD_rescheduleFunction · 0.85
EXE_assignmentFunction · 0.85
setValidMethod · 0.80
getRequestMethod · 0.45
getRecordMethod · 0.45
closeMethod · 0.45
getCountMethod · 0.45
openMethod · 0.45
endMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected