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

Function cmp_for

src/gpre/cmp.cpp:872–991  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

870//
871
872static void cmp_for( gpre_req* request)
873{
874 request->add_byte(blr_begin);
875 if (request->req_type == REQ_cursor && request->req_sync)
876 make_receive(request->req_sync, request);
877
878 request->add_byte(blr_for);
879
880 if (request->req_flags & REQ_sql_cursor)
881 {
882 if (!request->req_rse->rse_sort && !request->req_rse->rse_reduced)
883 for (gpre_ctx* context = (gpre_ctx*) request->req_contexts; context;
884 context = context->ctx_next)
885 {
886 if (context->ctx_scope_level == request->req_scope_level && context->ctx_procedure)
887 {
888 request->add_byte(blr_stall);
889 break;
890 }
891 }
892 }
893
894 CME_rse(request->req_rse, request);
895
896 // Loop thru actions looking for primary port. While we're at it,
897 // count the number of update actions.
898
899 bool updates = false;
900
901 for (act* action = request->req_actions; action; action = action->act_next)
902 {
903 switch (action->act_type)
904 {
905 case ACT_modify:
906 case ACT_update:
907 case ACT_erase:
908 updates = true;
909 break;
910 }
911 }
912
913 if (updates)
914 request->add_byte(blr_begin);
915
916 // Build the primary send statement
917
918 gpre_port* port = request->req_primary;
919 make_send(port, request);
920
921 gpre_nod* field = MSC_node(nod_field, 1);
922 gpre_nod* value = MSC_node(nod_value, 1);
923 request->add_byte(blr_begin);
924
925 for (ref* reference = port->por_references; reference; reference = reference->ref_next)
926 {
927 CMP_check(request, 0);
928 if (reference->ref_master)
929 continue;

Callers 1

cmp_blrFunction · 0.85

Calls 9

make_receiveFunction · 0.85
make_sendFunction · 0.85
MSC_nodeFunction · 0.85
CMP_checkFunction · 0.85
CME_exprFunction · 0.85
cmp_modifyFunction · 0.85
cmp_eraseFunction · 0.85
CME_rseFunction · 0.70
add_byteMethod · 0.45

Tested by

no test coverage detected