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

Method fetchNext

src/jrd/recsrc/Cursor.cpp:232–269  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

230}
231
232bool Cursor::fetchNext(thread_db* tdbb) const
233{
234 if (m_rse->isScrollable())
235 return fetchRelative(tdbb, 1);
236
237 if (!validate(tdbb))
238 return false;
239
240 const auto request = tdbb->getRequest();
241 Impure* const impure = request->getImpure<Impure>(m_impure);
242
243 if (!impure->irsb_active)
244 {
245 // error: invalid cursor state
246 status_exception::raise(Arg::Gds(isc_cursor_not_open));
247 }
248
249 if (impure->irsb_state == EOS)
250 return false;
251
252 ProfilerSelectStopWatcher profilerSelectStopWatcher(tdbb, this,
253 ProfilerManager::RecordSourceStopWatcher::Event::GET_RECORD);
254
255 if (!m_root->getRecord(tdbb))
256 {
257 impure->irsb_state = EOS;
258 return false;
259 }
260
261 if (m_updateCounters)
262 {
263 request->req_records_selected++;
264 request->req_records_affected.bumpFetched();
265 }
266
267 impure->irsb_state = POSITIONED;
268 return true;
269}
270
271bool Cursor::fetchPrior(thread_db* tdbb) const
272{

Callers 1

doFetchMethod · 0.45

Calls 7

raiseFunction · 0.85
GdsClass · 0.85
isScrollableMethod · 0.80
bumpFetchedMethod · 0.80
validateFunction · 0.70
getRequestMethod · 0.45
getRecordMethod · 0.45

Tested by

no test coverage detected