diff options
author | Andrew Gierth <rhodiumtoad@postgresql.org> | 2019-10-03 10:54:52 +0100 |
---|---|---|
committer | Andrew Gierth <rhodiumtoad@postgresql.org> | 2019-10-03 11:17:38 +0100 |
commit | 6db0d7f35917144fcd9dfbdad8c31c37a64ca144 (patch) | |
tree | d603ce6f9928a339aebabdd15cd8ea2e0a5defa6 /src/include/nodes/nodeFuncs.h | |
parent | ac1efdd080b2a26bf4f072cbd01155ba623ec401 (diff) |
Selectively include window frames in expression walks/mutates.
query_tree_walker and query_tree_mutator were skipping the
windowClause of the query, without regard for the fact that the
startOffset and endOffset in a WindowClause node are expression trees
that need to be processed. This was an oversight in commit ec4be2ee6
from 2010 which added the expression fields; the main symptom is that
function parameters in window frame clauses don't work in inlined
functions.
Fix (as conservatively as possible since this needs to not break
existing out-of-tree callers) and add tests.
Backpatch all the way, since this has been broken since 9.0.
Per report from Alastair McKinley; fix by me with kibitzing and review
from Tom Lane.
Discussion: https://postgr.es/m/DB6PR0202MB2904E7FDDA9D81504D1E8C68E3800@DB6PR0202MB2904.eurprd02.prod.outlook.com
Diffstat (limited to 'src/include/nodes/nodeFuncs.h')
-rw-r--r-- | src/include/nodes/nodeFuncs.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/include/nodes/nodeFuncs.h b/src/include/nodes/nodeFuncs.h index 97af1429296..14bb8cb561e 100644 --- a/src/include/nodes/nodeFuncs.h +++ b/src/include/nodes/nodeFuncs.h @@ -24,6 +24,7 @@ #define QTW_IGNORE_RANGE_TABLE 0x08 /* skip rangetable entirely */ #define QTW_EXAMINE_RTES 0x10 /* examine RTEs */ #define QTW_DONT_COPY_QUERY 0x20 /* do not copy top Query */ +#define QTW_EXAMINE_SORTGROUP 0x80 /* include SortGroupNode lists */ /* callback function for check_functions_in_node */ typedef bool (*check_function_callback) (Oid func_id, void *context); |