On 2021/12/03 23:04, Bharath Rupireddy wrote:
> Let's not use the boolean just for the cancel request which isn't
> scalable IMO. Maybe a macro/enum?
>
> Otherwise, we could just do, although it doesn't look elegant:
>
> if (pgfdw_get_cleanup_result(conn, endtime, &result, "(cancel request)"))
>
> if (strcmp(query, "(cancel request)") == 0)
> WARNING without "remote SQL command:
> else
> WARNING with "remote SQL command:
Yeah, I agree that's not elegant..
So I'd like to propose new patch with different design from
what I proposed before. Patch attached.
This patch changes pgfdw_exec_cleanup_query() so that it tells
its callers the information about whether the timeout expired
or not. Then the callers (pgfdw_exec_cleanup_query and
pgfdw_cancel_query) report the warning messages based on
the results from pgfdw_exec_cleanup_query().
Regards,
--
Fujii Masao
Advanced Computing Technology Center
Research and Development Headquarters
NTT DATA CORPORATION