Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions src/gpre/obj_cxx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2293,7 +2293,10 @@ static void gen_for( const act* action, int column)
const gpre_req* request = action->act_request;

if (action->act_error || (action->act_flags & ACT_sql))
success(column, true, global_status_name, " {");
{
printa(column, "if (%s && !(%s->getState() & Firebird::IStatus::STATE_ERRORS)) {",
request->req_handle, global_status_name);
}

printa(column, "while (1)");
column += INDENT;
Expand Down Expand Up @@ -3075,11 +3078,10 @@ static void gen_s_start( const act* action, int column)
if (action->act_error || (action->act_flags & ACT_sql))
{
make_ok_test(action, request, column);
printa(column, "{");
column += INDENT;
}
gen_start(action, port, column, false);
if (action->act_error || (action->act_flags & ACT_sql))
column -= INDENT;

const TEXT* pattern1 = "if (%V1->getErrors()[1] == isc_bad_req_handle) { %RH->release(); %RH = NULL; }";
PAT args;
Expand All @@ -3088,6 +3090,12 @@ static void gen_s_start( const act* action, int column)
PATTERN_expand((USHORT) column, pattern1, &args);
printa(column, "else break;");

if (action->act_error || (action->act_flags & ACT_sql))
{
column -= INDENT;
printa(column, "}");
}

if (action->act_type == ACT_open)
{
endp(column);
Expand Down
Loading