| 3314 | |
| 3315 | |
| 3316 | ISC_STATUS rem_port::end_statement(P_SQLFREE* free_stmt, PACKET* sendL) |
| 3317 | { |
| 3318 | /***************************************** |
| 3319 | * |
| 3320 | * e n d _ s t a t e m e n t |
| 3321 | * |
| 3322 | ***************************************** |
| 3323 | * |
| 3324 | * Functional description |
| 3325 | * Free a statement. |
| 3326 | * |
| 3327 | *****************************************/ |
| 3328 | Rsr* statement; |
| 3329 | LocalStatus ls; |
| 3330 | CheckStatusWrapper status_vector(&ls); |
| 3331 | |
| 3332 | getHandle(statement, free_stmt->p_sqlfree_statement); |
| 3333 | |
| 3334 | if (free_stmt->p_sqlfree_option & (DSQL_drop | DSQL_unprepare | DSQL_close)) |
| 3335 | { |
| 3336 | if (statement->rsr_batch) |
| 3337 | { |
| 3338 | statement->rsr_batch->release(); |
| 3339 | statement->rsr_batch = NULL; |
| 3340 | } |
| 3341 | else if (statement->rsr_cursor) |
| 3342 | { |
| 3343 | statement->rsr_cursor->close(&status_vector); |
| 3344 | if (status_vector.getState() & IStatus::STATE_ERRORS) |
| 3345 | { |
| 3346 | return this->send_response(sendL, 0, 0, &status_vector, true); |
| 3347 | } |
| 3348 | statement->rsr_cursor = NULL; |
| 3349 | fb_assert(statement->rsr_rtr); |
| 3350 | FB_SIZE_T pos; |
| 3351 | if (!statement->rsr_rtr->rtr_cursors.find(statement, pos)) |
| 3352 | fb_assert(false); |
| 3353 | statement->rsr_rtr->rtr_cursors.remove(pos); |
| 3354 | } |
| 3355 | else if (!(free_stmt->p_sqlfree_option & (DSQL_drop | DSQL_unprepare))) |
| 3356 | { |
| 3357 | Arg::Gds(isc_dsql_cursor_close_err).copyTo(&status_vector); |
| 3358 | return this->send_response(sendL, 0, 0, &status_vector, true); |
| 3359 | } |
| 3360 | } |
| 3361 | |
| 3362 | if (free_stmt->p_sqlfree_option & (DSQL_drop | DSQL_unprepare)) |
| 3363 | { |
| 3364 | if (statement->rsr_iface) |
| 3365 | { |
| 3366 | statement->rsr_iface->free(&status_vector); |
| 3367 | if (status_vector.getState() & IStatus::STATE_ERRORS) |
| 3368 | { |
| 3369 | return this->send_response(sendL, 0, 0, &status_vector, true); |
| 3370 | } |
| 3371 | statement->rsr_iface = NULL; |
| 3372 | } |
| 3373 | } |
no test coverage detected