Used by DPM_store_blob
| 2991 | |
| 2992 | // Used by DPM_store_blob |
| 2993 | void blb::storeToPage(USHORT* length, Firebird::Array<UCHAR>& buffer, const UCHAR** data, void* stack) |
| 2994 | { |
| 2995 | if (blb_level == 0) |
| 2996 | { |
| 2997 | *length = blb_clump_size - blb_space_remaining; |
| 2998 | |
| 2999 | if (!hasBuffer()) |
| 3000 | { |
| 3001 | if (blb_temp_size > 0) |
| 3002 | { |
| 3003 | blb_transaction->getBlobSpace()->read( |
| 3004 | blb_temp_offset, buffer.getBuffer(blb_temp_size), blb_temp_size); |
| 3005 | *data = buffer.begin(); |
| 3006 | } |
| 3007 | else |
| 3008 | { |
| 3009 | fb_assert(*length == 0); |
| 3010 | *data = NULL; |
| 3011 | } |
| 3012 | } |
| 3013 | else |
| 3014 | *data = getBuffer(); |
| 3015 | |
| 3016 | if (*data) |
| 3017 | *data = (UCHAR*) ((blob_page*) *data)->blp_page; |
| 3018 | } |
| 3019 | else |
| 3020 | { |
| 3021 | // CVC: Sorry, but I couldn't use PageStack in blb.h without bringing several headers, |
| 3022 | // so I resorted to void* for the param declaration. |
| 3023 | PageStack& stack2 = *static_cast<PageStack*>(stack); |
| 3024 | *length = static_cast<USHORT>(blb_pages->count() * sizeof(ULONG)); |
| 3025 | *data = (UCHAR*) blb_pages->begin(); |
| 3026 | |
| 3027 | // Figure out precedence pages, if any |
| 3028 | // hvlad: no need to maintain precedence for temporary data |
| 3029 | if (!PageSpace::isTemporary(blb_pg_space_id)) |
| 3030 | { |
| 3031 | vcl::const_iterator ptr, end; |
| 3032 | for (ptr = blb_pages->begin(), end = blb_pages->end(); ptr < end; ++ptr) |
| 3033 | { |
| 3034 | stack2.push(PageNumber(blb_pg_space_id, *ptr)); |
| 3035 | } |
| 3036 | } |
| 3037 | } |
| 3038 | } |
| 3039 | |
| 3040 | void blb::BLB_cancel() |
| 3041 | { |
nothing calls this directly
no test coverage detected