MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / batch_exec

Method batch_exec

src/remote/server/server.cpp:3736–3785  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3734
3735
3736void 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
3788void rem_port::batch_rls(P_BATCH_FREE_CANCEL* batch, PACKET* sendL)

Callers 1

process_packetFunction · 0.80

Calls 10

send_responseMethod · 0.95
sendMethod · 0.95
checkIfaceMethod · 0.80
checkBatchMethod · 0.80
checkFunction · 0.50
executeMethod · 0.45
getStateMethod · 0.45
getSizeMethod · 0.45
findErrorMethod · 0.45
getStatusMethod · 0.45

Tested by

no test coverage detected