Hi,

On Tue, Jun 17, 2025 at 2:38 PM Fujii Masao <masao.fu...@oss.nttdata.com> wrote:
>                                 adjust_foreign_grouping_path_cost(root, 
> pathkeys,
>                                                                               
>                     retrieved_rows, width,
> -                                                                             
>                     fpextra->limit_tuples,
> +                                                                             
>                     fpextra ? fpextra->limit_tuples : 0.0,
>                                                                               
>                     &disabled_nodes,
>                                                                               
>                     &startup_cost, &run_cost);
>
> I couldn't find a query that would reach this code path with
> fpextra == NULL, but I agree the current code is fragile.
> So I think it's a good idea to add the check before accessing
> the field.

We get here only when called from add_foreign_ordered_paths() or
add_foreign_final_paths(), in which cases fpextra is always set, so it
cannot be NULL.  No?

Best regards,
Etsuro Fujita


Reply via email to