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

Function gen_s_start

src/gpre/languages/pas.cpp:2691–2755  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2689//
2690
2691static void gen_s_start( const act* action, int column)
2692{
2693 const gpre_req* request = action->act_request;
2694
2695 gen_compile(action, column);
2696
2697 if (action->act_type == ACT_open)
2698 column = gen_cursor_open(action, request, column);
2699
2700 const gpre_port* port = request->req_vport;
2701 if (port)
2702 asgn_from(action, port->por_references, column);
2703
2704 if (action->act_error || (action->act_flags & ACT_sql))
2705 {
2706 make_ok_test(action, request, column);
2707 column += INDENT;
2708 begin(column);
2709 }
2710
2711 gen_start(action, port, column);
2712 set_sqlcode(action, column);
2713
2714 if (action->act_error || (action->act_flags & ACT_sql))
2715 {
2716 endp(column);
2717 column -= INDENT;
2718 }
2719
2720 if (request->req_type == REQ_insert && (request->req_flags & REQ_sql_returning))
2721 {
2722 printa(column, "if (SQLCODE = 0) ");
2723 column += INDENT;
2724 begin(column);
2725
2726 gen_receive(action, column, request->req_primary);
2727
2728 endp(column);
2729 column -= INDENT;
2730
2731 printa(column, "if (SQLCODE = 0) ");
2732 column += INDENT;
2733 begin(column);
2734
2735 gpre_nod* var_list = (gpre_nod*) action->act_object;
2736 for (int i = 0; var_list && i < var_list->nod_count; i++)
2737 {
2738 align(column);
2739 asgn_to(action, (ref*) (var_list->nod_arg[i]), column);
2740 }
2741
2742 endp(column);
2743 column -= INDENT;
2744 }
2745
2746 if (action->act_type == ACT_open)
2747 {
2748 endp(column);

Callers 4

PAS_actionFunction · 0.70
gen_forFunction · 0.70
gen_loopFunction · 0.70
gen_selectFunction · 0.70

Calls 13

endsFunction · 0.85
gen_compileFunction · 0.70
gen_cursor_openFunction · 0.70
asgn_fromFunction · 0.70
make_ok_testFunction · 0.70
beginFunction · 0.70
gen_startFunction · 0.70
set_sqlcodeFunction · 0.70
endpFunction · 0.70
printaFunction · 0.70
gen_receiveFunction · 0.70
alignFunction · 0.70

Tested by

no test coverage detected