Hi,
For utility statements defined within a function, the queryTree is
copied to a plannedStmt as utility commands don't require planning.
However, the queryId is not propagated to the plannedStmt. This leads
to plugins relying on queryId like pg_stat_statements to not be able
to track utility statements within function calls.
This patch fixes the issue by correctly propagating queryId from the
cached queryTree to the plannedStmt.
Regards,
Anthonin