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

Method fetchRecord

src/jrd/recsrc/MergeJoin.cpp:505–532  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

503}
504
505bool MergeJoin::fetchRecord(thread_db* tdbb, FB_SIZE_T index) const
506{
507 Request* const request = tdbb->getRequest();
508 Impure* const impure = request->getImpure<Impure>(m_impure);
509 Impure::irsb_mrg_repeat* tail = &impure->irsb_mrg_rpt[index];
510
511 const SSHORT m = tail->irsb_mrg_order;
512 tail = &impure->irsb_mrg_rpt[m];
513 const SortedStream* const sort_rsb = m_args[m];
514
515 SLONG record = tail->irsb_mrg_equal_current;
516 ++record;
517
518 if (record > tail->irsb_mrg_equal_end)
519 {
520 if (index == 0 || !fetchRecord(tdbb, index - 1))
521 return false;
522
523 record = tail->irsb_mrg_equal;
524 }
525
526 tail->irsb_mrg_equal_current = record;
527
528 MergeFile* const mfb = &tail->irsb_mrg_file;
529 sort_rsb->mapData(tdbb, request, getData(tdbb, mfb, record));
530
531 return true;
532}

Callers

nothing calls this directly

Calls 2

mapDataMethod · 0.80
getRequestMethod · 0.45

Tested by

no test coverage detected