Make statement_timeout apply to entire query string, not per statement.
This commit is contained in:
parent
a89fc4e6de
commit
b6440a7ece
@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.273 2002/07/29 22:14:11 tgl Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.274 2002/07/30 05:13:06 momjian Exp $
|
||||
*
|
||||
* NOTES
|
||||
* this is the "main" module of the postgres backend and
|
||||
@ -704,6 +704,9 @@ pg_exec_query_string(StringInfo query_string, /* string to execute */
|
||||
*/
|
||||
MemoryContextSwitchTo(oldcontext);
|
||||
|
||||
if (StatementTimeout)
|
||||
enable_sig_alarm(StatementTimeout, true);
|
||||
|
||||
/*
|
||||
* Inner loop handles the individual queries generated from a
|
||||
* single parsetree by analysis and rewrite.
|
||||
@ -719,9 +722,6 @@ pg_exec_query_string(StringInfo query_string, /* string to execute */
|
||||
xact_started = true;
|
||||
}
|
||||
|
||||
if (StatementTimeout)
|
||||
enable_sig_alarm(StatementTimeout, true);
|
||||
|
||||
/*
|
||||
* If we got a cancel signal in analysis or prior command,
|
||||
* quit
|
||||
@ -796,8 +796,6 @@ pg_exec_query_string(StringInfo query_string, /* string to execute */
|
||||
ShowUsage("EXECUTOR STATISTICS");
|
||||
}
|
||||
|
||||
disable_sig_alarm(true);
|
||||
|
||||
/*
|
||||
* In a query block, we want to increment the command counter
|
||||
* between queries so that the effects of early queries are
|
||||
@ -830,6 +828,8 @@ pg_exec_query_string(StringInfo query_string, /* string to execute */
|
||||
}
|
||||
} /* end loop over queries generated from a parsetree */
|
||||
|
||||
disable_sig_alarm(true);
|
||||
|
||||
/*
|
||||
* If this is the last parsetree of the query string, close down
|
||||
* transaction statement before reporting command-complete. This is
|
||||
@ -1693,7 +1693,7 @@ PostgresMain(int argc, char *argv[], const char *username)
|
||||
if (!IsUnderPostmaster)
|
||||
{
|
||||
puts("\nPOSTGRES backend interactive interface ");
|
||||
puts("$Revision: 1.273 $ $Date: 2002/07/29 22:14:11 $\n");
|
||||
puts("$Revision: 1.274 $ $Date: 2002/07/30 05:13:06 $\n");
|
||||
}
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user