| 3827 | |
| 3828 | |
| 3829 | ResultSet* Statement::openCursor(CheckStatusWrapper* status, ITransaction* apiTra, |
| 3830 | IMessageMetadata* inMetadata, void* inBuffer, IMessageMetadata* outFormat, unsigned int flags) |
| 3831 | { |
| 3832 | /************************************** |
| 3833 | * |
| 3834 | * d s q l _ e x e c u t e 2 |
| 3835 | * |
| 3836 | ************************************** |
| 3837 | * |
| 3838 | * Functional description |
| 3839 | * Execute a non-SELECT dynamic SQL statement. |
| 3840 | * |
| 3841 | **************************************/ |
| 3842 | |
| 3843 | try |
| 3844 | { |
| 3845 | reset(status); |
| 3846 | |
| 3847 | // Check and validate handles, etc. |
| 3848 | |
| 3849 | CHECK_HANDLE(statement, isc_bad_req_handle); |
| 3850 | |
| 3851 | Rdb* rdb = statement->rsr_rdb; |
| 3852 | CHECK_HANDLE(rdb, isc_bad_db_handle); |
| 3853 | |
| 3854 | rem_port* port = rdb->rdb_port; |
| 3855 | |
| 3856 | BlrFromMessage inBlr(inMetadata, dialect, port->port_protocol); |
| 3857 | const unsigned int in_blr_length = inBlr.getLength(); |
| 3858 | const UCHAR* const in_blr = inBlr.getBytes(); |
| 3859 | const unsigned int in_msg_length = inBlr.getMsgLength(); |
| 3860 | UCHAR* const in_msg = static_cast<UCHAR*>(inBuffer); |
| 3861 | |
| 3862 | RefPtr<IMessageMetadata> defaultOutputFormat; |
| 3863 | if (!outFormat) |
| 3864 | { |
| 3865 | defaultOutputFormat.assignRefNoIncr(this->getOutputMetadata(status)); |
| 3866 | if (status->getState() & IStatus::STATE_ERRORS) |
| 3867 | { |
| 3868 | return NULL; |
| 3869 | } |
| 3870 | if (defaultOutputFormat) |
| 3871 | { |
| 3872 | outFormat = defaultOutputFormat; |
| 3873 | } |
| 3874 | } |
| 3875 | |
| 3876 | BlrFromMessage outBlr((outFormat == DELAYED_OUT_FORMAT ? NULL : outFormat), dialect, port->port_protocol); |
| 3877 | const unsigned int out_blr_length = outBlr.getLength(); |
| 3878 | const UCHAR* const out_blr = outBlr.getBytes(); |
| 3879 | |
| 3880 | // Validate data length |
| 3881 | |
| 3882 | CHECK_LENGTH(port, in_blr_length); |
| 3883 | CHECK_LENGTH(port, in_msg_length); |
| 3884 | CHECK_LENGTH(port, out_blr_length); |
| 3885 | |
| 3886 | RefMutexGuard portGuard(*port->port_sync, FB_FUNCTION); |
no test coverage detected