| 3734 | |
| 3735 | |
| 3736 | void rem_port::batch_exec(P_BATCH_EXEC* batch, PACKET* sendL) |
| 3737 | { |
| 3738 | LocalStatus ls; |
| 3739 | CheckStatusWrapper status_vector(&ls); |
| 3740 | |
| 3741 | Rsr* statement; |
| 3742 | getHandle(statement, batch->p_batch_statement); |
| 3743 | statement->checkIface(); |
| 3744 | statement->checkBatch(); |
| 3745 | |
| 3746 | Rtr* transaction = NULL; |
| 3747 | getHandle(transaction, batch->p_batch_transaction); |
| 3748 | |
| 3749 | AutoPtr<IBatchCompletionState, SimpleDispose> |
| 3750 | ics(statement->rsr_batch->execute(&status_vector, transaction->rtr_iface)); |
| 3751 | |
| 3752 | if (status_vector.getState() & IStatus::STATE_ERRORS) |
| 3753 | { |
| 3754 | this->send_response(sendL, 0, 0, &status_vector, false); |
| 3755 | return; |
| 3756 | } |
| 3757 | |
| 3758 | bool recordCounts = statement->rsr_batch_flags & (1 << IBatch::TAG_RECORD_COUNTS); |
| 3759 | P_BATCH_CS* pcs = &sendL->p_batch_cs; |
| 3760 | sendL->p_operation = op_batch_cs; |
| 3761 | pcs->p_batch_statement = statement->rsr_id; |
| 3762 | pcs->p_batch_reccount = ics->getSize(&status_vector); |
| 3763 | check(&status_vector); |
| 3764 | pcs->p_batch_updates = recordCounts ? pcs->p_batch_reccount : 0; |
| 3765 | pcs->p_batch_errors = pcs->p_batch_vectors = 0; |
| 3766 | |
| 3767 | for (unsigned int pos = 0u; |
| 3768 | (pos = ics->findError(&status_vector, pos)) != IBatchCompletionState::NO_MORE_ERRORS; |
| 3769 | ++pos) |
| 3770 | { |
| 3771 | check(&status_vector); |
| 3772 | |
| 3773 | LocalStatus dummy; |
| 3774 | ics->getStatus(&status_vector, &dummy, pos); |
| 3775 | if (status_vector.getState() & IStatus::STATE_ERRORS) |
| 3776 | pcs->p_batch_errors++; |
| 3777 | else |
| 3778 | pcs->p_batch_vectors++; |
| 3779 | } |
| 3780 | |
| 3781 | check(&status_vector); |
| 3782 | |
| 3783 | statement->rsr_batch_ics = ics; |
| 3784 | this->send(sendL); |
| 3785 | } |
| 3786 | |
| 3787 | |
| 3788 | void rem_port::batch_rls(P_BATCH_FREE_CANCEL* batch, PACKET* sendL) |
no test coverage detected