Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 4342e6e

Browse files
committed
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.
1 parent 94b59fa commit 4342e6e

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/backend/tcop/postgres.c

Lines changed: 7 additions & 5 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.347 2003/06/11 18:01:14 momjian Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.348 2003/06/20 21:58:02 tgl Exp $
1212
*
1313
* NOTES
1414
* this is the "main" module of the postgres backend and
@@ -1947,7 +1947,7 @@ PostgresMain(int argc, char *argv[], const char *username)
19471947
char *tmp;
19481948
int firstchar;
19491949
StringInfo input_message;
1950-
bool send_rfq;
1950+
volatile bool send_rfq = true;
19511951

19521952
/*
19531953
* Catch standard options before doing much else. This even works on
@@ -2547,7 +2547,7 @@ PostgresMain(int argc, char *argv[], const char *username)
25472547
if (!IsUnderPostmaster)
25482548
{
25492549
puts("\nPOSTGRES backend interactive interface ");
2550-
puts("$Revision: 1.347 $ $Date: 2003/06/11 18:01:14 $\n");
2550+
puts("$Revision: 1.348 $ $Date: 2003/06/20 21:58:02 $\n");
25512551
}
25522552

25532553
/*
@@ -2627,7 +2627,8 @@ PostgresMain(int argc, char *argv[], const char *username)
26272627

26282628
/*
26292629
* If we were handling an extended-query-protocol message,
2630-
* initiate skip till next Sync.
2630+
* initiate skip till next Sync. This also causes us not
2631+
* to issue ReadyForQuery (until we get Sync).
26312632
*/
26322633
if (doing_extended_query_message)
26332634
ignore_till_sync = true;
@@ -2642,7 +2643,8 @@ PostgresMain(int argc, char *argv[], const char *username)
26422643

26432644
PG_SETMASK(&UnBlockSig);
26442645

2645-
send_rfq = true; /* initially, or after error */
2646+
if (!ignore_till_sync)
2647+
send_rfq = true; /* initially, or after error */
26462648

26472649
/*
26482650
* Non-error queries loop here.

0 commit comments

Comments
 (0)