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

Method process

src/jrd/recsrc/SingularStream.cpp:97–137  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

95}
96
97void SingularStream::process(thread_db* tdbb) const
98{
99 Request* const request = tdbb->getRequest();
100 Impure* const impure = request->getImpure<Impure>(m_impure);
101
102 const FB_SIZE_T streamCount = m_streams.getCount();
103 MemoryPool& pool = *tdbb->getDefaultPool();
104 HalfStaticArray<record_param, 16> rpbs(pool, streamCount);
105
106 for (FB_SIZE_T i = 0; i < streamCount; i++)
107 {
108 rpbs.add(request->req_rpb[m_streams[i]]);
109 record_param& rpb = rpbs.back();
110 Record* const orgRecord = rpb.rpb_record;
111
112 if (orgRecord)
113 rpb.rpb_record = FB_NEW_POOL(pool) Record(pool, orgRecord);
114 }
115
116 if (m_next->getRecord(tdbb))
117 status_exception::raise(Arg::Gds(isc_sing_select_err));
118
119 for (FB_SIZE_T i = 0; i < streamCount; i++)
120 {
121 record_param& rpb = request->req_rpb[m_streams[i]];
122 Record* orgRecord = rpb.rpb_record;
123 rpb = rpbs[i];
124 const AutoPtr<Record> newRecord(rpb.rpb_record);
125
126 if (newRecord)
127 {
128 if (!orgRecord)
129 BUGCHECK(284); // msg 284 cannot restore singleton select data
130
131 rpb.rpb_record = orgRecord;
132 orgRecord->copyFrom(newRecord);
133 }
134 }
135
136 impure->irsb_flags |= irsb_singular_processed;
137}
138
139bool SingularStream::refetchRecord(thread_db* tdbb) const
140{

Callers

nothing calls this directly

Calls 10

raiseFunction · 0.85
GdsClass · 0.85
RecordClass · 0.50
getRequestMethod · 0.45
getCountMethod · 0.45
getDefaultPoolMethod · 0.45
addMethod · 0.45
backMethod · 0.45
getRecordMethod · 0.45
copyFromMethod · 0.45

Tested by

no test coverage detected