Re: Unclear code - please elaborate - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Unclear code - please elaborate
Date
Msg-id 918748.1732983121@sss.pgh.pa.us
Whole thread Raw
In response to Unclear code - please elaborate  (Dmitry Nikitin <pgsql-hackers@dima.nikitin.name>)
List pgsql-hackers
Dmitry Nikitin <pgsql-hackers@dima.nikitin.name> writes:
>
https://github.com/postgres/postgres/blob/5d39becf8ba0080c98fee4b63575552f6800b012/src/backend/optimizer/prep/prepjointree.c#L3856
> bms_next_member() is allowed to return the zero as a valid value. Subsequent rt_fetch() offsets that
> zero to -1 which leads to the assertion down the code. Nothing wrong here? Either zero is simply not
> possible after that bms_next_member() because of some factors behind the code?

Zero isn't a valid relid.  If we were to find such a value in that
bitmapset, an assertion would be a fine outcome.

            regards, tom lane



pgsql-hackers by date:

Previous
From: jian he
Date:
Subject: Re: how to get MAJORVERSION in meson
Next
From: Pavel Stehule
Date:
Subject: Re: how to get MAJORVERSION in meson