| 96 | } |
| 97 | |
| 98 | bool Union::internalGetRecord(thread_db* tdbb) const |
| 99 | { |
| 100 | JRD_reschedule(tdbb); |
| 101 | |
| 102 | Request* const request = tdbb->getRequest(); |
| 103 | record_param* const rpb = &request->req_rpb[m_stream]; |
| 104 | Impure* const impure = request->getImpure<Impure>(m_impure); |
| 105 | |
| 106 | if (!(impure->irsb_flags & irsb_open)) |
| 107 | { |
| 108 | rpb->rpb_number.setValid(false); |
| 109 | return false; |
| 110 | } |
| 111 | |
| 112 | // March thru the sub-streams looking for a record |
| 113 | |
| 114 | while (!m_args[impure->irsb_count]->getRecord(tdbb)) |
| 115 | { |
| 116 | m_args[impure->irsb_count]->close(tdbb); |
| 117 | impure->irsb_count++; |
| 118 | if (impure->irsb_count >= m_args.getCount()) |
| 119 | { |
| 120 | rpb->rpb_number.setValid(false); |
| 121 | return false; |
| 122 | } |
| 123 | m_args[impure->irsb_count]->open(tdbb); |
| 124 | } |
| 125 | |
| 126 | // We've got a record, map it into the target record |
| 127 | |
| 128 | const MapNode* const map = m_maps[impure->irsb_count]; |
| 129 | const NestConst<ValueExprNode>* const sourceEnd = map->sourceList.end(); |
| 130 | |
| 131 | for (const NestConst<ValueExprNode>* source = map->sourceList.begin(), |
| 132 | *target = map->targetList.begin(); |
| 133 | source != sourceEnd; |
| 134 | ++source, ++target) |
| 135 | { |
| 136 | EXE_assignment(tdbb, *source, *target); |
| 137 | } |
| 138 | |
| 139 | rpb->rpb_number.setValid(true); |
| 140 | return true; |
| 141 | } |
| 142 | |
| 143 | bool Union::refetchRecord(thread_db* tdbb) const |
| 144 | { |
nothing calls this directly
no test coverage detected