From 0822c657d81436afe92478c69ff9728ff3a83dd1 Mon Sep 17 00:00:00 2001 From: alexpeshkoff Date: Tue, 19 Aug 2014 09:53:42 +0000 Subject: [PATCH] Fixed CORE-4506: Firebird server crashes when execute most of "show ..." commands after reconnect --- src/gpre/obj_cxx.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/gpre/obj_cxx.cpp b/src/gpre/obj_cxx.cpp index a07652d998..8ecde40cea 100644 --- a/src/gpre/obj_cxx.cpp +++ b/src/gpre/obj_cxx.cpp @@ -3024,6 +3024,9 @@ static void gen_s_start( const act* action, int column) { gpre_req* request = action->act_request; + printa(column, "for (int retries = 0; retries < 2; ++retries)"); + column += INDENT; + begin(column); gen_compile(action, column); gpre_port* port = request->req_vport; @@ -3038,12 +3041,17 @@ static void gen_s_start( const act* action, int column) make_ok_test(action, request, 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->get()[1] == isc_bad_req_handle) %RH = NULL;"; + PAT args; + args.pat_request = action->act_request; + args.pat_vector1 = status_vector(action); + PATTERN_expand((USHORT) column, pattern1, &args); + printa(column, "else break;"); + if (action->act_type == ACT_open) { endp(column); @@ -3052,6 +3060,8 @@ static void gen_s_start( const act* action, int column) column -= INDENT; } + endp(column); + column -= INDENT; set_sqlcode(action, column); }