From 2a2f6cfa3983e6834299857c80bc07d32d1e019a Mon Sep 17 00:00:00 2001
From: Tom Lane <tgl@sss.pgh.pa.us>
Date: Wed, 14 May 2003 18:40:37 +0000
Subject: [PATCH] Fix oversight: ignore-till-SYNC state should not ignore EOF
 ...

---
 src/backend/tcop/postgres.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgres.c
index f30662d1ea7..f0292799b8d 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.344 2003/05/14 03:26:01 tgl Exp $
+ *	  $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.345 2003/05/14 18:40:37 tgl Exp $
  *
  * NOTES
  *	  this is the "main" module of the postgres backend and
@@ -309,6 +309,7 @@ SocketBackend(StringInfo inBuf)
 
 		case 'X':				/* terminate */
 			doing_extended_query_message = false;
+			ignore_till_sync = false;
 			break;
 
 		case 'B':				/* bind */
@@ -2525,7 +2526,7 @@ PostgresMain(int argc, char *argv[], const char *username)
 	if (!IsUnderPostmaster)
 	{
 		puts("\nPOSTGRES backend interactive interface ");
-		puts("$Revision: 1.344 $ $Date: 2003/05/14 03:26:01 $\n");
+		puts("$Revision: 1.345 $ $Date: 2003/05/14 18:40:37 $\n");
 	}
 
 	/*
@@ -2714,7 +2715,7 @@ PostgresMain(int argc, char *argv[], const char *username)
 		/*
 		 * (6) process the command.  But ignore it if we're skipping till Sync.
 		 */
-		if (ignore_till_sync)
+		if (ignore_till_sync && firstchar != EOF)
 			continue;
 
 		switch (firstchar)
-- 
GitLab