Re: use correct variable in error message in _allocAH function (pg_backup_archiver.c)
От | Fujii Masao |
---|---|
Тема | Re: use correct variable in error message in _allocAH function (pg_backup_archiver.c) |
Дата | |
Msg-id | b6899488-b4e4-4c3d-bf53-a5a89d54e05b@oss.nttdata.com обсуждение исходный текст |
Ответ на | Re: use correct variable in error message in _allocAH function (pg_backup_archiver.c) (Fujii Masao <masao.fujii@oss.nttdata.com>) |
Список | pgsql-hackers |
On 2025/04/15 17:02, Fujii Masao wrote: > > > On 2025/04/15 7:21, Mahendra Singh Thalor wrote: >> Hi hackers, >> >> In _allocAH function(pg_backup_archiver.c), we were using the *fmt* variable in switch case for *default case*, but correctvariable is AH->format. >> >> Here, I am attaching a patch for the same. > > Thanks for the report and patch! It looks good to me. > Since this issue exists in the back branches, > the patch needs be back-patched to all supported versions. Unless there are any objections, I'll commit the patch with the following commit message: ------------------ pg_dump: Fix incorrect archive format shown in error message. In pg_dump and pg_restore, _allocAH() calls _discoverArchiveFormat() to determine the archive format when the input format is unknown one. If the input or discovered format is unrecognized, it reports an error including the archive format number. If discovered format is unrecognized, its number should be shown in the error message. But previously the error message mistakenly showed the originally requested format number (i.e., unknown one) instead of the discovered one, due to referencing the wrong variable in the error message. This commit corrects the issue by using the appropriate variable in the error message. In practice, this has no visible effect for users, since _discoverArchiveFormat() does not currently return unrecognized formats, so the error condition is never actually triggered. Back-patch to all supported versions. Author: Mahendra Singh Thalor <mahi6run@gmail.com> Reviewed-by: Fujii Masao <masao.fujii@gmail.com> Discussion: https://postgr.es/m/CAKYtNAqu+N-Ab2Fq6wzNSOm_-0N-BMneanYNV1+6kFDXjva1Eg@mail.gmail.com Backpatch-through: 13 ------------------ Regards, -- Fujii Masao Advanced Computing Technology Center Research and Development Headquarters NTT DATA CORPORATION
В списке pgsql-hackers по дате отправления: