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

Function gen_s_start

src/gpre/c_cxx.cpp:3041–3103  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3039//
3040
3041static void gen_s_start( const act* action, int column)
3042{
3043 gpre_req* request = action->act_request;
3044
3045 gen_compile(action, column);
3046
3047 gpre_port* port = request->req_vport;
3048 if (port)
3049 asgn_from(action, port->por_references, column);
3050
3051 if (action->act_type == ACT_open)
3052 column = gen_cursor_open(action, request, column);
3053
3054 if (action->act_error || (action->act_flags & ACT_sql))
3055 {
3056 make_ok_test(action, request, column);
3057 column += INDENT;
3058 begin(column);
3059 }
3060
3061 gen_start(action, port, column, false);
3062 set_sqlcode(action, column);
3063
3064 if (action->act_error || (action->act_flags & ACT_sql))
3065 {
3066 endp(column);
3067 column -= INDENT;
3068 }
3069
3070 if (request->req_type == REQ_insert && (request->req_flags & REQ_sql_returning))
3071 {
3072 printa(column, "if (!SQLCODE) ");
3073 column += INDENT;
3074 begin(column);
3075
3076 gen_receive(action, column, request->req_primary);
3077
3078 endp(column);
3079 column -= INDENT;
3080
3081 printa(column, "if (!SQLCODE) ");
3082 column += INDENT;
3083 begin(column);
3084
3085 gpre_nod* var_list = (gpre_nod*) action->act_object;
3086 for (int i = 0; var_list && i < var_list->nod_count; i++)
3087 {
3088 align(column);
3089 asgn_to(action, (ref*) (var_list->nod_arg[i]), column);
3090 }
3091
3092 endp(column);
3093 column -= INDENT;
3094 }
3095
3096 if (action->act_type == ACT_open)
3097 {
3098 endp(column);

Callers 5

C_CXX_actionFunction · 0.70
gen_forFunction · 0.70
gen_functionFunction · 0.70
gen_loopFunction · 0.70
gen_selectFunction · 0.70

Calls 12

gen_compileFunction · 0.70
asgn_fromFunction · 0.70
gen_cursor_openFunction · 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
asgn_toFunction · 0.70

Tested by

no test coverage detected