forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork1
Commit19d4f9f
committed
pgbench: Fix error reporting in readCommandResponse().
pgbench uses readCommandResponse() to process server responses.When readCommandResponse() encounters an error during a call toPQgetResult() to fetch the current result, it attempts to report itwith an additional error message from PQerrorMessage(). However,previously, this extra error message could be lost or become incorrect.The cause was that after fetching the current result (and detectingan error), readCommandResponse() called PQgetResult() again topeek at the next result. This second call could overwrite the libpqconnection's error message before the original error was reported,causing the error message retrieved from PQerrorMessage() to belost or overwritten.This commit fixes the issue by updating readCommandResponse()to use PQresultErrorMessage() instead of PQerrorMessage()to retrieve the error message generated when the PQgetResult()for the current result causes an error, ensuring the correct messageis reported.Backpatch to all supported versions.Author: Yugo Nagata <nagata@sraoss.co.jp>Reviewed-by: Chao Li <lic@highgo.com>Reviewed-by: Fujii Masao <masao.fujii@gmail.com>Discussion:https://postgr.es/m/20250925110940.ebacc31725758ec47d5432c6@sraoss.co.jpBackpatch-through: 131 parent91df046 commit19d4f9f
1 file changed
+3
-3
lines changedOriginal file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3356 | 3356 |
| |
3357 | 3357 |
| |
3358 | 3358 |
| |
3359 |
| - | |
| 3359 | + | |
3360 | 3360 |
| |
3361 | 3361 |
| |
3362 | 3362 |
| |
| |||
3366 | 3366 |
| |
3367 | 3367 |
| |
3368 | 3368 |
| |
3369 |
| - | |
| 3369 | + | |
3370 | 3370 |
| |
3371 | 3371 |
| |
3372 | 3372 |
| |
| |||
3375 | 3375 |
| |
3376 | 3376 |
| |
3377 | 3377 |
| |
3378 |
| - | |
| 3378 | + | |
3379 | 3379 |
| |
3380 | 3380 |
| |
3381 | 3381 |
| |
|
0 commit comments
Comments
(0)