@@ -89,8 +89,7 @@ static int get_matching_location(int sortgroupref,
89
89
static List * resolve_unique_index_expr (ParseState * pstate , InferClause * infer ,
90
90
Relation heapRel );
91
91
static List * addTargetToGroupList (ParseState * pstate , TargetEntry * tle ,
92
- List * grouplist , List * targetlist , int location ,
93
- bool resolveUnknown );
92
+ List * grouplist , List * targetlist , int location );
94
93
static WindowClause * findWindowClause (List * wclist , const char * name );
95
94
static Node * transformFrameOffset (ParseState * pstate , int frameOptions ,
96
95
Node * clause );
@@ -2011,8 +2010,7 @@ transformGroupClauseExpr(List **flatresult, Bitmapset *seen_local,
2011
2010
if (!found )
2012
2011
* flatresult = addTargetToGroupList (pstate , tle ,
2013
2012
* flatresult , * targetlist ,
2014
- exprLocation (gexpr ),
2015
- true);
2013
+ exprLocation (gexpr ));
2016
2014
2017
2015
/*
2018
2016
* _something_ must have assigned us a sortgroupref by now...
@@ -2300,7 +2298,6 @@ transformSortClause(ParseState *pstate,
2300
2298
List * orderlist ,
2301
2299
List * * targetlist ,
2302
2300
ParseExprKind exprKind ,
2303
- bool resolveUnknown ,
2304
2301
bool useSQL99 )
2305
2302
{
2306
2303
List * sortlist = NIL ;
@@ -2319,8 +2316,7 @@ transformSortClause(ParseState *pstate,
2319
2316
targetlist , exprKind );
2320
2317
2321
2318
sortlist = addTargetToSortList (pstate , tle ,
2322
- sortlist , * targetlist , sortby ,
2323
- resolveUnknown );
2319
+ sortlist , * targetlist , sortby );
2324
2320
}
2325
2321
2326
2322
return sortlist ;
@@ -2382,7 +2378,6 @@ transformWindowDefinitions(ParseState *pstate,
2382
2378
windef -> orderClause ,
2383
2379
targetlist ,
2384
2380
EXPR_KIND_WINDOW_ORDER ,
2385
- true /* fix unknowns */ ,
2386
2381
true /* force SQL99 rules */ );
2387
2382
partitionClause = transformGroupClause (pstate ,
2388
2383
windef -> partitionClause ,
@@ -2553,8 +2548,7 @@ transformDistinctClause(ParseState *pstate,
2553
2548
continue ; /* ignore junk */
2554
2549
result = addTargetToGroupList (pstate , tle ,
2555
2550
result , * targetlist ,
2556
- exprLocation ((Node * ) tle -> expr ),
2557
- true);
2551
+ exprLocation ((Node * ) tle -> expr ));
2558
2552
}
2559
2553
2560
2554
/*
@@ -2671,8 +2665,7 @@ transformDistinctOnClause(ParseState *pstate, List *distinctlist,
2671
2665
parser_errposition (pstate , exprLocation (dexpr ))));
2672
2666
result = addTargetToGroupList (pstate , tle ,
2673
2667
result , * targetlist ,
2674
- exprLocation (dexpr ),
2675
- true);
2668
+ exprLocation (dexpr ));
2676
2669
}
2677
2670
2678
2671
/*
@@ -2906,17 +2899,11 @@ transformOnConflictArbiter(ParseState *pstate,
2906
2899
* list, add it to the end of the list, using the given sort ordering
2907
2900
* info.
2908
2901
*
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
- *
2914
2902
* Returns the updated SortGroupClause list.
2915
2903
*/
2916
2904
List *
2917
2905
addTargetToSortList (ParseState * pstate , TargetEntry * tle ,
2918
- List * sortlist , List * targetlist , SortBy * sortby ,
2919
- bool resolveUnknown )
2906
+ List * sortlist , List * targetlist , SortBy * sortby )
2920
2907
{
2921
2908
Oid restype = exprType ((Node * ) tle -> expr );
2922
2909
Oid sortop ;
@@ -2927,7 +2914,7 @@ addTargetToSortList(ParseState *pstate, TargetEntry *tle,
2927
2914
ParseCallbackState pcbstate ;
2928
2915
2929
2916
/* if tlist item is an UNKNOWN literal, change it to TEXT */
2930
- if (restype == UNKNOWNOID && resolveUnknown )
2917
+ if (restype == UNKNOWNOID )
2931
2918
{
2932
2919
tle -> expr = (Expr * ) coerce_type (pstate , (Node * ) tle -> expr ,
2933
2920
restype , TEXTOID , -1 ,
@@ -3055,22 +3042,16 @@ addTargetToSortList(ParseState *pstate, TargetEntry *tle,
3055
3042
* to a SELECT item that matches the GROUP BY item; it'd be pretty confusing
3056
3043
* to report such a location.
3057
3044
*
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
- *
3063
3045
* Returns the updated SortGroupClause list.
3064
3046
*/
3065
3047
static List *
3066
3048
addTargetToGroupList (ParseState * pstate , TargetEntry * tle ,
3067
- List * grouplist , List * targetlist , int location ,
3068
- bool resolveUnknown )
3049
+ List * grouplist , List * targetlist , int location )
3069
3050
{
3070
3051
Oid restype = exprType ((Node * ) tle -> expr );
3071
3052
3072
3053
/* if tlist item is an UNKNOWN literal, change it to TEXT */
3073
- if (restype == UNKNOWNOID && resolveUnknown )
3054
+ if (restype == UNKNOWNOID )
3074
3055
{
3075
3056
tle -> expr = (Expr * ) coerce_type (pstate , (Node * ) tle -> expr ,
3076
3057
restype , TEXTOID , -1 ,
0 commit comments