diff options
Diffstat (limited to 'src/backend/tcop/postgres.c')
-rw-r--r-- | src/backend/tcop/postgres.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgres.c index bd07b2a2398..e30197c2f16 100644 --- a/src/backend/tcop/postgres.c +++ b/src/backend/tcop/postgres.c @@ -3753,11 +3753,11 @@ PostgresMain(int argc, char *argv[], const char *dbname, const char *username) { - int firstchar; - StringInfoData input_message; sigjmp_buf local_sigjmp_buf; + + /* these must be volatile to ensure state is preserved across longjmp: */ volatile bool send_ready_for_query = true; - bool disable_idle_in_transaction_timeout = false; + volatile bool disable_idle_in_transaction_timeout = false; /* Initialize startup process environment if necessary. */ if (!IsUnderPostmaster) @@ -4042,9 +4042,10 @@ PostgresMain(int argc, char *argv[], * query cancels from being misreported as timeouts in case we're * forgetting a timeout cancel. */ - disable_all_timeouts(false); - QueryCancelPending = false; /* second to avoid race condition */ + disable_all_timeouts(false); /* do first to avoid race condition */ + QueryCancelPending = false; stmt_timeout_active = false; + disable_idle_in_transaction_timeout = false; /* Not reading from the client anymore. */ DoingCommandRead = false; @@ -4133,6 +4134,9 @@ PostgresMain(int argc, char *argv[], for (;;) { + int firstchar; + StringInfoData input_message; + /* * At top of loop, reset extended-query-message flag, so that any * errors encountered in "idle" state don't provoke skip. |