Re: Possible bug: SQL function parameter in window frame definition

Andrew Gierth <andrew@tao11.riddles.org.uk>

From: Andrew Gierth <andrew@tao11.riddles.org.uk>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-hackers@lists.postgresql.org
Date: 2019-10-02T16:50:13Z
Lists: pgsql-hackers, pgsql-general

Attachments

>>>>> "Tom" == Tom Lane <tgl@sss.pgh.pa.us> writes:

 >> I'm going to leave the assertion out for now and put in a comment
 >> for future reference.

 Tom> WFM. At this point it's clear it would be a separate piece of work
 Tom> not something to slide into the bug-fix patch, anyway.

OK. So here's the final patch.

(For the benefit of anyone in -hackers not following the original thread
in -general, the problem here is that expressions in window framing
clauses were not being walked or mutated by query_tree_walker /
query_tree_mutator. This has been wrong ever since 9.0, but somehow
nobody seems to have noticed until now.)

-- 
Andrew (irc:RhodiumToad)

Commits

  1. Selectively include window frames in expression walks/mutates.