Re: Unclear code - please elaborate

2024-11-30 Thread Tom Lane
Dmitry Nikitin 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

Re: Unclear code - please elaborate

2024-11-30 Thread Junwang Zhao
On Sat, Nov 30, 2024 at 4:15 PM Dmitry Nikitin wrote: > > Hello , > > > 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()

Unclear code - please elaborate

2024-11-30 Thread Dmitry Nikitin
Hello , 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.