Skip to content

Commit 3620569

Browse files
committed
#ifdef out some dead code in psql/mainloop.c.
This pg_send_history() call is unreachable, since the block it's in is currently only entered in !cur_cmd_interactive mode. But rather than just delete it, make it #ifdef NOT_USED, in hopes that we'll remember to enable it if we ever change that decision. Per report from David Binderman. Since this is basically cosmetic, I see no great need to back-patch. Discussion: https://postgr.es/m/HE1PR0802MB233122B61F00A15E035C83BE9C710@HE1PR0802MB2331.eurprd08.prod.outlook.com
1 parent a5736bf commit 3620569

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/bin/psql/mainloop.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -456,14 +456,19 @@ MainLoop(FILE *source)
456456
} /* while !endoffile/session */
457457

458458
/*
459-
* Process query at the end of file without a semicolon
459+
* If we have a non-semicolon-terminated query at the end of file, we
460+
* process it unless the input source is interactive --- in that case it
461+
* seems better to go ahead and quit. Also skip if this is an error exit.
460462
*/
461463
if (query_buf->len > 0 && !pset.cur_cmd_interactive &&
462464
successResult == EXIT_SUCCESS)
463465
{
464466
/* save query in history */
467+
/* currently unneeded since we don't use this block if interactive */
468+
#ifdef NOT_USED
465469
if (pset.cur_cmd_interactive)
466470
pg_send_history(history_buf);
471+
#endif
467472

468473
/* execute query unless we're in an inactive \if branch */
469474
if (conditional_active(cond_stack))

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy