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

Commit51da231

Browse files
committed
Don't fail on libpq-generated error reports in pg_amcheck.
An error PGresult generated by libpq itself, such as a report ofconnection loss, won't have broken-down error fields.should_processing_continue() blithely assumed thatPG_DIAG_SEVERITY_NONLOCALIZED would always be present, and woulddump core if it wasn't.Per grepping to see if6d157e7's mistake was repeated elsewhere.
1 parent6d157e7 commit51da231

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

‎src/bin/pg_amcheck/pg_amcheck.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -930,6 +930,8 @@ should_processing_continue(PGresult *res)
930930
/* This is expected but requires closer scrutiny */
931931
casePGRES_FATAL_ERROR:
932932
severity=PQresultErrorField(res,PG_DIAG_SEVERITY_NONLOCALIZED);
933+
if (severity==NULL)
934+
return false;/* libpq failure, probably lost connection */
933935
if (strcmp(severity,"FATAL")==0)
934936
return false;
935937
if (strcmp(severity,"PANIC")==0)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp