git.postgresql.org Git - postgresql.git/commitdiff

git projects / postgresql.git / commitdiff
? search:
summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: af52770)
psql: call clearerr() just before printing
2021年3月29日 21:34:39 +0000 (18:34 -0300)
2021年3月29日 21:34:39 +0000 (18:34 -0300)
We were never doing clearerr() on the output stream, which results in a
message being printed after each result once an EOF is seen:

could not print result table: Success

This message was added by commit b03436994bcc (in the pg13 era); before
that, the error indicator would never be examined. So backpatch only
that far back, even though the actual bug (to wit: the fact that the
error indicator is never cleared) is older.


diff --git a/src/fe_utils/print.c b/src/fe_utils/print.c
index e8772a278c306d233b08332e2ed8ba690f39b276..273b1bfe4a49f9baec51533741c8545f33deaf9c 100644 (file)
--- a/src/fe_utils/print.c
+++ b/src/fe_utils/print.c
@@ -3331,6 +3331,9 @@ printTable(const printTableContent *cont,
is_local_pager = is_pager;
}
+ /* clear any pre-existing error indication on the output stream */
+ clearerr(fout);
+
/* print the stuff */
if (flog)
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /