| 1725 | |
| 1726 | |
| 1727 | void blb::put_slice(thread_db* tdbb, |
| 1728 | jrd_tra* transaction, |
| 1729 | bid* blob_id, |
| 1730 | const UCHAR* sdl, |
| 1731 | USHORT param_length, |
| 1732 | const UCHAR* param, |
| 1733 | SLONG slice_length, |
| 1734 | UCHAR* slice_addr) |
| 1735 | { |
| 1736 | /************************************** |
| 1737 | * |
| 1738 | * b l b : : p u t _ s l i c e |
| 1739 | * |
| 1740 | ************************************** |
| 1741 | * |
| 1742 | * Functional description |
| 1743 | * Put a slice of an array. |
| 1744 | * |
| 1745 | **************************************/ |
| 1746 | transaction = transaction->getOuter(); |
| 1747 | |
| 1748 | SET_TDBB(tdbb); |
| 1749 | Jrd::ContextPoolHolder context(tdbb, transaction->tra_pool); |
| 1750 | |
| 1751 | // Do initial parse of slice description to get relation and field identification |
| 1752 | sdl_info info; |
| 1753 | if (SDL_info(tdbb->tdbb_status_vector, sdl, &info, 0)) |
| 1754 | ERR_punt(); |
| 1755 | |
| 1756 | jrd_rel* relation; |
| 1757 | if (info.sdl_info_relation.length()) { |
| 1758 | relation = MET_lookup_relation(tdbb, info.sdl_info_relation); |
| 1759 | } |
| 1760 | else { |
| 1761 | relation = MET_relation(tdbb, info.sdl_info_rid); |
| 1762 | } |
| 1763 | |
| 1764 | if (!relation) { |
| 1765 | IBERROR(196); // msg 196 relation for array not known |
| 1766 | } |
| 1767 | |
| 1768 | SSHORT n; |
| 1769 | if (info.sdl_info_field.length()) { |
| 1770 | n = MET_lookup_field(tdbb, relation, info.sdl_info_field); |
| 1771 | } |
| 1772 | else { |
| 1773 | n = info.sdl_info_fid; |
| 1774 | } |
| 1775 | |
| 1776 | // Make sure relation is scanned |
| 1777 | MET_scan_relation(tdbb, relation); |
| 1778 | |
| 1779 | jrd_fld* field = NULL; |
| 1780 | if (n < 0 || !(field = MET_get_field(relation, n))) { |
| 1781 | IBERROR(197); // msg 197 field for array not known |
| 1782 | } |
| 1783 | |
| 1784 | ArrayField* array_desc = field->fld_array; |
nothing calls this directly
no test coverage detected