@@ -89,8 +89,7 @@ static int get_matching_location(int sortgroupref,
8989static List * resolve_unique_index_expr (ParseState * pstate , InferClause * infer ,
9090 Relation heapRel );
9191static List * addTargetToGroupList (ParseState * pstate , TargetEntry * tle ,
92- List * grouplist , List * targetlist , int location ,
93- bool resolveUnknown );
92+ List * grouplist , List * targetlist , int location );
9493static WindowClause * findWindowClause (List * wclist , const char * name );
9594static Node * transformFrameOffset (ParseState * pstate , int frameOptions ,
9695 Node * clause );
@@ -2011,8 +2010,7 @@ transformGroupClauseExpr(List **flatresult, Bitmapset *seen_local,
20112010 if (!found )
20122011 * flatresult = addTargetToGroupList (pstate , tle ,
20132012 * flatresult , * targetlist ,
2014- exprLocation (gexpr ),
2015- true);
2013+ exprLocation (gexpr ));
20162014
20172015 /*
20182016 * _something_ must have assigned us a sortgroupref by now...
@@ -2300,7 +2298,6 @@ transformSortClause(ParseState *pstate,
23002298 List * orderlist ,
23012299 List * * targetlist ,
23022300 ParseExprKind exprKind ,
2303- bool resolveUnknown ,
23042301 bool useSQL99 )
23052302{
23062303 List * sortlist = NIL ;
@@ -2319,8 +2316,7 @@ transformSortClause(ParseState *pstate,
23192316 targetlist , exprKind );
23202317
23212318 sortlist = addTargetToSortList (pstate , tle ,
2322- sortlist , * targetlist , sortby ,
2323- resolveUnknown );
2319+ sortlist , * targetlist , sortby );
23242320 }
23252321
23262322 return sortlist ;
@@ -2382,7 +2378,6 @@ transformWindowDefinitions(ParseState *pstate,
23822378 windef -> orderClause ,
23832379 targetlist ,
23842380 EXPR_KIND_WINDOW_ORDER ,
2385- true /* fix unknowns */ ,
23862381 true /* force SQL99 rules */ );
23872382 partitionClause = transformGroupClause (pstate ,
23882383 windef -> partitionClause ,
@@ -2553,8 +2548,7 @@ transformDistinctClause(ParseState *pstate,
25532548 continue ; /* ignore junk */
25542549 result = addTargetToGroupList (pstate , tle ,
25552550 result , * targetlist ,
2556- exprLocation ((Node * ) tle -> expr ),
2557- true);
2551+ exprLocation ((Node * ) tle -> expr ));
25582552 }
25592553
25602554 /*
@@ -2671,8 +2665,7 @@ transformDistinctOnClause(ParseState *pstate, List *distinctlist,
26712665 parser_errposition (pstate , exprLocation (dexpr ))));
26722666 result = addTargetToGroupList (pstate , tle ,
26732667 result , * targetlist ,
2674- exprLocation (dexpr ),
2675- true);
2668+ exprLocation (dexpr ));
26762669 }
26772670
26782671 /*
@@ -2906,17 +2899,11 @@ transformOnConflictArbiter(ParseState *pstate,
29062899 * list, add it to the end of the list, using the given sort ordering
29072900 * info.
29082901 *
2909- * If resolveUnknown is TRUE, convert TLEs of type UNKNOWN to TEXT. If not,
2910- * do nothing (which implies the search for a sort operator will fail).
2911- * pstate should be provided if resolveUnknown is TRUE, but can be NULL
2912- * otherwise.
2913- *
29142902 * Returns the updated SortGroupClause list.
29152903 */
29162904List *
29172905addTargetToSortList (ParseState * pstate , TargetEntry * tle ,
2918- List * sortlist , List * targetlist , SortBy * sortby ,
2919- bool resolveUnknown )
2906+ List * sortlist , List * targetlist , SortBy * sortby )
29202907{
29212908 Oid restype = exprType ((Node * ) tle -> expr );
29222909 Oid sortop ;
@@ -2927,7 +2914,7 @@ addTargetToSortList(ParseState *pstate, TargetEntry *tle,
29272914 ParseCallbackState pcbstate ;
29282915
29292916 /* if tlist item is an UNKNOWN literal, change it to TEXT */
2930- if (restype == UNKNOWNOID && resolveUnknown )
2917+ if (restype == UNKNOWNOID )
29312918 {
29322919 tle -> expr = (Expr * ) coerce_type (pstate , (Node * ) tle -> expr ,
29332920 restype , TEXTOID , -1 ,
@@ -3055,22 +3042,16 @@ addTargetToSortList(ParseState *pstate, TargetEntry *tle,
30553042 * to a SELECT item that matches the GROUP BY item; it'd be pretty confusing
30563043 * to report such a location.
30573044 *
3058- * If resolveUnknown is TRUE, convert TLEs of type UNKNOWN to TEXT. If not,
3059- * do nothing (which implies the search for an equality operator will fail).
3060- * pstate should be provided if resolveUnknown is TRUE, but can be NULL
3061- * otherwise.
3062- *
30633045 * Returns the updated SortGroupClause list.
30643046 */
30653047static List *
30663048addTargetToGroupList (ParseState * pstate , TargetEntry * tle ,
3067- List * grouplist , List * targetlist , int location ,
3068- bool resolveUnknown )
3049+ List * grouplist , List * targetlist , int location )
30693050{
30703051 Oid restype = exprType ((Node * ) tle -> expr );
30713052
30723053 /* if tlist item is an UNKNOWN literal, change it to TEXT */
3073- if (restype == UNKNOWNOID && resolveUnknown )
3054+ if (restype == UNKNOWNOID )
30743055 {
30753056 tle -> expr = (Expr * ) coerce_type (pstate , (Node * ) tle -> expr ,
30763057 restype , TEXTOID , -1 ,
0 commit comments