BUG #18850: REDUNDANT_COMPARISON.ALWAYS_FALSE Redundant comparison

From: PG Bug reporting form <noreply(at)postgresql(dot)org>
To: pgsql-bugs(at)lists(dot)postgresql(dot)org
Cc: pm91(dot)arapov(at)gmail(dot)com
Subject: BUG #18850: REDUNDANT_COMPARISON.ALWAYS_FALSE Redundant comparison
Date: 2025-03-14 09:16:06
Message-ID: 18850-20d329c520d6a64e@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

The following bug has been logged on the website:

Bug reference: 18850
Logged by: Nikita
Email address: pm91(dot)arapov(at)gmail(dot)com
PostgreSQL version: 16.6
Operating system: ubuntu 20.04
Description:

REDUNDANT_COMPARISON.ALWAYS_FALSE Redundant comparison

diff --git a/src/backend/commands/operatorcmds.c
b/src/backend/commands/operatorcmds.c
--- a/src/backend/commands/operatorcmds.c (revision
a49ac80219c6f28c3cf3973f797de637329952da)
+++ b/src/backend/commands/operatorcmds.c (date 1740387217614)
@@ -209,11 +209,6 @@
typeId[0] = typeId2;
nargs = 1;
}
- else if (!OidIsValid(typeId2))
- {
- typeId[0] = typeId1;
- nargs = 1;
- }
else
{
typeId[0] = typeId1;

I suggest the following patch fixing this issue

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Viktor Holmberg 2025-03-14 11:49:06 ISN extension - wrong volatility level for isn_weak() function
Previous Message PG Bug reporting form 2025-03-14 09:14:19 BUG #18849: DEREF_OF_NULL.RET Pointer '&partexprs_item.ptr_value', returned from function 'list_head' at partiti