| 95 | } |
| 96 | |
| 97 | void SingularStream::process(thread_db* tdbb) const |
| 98 | { |
| 99 | Request* const request = tdbb->getRequest(); |
| 100 | Impure* const impure = request->getImpure<Impure>(m_impure); |
| 101 | |
| 102 | const FB_SIZE_T streamCount = m_streams.getCount(); |
| 103 | MemoryPool& pool = *tdbb->getDefaultPool(); |
| 104 | HalfStaticArray<record_param, 16> rpbs(pool, streamCount); |
| 105 | |
| 106 | for (FB_SIZE_T i = 0; i < streamCount; i++) |
| 107 | { |
| 108 | rpbs.add(request->req_rpb[m_streams[i]]); |
| 109 | record_param& rpb = rpbs.back(); |
| 110 | Record* const orgRecord = rpb.rpb_record; |
| 111 | |
| 112 | if (orgRecord) |
| 113 | rpb.rpb_record = FB_NEW_POOL(pool) Record(pool, orgRecord); |
| 114 | } |
| 115 | |
| 116 | if (m_next->getRecord(tdbb)) |
| 117 | status_exception::raise(Arg::Gds(isc_sing_select_err)); |
| 118 | |
| 119 | for (FB_SIZE_T i = 0; i < streamCount; i++) |
| 120 | { |
| 121 | record_param& rpb = request->req_rpb[m_streams[i]]; |
| 122 | Record* orgRecord = rpb.rpb_record; |
| 123 | rpb = rpbs[i]; |
| 124 | const AutoPtr<Record> newRecord(rpb.rpb_record); |
| 125 | |
| 126 | if (newRecord) |
| 127 | { |
| 128 | if (!orgRecord) |
| 129 | BUGCHECK(284); // msg 284 cannot restore singleton select data |
| 130 | |
| 131 | rpb.rpb_record = orgRecord; |
| 132 | orgRecord->copyFrom(newRecord); |
| 133 | } |
| 134 | } |
| 135 | |
| 136 | impure->irsb_flags |= irsb_singular_processed; |
| 137 | } |
| 138 | |
| 139 | bool SingularStream::refetchRecord(thread_db* tdbb) const |
| 140 | { |
nothing calls this directly
no test coverage detected