Avoid dead code (contrib/pg_visibility/pg_visibility.c)
Hi.
Per coverity.
I think that commit c582b75
<https://github.com/postgres/postgres/commit/c582b75851c2d096ce050d753494505a957cee75>,
left an oversight.
The report is:
CID 1559993: (#1 of 1): Logically dead code (DEADCODE)
Trivial patch attached.
best regards,
Ranier Vilela
Attachments:
0001-avoid-dead-code-pg_visibility.patchapplication/octet-stream; name=0001-avoid-dead-code-pg_visibility.patchDownload
diff --git a/contrib/pg_visibility/pg_visibility.c b/contrib/pg_visibility/pg_visibility.c
index db796e35cb..1c0a0fbdfb 100644
--- a/contrib/pg_visibility/pg_visibility.c
+++ b/contrib/pg_visibility/pg_visibility.c
@@ -760,9 +760,9 @@ collect_corrupt_items(Oid relid, bool all_visible, bool all_frozen)
* the page lock. Recheck to avoid returning spurious results.
*/
if (all_frozen && !VM_ALL_FROZEN(rel, blkno, &vmbuffer))
- check_frozen = false;
+ check_frozen = true;
if (all_visible && !VM_ALL_VISIBLE(rel, blkno, &vmbuffer))
- check_visible = false;
+ check_visible = true;
if (!check_visible && !check_frozen)
{
UnlockReleaseBuffer(buffer);
On Wed, Sep 04, 2024 at 01:50:24PM -0300, Ranier Vilela wrote:
I think that commit c582b75
<https://github.com/postgres/postgres/commit/c582b75851c2d096ce050d753494505a957cee75>,
left an oversight.The report is:
CID 1559993: (#1 of 1): Logically dead code (DEADCODE)Trivial patch attached.
I am not sure to understand what you mean here and if this is still
relevant as of Noah's latest commit in 65c310b310a6.
--
Michael
Hi,
On Thu, 12 Sept 2024 at 08:19, Michael Paquier <michael@paquier.xyz> wrote:
On Wed, Sep 04, 2024 at 01:50:24PM -0300, Ranier Vilela wrote:
I think that commit c582b75
<https://github.com/postgres/postgres/commit/c582b75851c2d096ce050d753494505a957cee75>,
left an oversight.The report is:
CID 1559993: (#1 of 1): Logically dead code (DEADCODE)
Thanks for the report!
I am not sure to understand what you mean here and if this is still
relevant as of Noah's latest commit in 65c310b310a6.
This should be fixed in 65c310b310a6.
--
Regards,
Nazir Bilal Yavuz
Microsoft
Em qui., 12 de set. de 2024 às 02:18, Michael Paquier <michael@paquier.xyz>
escreveu:
On Wed, Sep 04, 2024 at 01:50:24PM -0300, Ranier Vilela wrote:
I think that commit c582b75
<https://github.com/postgres/postgres/commit/c582b75851c2d096ce050d753494505a957cee75
,
left an oversight.The report is:
CID 1559993: (#1 of 1): Logically dead code (DEADCODE)Trivial patch attached.
I am not sure to understand what you mean here and if this is still
relevant as of Noah's latest commit in 65c310b310a6.
Sorry Michael, but this patch became irrelevant after ddfc556
<http://ddfc556a644404a8942e77651f75f09aa5188782>
Note the omission to connect the dots, from the commit.
best regards,
Ranier Vilela