Re: Making empty Bitmapsets always be NULL
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Richard Guo <guofenglinux@gmail.com>
Cc: Nathan Bossart <nathandbossart@gmail.com>,
pgsql-hackers@lists.postgresql.org
Date: 2023-03-02T17:04:27Z
Lists: pgsql-hackers
Richard Guo <guofenglinux@gmail.com> writes: > It seems that the Bitmapset checked by bms_is_empty_internal cannot be > NULL from how it is computed by a function. So I wonder if we can > remove the check of 'a' being NULL in that function, or reduce it to an > Assert. Yeah, I think just removing it is sufficient. The subsequent attempts to dereference the pointer will crash just fine if it's NULL; we don't need an Assert to help things along. > It seems that in create_lateral_join_info around line 689, the > bms_is_empty check of lateral_relids is not necessary, since we've > checked that lateral_relids cannot be NULL several lines earlier. Good catch, I missed that one. Pushed, thanks for reviewing. regards, tom lane
Commits
-
Remove trailing zero words from Bitmapsets
- a8c09daa8bb1 17.0 landed
-
Remove local optimizations of empty Bitmapsets into null pointers.
- 6b661b01f48b 16.0 landed
-
Require empty Bitmapsets to be represented as NULL.
- 00b41463c216 16.0 landed
-
Mop up some undue familiarity with the innards of Bitmapsets.
- 141225b2518f 16.0 landed
-
Remove bms_first_member().
- 462bb7f12851 16.0 landed