Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit3620569

Browse files
committed
#ifdef out some dead code in psql/mainloop.c.
This pg_send_history() call is unreachable, since the block it's inis currently only entered in !cur_cmd_interactive mode. But ratherthan just delete it, make it #ifdef NOT_USED, in hopes that we'llremember 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 parenta5736bf commit3620569

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+
#ifdefNOT_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)

[8]ページ先頭

©2009-2025 Movatter.jp