Overall patch looks fine to me and marking it "ready for committer".
There is two design decision, which I leave it for committer's decision.
1. EXECUTE statement should show only as EXECUTE count, not the actual SQL query. 2. should we count statement execute from Functions or only statement what is executed directly by the user as it's doing now?