diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2003-06-20 21:58:02 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2003-06-20 21:58:02 +0000 |
commit | 4342e6ea18c719f8ebdb49874969396403c245c5 (patch) | |
tree | 783c7e2210f678a71409fcfe3e2cab5715b501e2 /src/backend/tcop/postgres.c | |
parent | 94b59faeb79fbd7d240f18a4de96ffb6bd53916a (diff) | |
download | postgresql-4342e6ea18c719f8ebdb49874969396403c245c5.tar.gz postgresql-4342e6ea18c719f8ebdb49874969396403c245c5.zip |
Fix for extended-query protocol: in event of error, backend was issuing
a ReadyForQuery (Z message) immediately and then another one after the
Sync message arrives. Suppress the first one to make it work per spec.
Diffstat (limited to 'src/backend/tcop/postgres.c')
-rw-r--r-- | src/backend/tcop/postgres.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgres.c index 96f3ca00e69..3ac145860b4 100644 --- a/src/backend/tcop/postgres.c +++ b/src/backend/tcop/postgres.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.347 2003/06/11 18:01:14 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.348 2003/06/20 21:58:02 tgl Exp $ * * NOTES * this is the "main" module of the postgres backend and @@ -1947,7 +1947,7 @@ PostgresMain(int argc, char *argv[], const char *username) char *tmp; int firstchar; StringInfo input_message; - bool send_rfq; + volatile bool send_rfq = true; /* * Catch standard options before doing much else. This even works on @@ -2547,7 +2547,7 @@ PostgresMain(int argc, char *argv[], const char *username) if (!IsUnderPostmaster) { puts("\nPOSTGRES backend interactive interface "); - puts("$Revision: 1.347 $ $Date: 2003/06/11 18:01:14 $\n"); + puts("$Revision: 1.348 $ $Date: 2003/06/20 21:58:02 $\n"); } /* @@ -2627,7 +2627,8 @@ PostgresMain(int argc, char *argv[], const char *username) /* * If we were handling an extended-query-protocol message, - * initiate skip till next Sync. + * initiate skip till next Sync. This also causes us not + * to issue ReadyForQuery (until we get Sync). */ if (doing_extended_query_message) ignore_till_sync = true; @@ -2642,7 +2643,8 @@ PostgresMain(int argc, char *argv[], const char *username) PG_SETMASK(&UnBlockSig); - send_rfq = true; /* initially, or after error */ + if (!ignore_till_sync) + send_rfq = true; /* initially, or after error */ /* * Non-error queries loop here. |