| 120 | } |
| 121 | |
| 122 | bool RelTableScanState::scanNext(Transaction* transaction) { |
| 123 | while (true) { |
| 124 | switch (source) { |
| 125 | case TableScanSource::COMMITTED: { |
| 126 | const auto scanResult = nodeGroup->scan(transaction, *this); |
| 127 | if (scanResult == NODE_GROUP_SCAN_EMPTY_RESULT) { |
| 128 | if (hasUnCommittedData()) { |
| 129 | initStateForUncommitted(); |
| 130 | } else { |
| 131 | source = TableScanSource::NONE; |
| 132 | } |
| 133 | continue; |
| 134 | } |
| 135 | return true; |
| 136 | } |
| 137 | case TableScanSource::UNCOMMITTED: { |
| 138 | DASSERT(localTableScanState && localTableScanState->localRelTable); |
| 139 | return localTableScanState->localRelTable->scan(transaction, *this); |
| 140 | } |
| 141 | case TableScanSource::NONE: { |
| 142 | return false; |
| 143 | } |
| 144 | default: { |
| 145 | UNREACHABLE_CODE; |
| 146 | } |
| 147 | } |
| 148 | } |
| 149 | } |
| 150 | |
| 151 | void RelTableScanState::setNodeIDVectorToFlat(sel_t selPos) const { |
| 152 | nodeIDVector->state->setToFlat(); |
no test coverage detected