|
8 | 8 | * |
9 | 9 | * |
10 | 10 | * 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 $ |
12 | 12 | * |
13 | 13 | * NOTES |
14 | 14 | * this is the "main" module of the postgres backend and |
@@ -577,6 +577,9 @@ pg_exec_query_string(StringInfo query_string, /* string to execute */ |
577 | 577 | start_xact_command(); |
578 | 578 | xact_started = true; |
579 | 579 |
|
| 580 | + if (StatementTimeout) |
| 581 | + enable_sig_alarm(StatementTimeout, true); |
| 582 | + |
580 | 583 | /* |
581 | 584 | * parse_context *must* be different from the execution memory |
582 | 585 | * 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 */ |
704 | 707 | */ |
705 | 708 | MemoryContextSwitchTo(oldcontext); |
706 | 709 |
|
707 | | - if (StatementTimeout) |
708 | | - enable_sig_alarm(StatementTimeout, true); |
709 | | - |
710 | 710 | /* |
711 | 711 | * Inner loop handles the individual queries generated from a |
712 | 712 | * single parsetree by analysis and rewrite. |
@@ -828,8 +828,6 @@ pg_exec_query_string(StringInfo query_string, /* string to execute */ |
828 | 828 | } |
829 | 829 | } /* end loop over queries generated from a parsetree */ |
830 | 830 |
|
831 | | - disable_sig_alarm(true); |
832 | | - |
833 | 831 | /* |
834 | 832 | * If this is the last parsetree of the query string, close down |
835 | 833 | * transaction statement before reporting command-complete. This is |
@@ -871,6 +869,8 @@ pg_exec_query_string(StringInfo query_string, /* string to execute */ |
871 | 869 | EndCommand(commandTag, dest); |
872 | 870 | } /* end loop over parsetrees */ |
873 | 871 |
|
| 872 | + disable_sig_alarm(true); |
| 873 | + |
874 | 874 | /* |
875 | 875 | * Close down transaction statement, if one is open. |
876 | 876 | * (Note that this will only happen if the querystring was empty.) |
@@ -1693,7 +1693,7 @@ PostgresMain(int argc, char *argv[], const char *username) |
1693 | 1693 | if (!IsUnderPostmaster) |
1694 | 1694 | { |
1695 | 1695 | 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"); |
1697 | 1697 | } |
1698 | 1698 |
|
1699 | 1699 | /* |
|
0 commit comments