| 230 | } |
| 231 | |
| 232 | bool 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 | |
| 271 | bool Cursor::fetchPrior(thread_db* tdbb) const |
| 272 | { |
no test coverage detected