| 179 | } |
| 180 | |
| 181 | void BlobUtilPackage::readDataFunction(ThrowStatusExceptionWrapper* status, |
| 182 | IExternalContext* context, const ReadDataInput::Type* in, BinaryMessage::Type* out) |
| 183 | { |
| 184 | if (!in->lengthNull && in->length <= 0) |
| 185 | status_exception::raise(Arg::Gds(isc_random) << "Length must be NULL or greater than 0"); |
| 186 | |
| 187 | const auto tdbb = JRD_get_thread_data(); |
| 188 | const auto transaction = tdbb->getTransaction(); |
| 189 | const auto blob = getBlobFromHandle(tdbb, in->handle); |
| 190 | |
| 191 | if (in->lengthNull) |
| 192 | out->data.length = blob->BLB_get_segment(tdbb, (UCHAR*) out->data.str, sizeof(out->data.str)); |
| 193 | else |
| 194 | { |
| 195 | out->data.length = blob->BLB_get_data(tdbb, (UCHAR*) out->data.str, |
| 196 | MIN(in->length, sizeof(out->data.str)), false); |
| 197 | } |
| 198 | |
| 199 | out->dataNull = out->data.length == 0 && (blob->blb_flags & BLB_eof) ? FB_TRUE : FB_FALSE; |
| 200 | } |
| 201 | |
| 202 | //-------------------------------------- |
| 203 |
nothing calls this directly
no test coverage detected