Re: Unclear code - please elaborate

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Dmitry Nikitin <pgsql-hackers(at)dima(dot)nikitin(dot)name>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Unclear code - please elaborate
Date: 2024-11-30 16:12:01
Message-ID: 918748.1732983121@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Dmitry Nikitin <pgsql-hackers(at)dima(dot)nikitin(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavel Stehule 2024-11-30 17:00:06 Re: how to get MAJORVERSION in meson
Previous Message jian he 2024-11-30 15:42:12 Re: how to get MAJORVERSION in meson