| 978 | }; |
| 979 | |
| 980 | void Rtr::setupInlineBlob(P_INLINE_BLOB* p_blob) |
| 981 | { |
| 982 | fb_assert(p_blob->p_tran_id == this->rtr_id); |
| 983 | fb_assert(rtr_inline_blob); |
| 984 | |
| 985 | Rbl* blb = rtr_inline_blob; |
| 986 | rtr_inline_blob = nullptr; |
| 987 | |
| 988 | fb_assert(blb->rbl_data.getCount() <= MAX_INLINE_BLOB_SIZE); |
| 989 | fb_assert(blb->rbl_data.getCount() <= MAX_USHORT); |
| 990 | |
| 991 | blb->rbl_buffer_length = MIN(MAX_USHORT, blb->rbl_data.getCapacity()); |
| 992 | const ULONG cachedSize = blb->getCachedSize(); |
| 993 | if (!rtr_rdb->incBlobCache(cachedSize)) |
| 994 | { |
| 995 | delete blb; |
| 996 | return; |
| 997 | } |
| 998 | |
| 999 | blb->rbl_blob_id = p_blob->p_blob_id; |
| 1000 | if (Rbl* old = rtr_blobs.locate(blb->rbl_blob_id)) |
| 1001 | { |
| 1002 | // Blob with the same blob id already exists. It could be in use, or it |
| 1003 | // could be opened by user explicitly with custom BPB - thus delete new one. |
| 1004 | |
| 1005 | fb_assert(blb != old); |
| 1006 | delete blb; |
| 1007 | |
| 1008 | rtr_rdb->decBlobCache(cachedSize); |
| 1009 | return; |
| 1010 | } |
| 1011 | else |
| 1012 | rtr_blobs.add(blb); |
| 1013 | |
| 1014 | blb->rbl_info.parseInfo(p_blob->p_blob_info.cstr_length, p_blob->p_blob_info.cstr_address); |
| 1015 | |
| 1016 | blb->rbl_length = blb->rbl_data.getCount(); |
| 1017 | blb->rbl_ptr = blb->rbl_buffer = blb->rbl_data.begin(); |
| 1018 | blb->rbl_flags |= Rbl::EOF_PENDING; |
| 1019 | } |
| 1020 | |
| 1021 | void Rsr::saveException(const Exception& ex, bool overwrite) |
| 1022 | { |
no test coverage detected