| 2752 | |
| 2753 | |
| 2754 | JBlob* JAttachment::createBlob(CheckStatusWrapper* user_status, ITransaction* tra, ISC_QUAD* blob_id, |
| 2755 | unsigned int bpb_length, const unsigned char* bpb) |
| 2756 | { |
| 2757 | /************************************** |
| 2758 | * |
| 2759 | * g d s _ $ c r e a t e _ b l o b |
| 2760 | * |
| 2761 | ************************************** |
| 2762 | * |
| 2763 | * Functional description |
| 2764 | * Create a new blob. |
| 2765 | * |
| 2766 | **************************************/ |
| 2767 | blb* blob = NULL; |
| 2768 | |
| 2769 | try |
| 2770 | { |
| 2771 | JTransaction* const jt = getTransactionInterface(user_status, tra); |
| 2772 | EngineContextHolder tdbb(user_status, this, FB_FUNCTION); |
| 2773 | |
| 2774 | jrd_tra* transaction = jt->getHandle(); |
| 2775 | validateHandle(tdbb, transaction); |
| 2776 | check_database(tdbb); |
| 2777 | |
| 2778 | try |
| 2779 | { |
| 2780 | blob = blb::create2(tdbb, transaction, reinterpret_cast<bid*>(blob_id), bpb_length, bpb, true); |
| 2781 | } |
| 2782 | catch (const Exception& ex) |
| 2783 | { |
| 2784 | transliterateException(tdbb, ex, user_status, "JAttachment::createBlob"); |
| 2785 | return NULL; |
| 2786 | } |
| 2787 | } |
| 2788 | catch (const Exception& ex) |
| 2789 | { |
| 2790 | ex.stuffException(user_status); |
| 2791 | return NULL; |
| 2792 | } |
| 2793 | |
| 2794 | successful_completion(user_status); |
| 2795 | |
| 2796 | JBlob* jb = FB_NEW JBlob(blob, getStable()); |
| 2797 | jb->addRef(); |
| 2798 | blob->blb_interface = jb; |
| 2799 | return jb; |
| 2800 | } |
| 2801 | |
| 2802 | |
| 2803 | JAttachment* JProvider::createDatabase(CheckStatusWrapper* user_status, const char* filename, |
no test coverage detected