Skip to content

Commit 6bdbe4c

Browse files
committed
Move alarm timers to proper location.
1 parent c2d0ebc commit 6bdbe4c

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/backend/tcop/postgres.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.274 2002/07/30 05:13:06 momjian Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.275 2002/07/30 05:35:53 momjian Exp $
1212
*
1313
* NOTES
1414
* this is the "main" module of the postgres backend and
@@ -577,6 +577,9 @@ pg_exec_query_string(StringInfo query_string, /* string to execute */
577577
start_xact_command();
578578
xact_started = true;
579579

580+
if (StatementTimeout)
581+
enable_sig_alarm(StatementTimeout, true);
582+
580583
/*
581584
* parse_context *must* be different from the execution memory
582585
* context, else the context reset at the bottom of the loop will
@@ -704,9 +707,6 @@ pg_exec_query_string(StringInfo query_string, /* string to execute */
704707
*/
705708
MemoryContextSwitchTo(oldcontext);
706709

707-
if (StatementTimeout)
708-
enable_sig_alarm(StatementTimeout, true);
709-
710710
/*
711711
* Inner loop handles the individual queries generated from a
712712
* single parsetree by analysis and rewrite.
@@ -828,8 +828,6 @@ pg_exec_query_string(StringInfo query_string, /* string to execute */
828828
}
829829
} /* end loop over queries generated from a parsetree */
830830

831-
disable_sig_alarm(true);
832-
833831
/*
834832
* If this is the last parsetree of the query string, close down
835833
* transaction statement before reporting command-complete. This is
@@ -871,6 +869,8 @@ pg_exec_query_string(StringInfo query_string, /* string to execute */
871869
EndCommand(commandTag, dest);
872870
} /* end loop over parsetrees */
873871

872+
disable_sig_alarm(true);
873+
874874
/*
875875
* Close down transaction statement, if one is open.
876876
* (Note that this will only happen if the querystring was empty.)
@@ -1693,7 +1693,7 @@ PostgresMain(int argc, char *argv[], const char *username)
16931693
if (!IsUnderPostmaster)
16941694
{
16951695
puts("\nPOSTGRES backend interactive interface ");
1696-
puts("$Revision: 1.274 $ $Date: 2002/07/30 05:13:06 $\n");
1696+
puts("$Revision: 1.275 $ $Date: 2002/07/30 05:35:53 $\n");
16971697
}
16981698

16991699
/*

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy