On Mon, Nov 9, 2026 at 2:11 PM David Rowley <[email protected]> wrote: > Looking at finalize_plan(), I'd say that's correct. But shouldn't it > be bms_add_member() rather than bms_union()?
Thanks for looking! I assume you mean bms_add_members(). Agreed. finalize_plan() allocates a fresh extParam and allParam for each plan node, and nothing else keeps a pointer to them, so we can safely modify the child's sets in place, and there's no point in allocating new ones. Attached is a patch for this fix. (Since v14 will reach EOL before this can be pushed, maybe back-patching to v15 is enough.) - Richard
v1-0001-Fix-stale-initplans-after-removing-a-plan-level-i.patch
Description: Binary data
