More issues with expressions always false (no patch) - Mailing list pgsql-hackers

From Ranier Vilela
Subject More issues with expressions always false (no patch)
Date
Msg-id CAEudQAo=DCebm1RXtig9OH+QivpS97sMkikt0A9qHmMUs+g6ZA@mail.gmail.com
Whole thread Raw
Responses Re: More issues with expressions always false (no patch)
List pgsql-hackers
Continuing on always false expressions.
There are three difficult cases, whose solutions which needs to be well thought out.
This is not a case of simply removing the expressions, perhaps, but have to be sure.

First case:
src \ backend \ executor \ nodeSubplan.c (line 507)

if (node-> hashtable)

node-> hastable is assigned with NULL at line 498, so the test will always fail.

Second case:
Here the case is similar, but worse.

src \ backend \ executor \ nodeSubplan.c (line 535)
if (node-> hashnulls)
  ResetTupleHashTable (node-> hashtable);

node-> hashnulls is assigned with NULL at line 499, so the test will always fail.
Otherwise, it would have already been discovered, because it would inevitably occur
an access violation, since > hashtable would be accessed.

Third case:
\ src \ backend \ utils \ cache \ relcache.c (line 5190)
if (relation-> rd_pubactions)

It will never be executed, because if relation-> rd_pubactions is true, the function returns on line 5154.

regards,
Ranier Vilela

pgsql-hackers by date:

Previous
From: ilmari@ilmari.org (Dagfinn Ilmari Mannsåker)
Date:
Subject: Re: [PATCH] Fix expressions always false
Next
From: Peter Geoghegan
Date:
Subject: Re: Building infrastructure for B-Tree deduplication that recognizeswhen opclass equality is also equivalence