Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
a29f7ed5
Commit
a29f7ed5
authored
Oct 12, 2012
by
Tom Lane
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Get rid of COERCE_DONTCARE.
We don't need this hack any more.
parent
427fd885
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
16 additions
and
18 deletions
+16
-18
src/backend/executor/functions.c
src/backend/executor/functions.c
+3
-3
src/backend/nodes/nodeFuncs.c
src/backend/nodes/nodeFuncs.c
+2
-3
src/backend/optimizer/path/equivclass.c
src/backend/optimizer/path/equivclass.c
+2
-2
src/backend/optimizer/prep/prepunion.c
src/backend/optimizer/prep/prepunion.c
+1
-1
src/backend/optimizer/util/clauses.c
src/backend/optimizer/util/clauses.c
+4
-4
src/backend/parser/parse_agg.c
src/backend/parser/parse_agg.c
+2
-2
src/include/nodes/primnodes.h
src/include/nodes/primnodes.h
+2
-3
No files found.
src/backend/executor/functions.c
View file @
a29f7ed5
...
@@ -1572,7 +1572,7 @@ check_sql_fn_retval(Oid func_id, Oid rettype, List *queryTreeList,
...
@@ -1572,7 +1572,7 @@ check_sql_fn_retval(Oid func_id, Oid rettype, List *queryTreeList,
rettype
,
rettype
,
-
1
,
-
1
,
get_typcollation
(
rettype
),
get_typcollation
(
rettype
),
COERCE_
DONTCARE
);
COERCE_
IMPLICIT_CAST
);
/* Relabel is dangerous if TLE is a sort/group or setop column */
/* Relabel is dangerous if TLE is a sort/group or setop column */
if
(
tle
->
ressortgroupref
!=
0
||
parse
->
setOperations
)
if
(
tle
->
ressortgroupref
!=
0
||
parse
->
setOperations
)
*
modifyTargetList
=
true
;
*
modifyTargetList
=
true
;
...
@@ -1618,7 +1618,7 @@ check_sql_fn_retval(Oid func_id, Oid rettype, List *queryTreeList,
...
@@ -1618,7 +1618,7 @@ check_sql_fn_retval(Oid func_id, Oid rettype, List *queryTreeList,
rettype
,
rettype
,
-
1
,
-
1
,
get_typcollation
(
rettype
),
get_typcollation
(
rettype
),
COERCE_
DONTCARE
);
COERCE_
IMPLICIT_CAST
);
/* Relabel is dangerous if sort/group or setop column */
/* Relabel is dangerous if sort/group or setop column */
if
(
tle
->
ressortgroupref
!=
0
||
parse
->
setOperations
)
if
(
tle
->
ressortgroupref
!=
0
||
parse
->
setOperations
)
*
modifyTargetList
=
true
;
*
modifyTargetList
=
true
;
...
@@ -1722,7 +1722,7 @@ check_sql_fn_retval(Oid func_id, Oid rettype, List *queryTreeList,
...
@@ -1722,7 +1722,7 @@ check_sql_fn_retval(Oid func_id, Oid rettype, List *queryTreeList,
atttype
,
atttype
,
-
1
,
-
1
,
get_typcollation
(
atttype
),
get_typcollation
(
atttype
),
COERCE_
DONTCARE
);
COERCE_
IMPLICIT_CAST
);
/* Relabel is dangerous if sort/group or setop column */
/* Relabel is dangerous if sort/group or setop column */
if
(
tle
->
ressortgroupref
!=
0
||
parse
->
setOperations
)
if
(
tle
->
ressortgroupref
!=
0
||
parse
->
setOperations
)
*
modifyTargetList
=
true
;
*
modifyTargetList
=
true
;
...
...
src/backend/nodes/nodeFuncs.c
View file @
a29f7ed5
...
@@ -554,8 +554,7 @@ exprIsLengthCoercion(const Node *expr, int32 *coercedTypmod)
...
@@ -554,8 +554,7 @@ exprIsLengthCoercion(const Node *expr, int32 *coercedTypmod)
*
*
* This is primarily intended to be used during planning. Therefore, it
* This is primarily intended to be used during planning. Therefore, it
* strips any existing RelabelType nodes to maintain the planner's invariant
* strips any existing RelabelType nodes to maintain the planner's invariant
* that there are not adjacent RelabelTypes, and it uses COERCE_DONTCARE
* that there are not adjacent RelabelTypes.
* which would typically be inappropriate earlier.
*/
*/
Node
*
Node
*
relabel_to_typmod
(
Node
*
expr
,
int32
typmod
)
relabel_to_typmod
(
Node
*
expr
,
int32
typmod
)
...
@@ -569,7 +568,7 @@ relabel_to_typmod(Node *expr, int32 typmod)
...
@@ -569,7 +568,7 @@ relabel_to_typmod(Node *expr, int32 typmod)
/* Apply new typmod, preserving the previous exposed type and collation */
/* Apply new typmod, preserving the previous exposed type and collation */
return
(
Node
*
)
makeRelabelType
((
Expr
*
)
expr
,
type
,
typmod
,
coll
,
return
(
Node
*
)
makeRelabelType
((
Expr
*
)
expr
,
type
,
typmod
,
coll
,
COERCE_
DONTCARE
);
COERCE_
EXPLICIT_CAST
);
}
}
/*
/*
...
...
src/backend/optimizer/path/equivclass.c
View file @
a29f7ed5
...
@@ -431,13 +431,13 @@ canonicalize_ec_expression(Expr *expr, Oid req_type, Oid req_collation)
...
@@ -431,13 +431,13 @@ canonicalize_ec_expression(Expr *expr, Oid req_type, Oid req_collation)
req_type
,
req_type
,
-
1
,
-
1
,
req_collation
,
req_collation
,
COERCE_
DONTCARE
);
COERCE_
IMPLICIT_CAST
);
else
if
(
exprCollation
((
Node
*
)
expr
)
!=
req_collation
)
else
if
(
exprCollation
((
Node
*
)
expr
)
!=
req_collation
)
expr
=
(
Expr
*
)
makeRelabelType
(
expr
,
expr
=
(
Expr
*
)
makeRelabelType
(
expr
,
req_type
,
req_type
,
exprTypmod
((
Node
*
)
expr
),
exprTypmod
((
Node
*
)
expr
),
req_collation
,
req_collation
,
COERCE_
DONTCARE
);
COERCE_
IMPLICIT_CAST
);
}
}
return
expr
;
return
expr
;
...
...
src/backend/optimizer/prep/prepunion.c
View file @
a29f7ed5
...
@@ -982,7 +982,7 @@ generate_setop_tlist(List *colTypes, List *colCollations,
...
@@ -982,7 +982,7 @@ generate_setop_tlist(List *colTypes, List *colCollations,
exprType
(
expr
),
exprType
(
expr
),
exprTypmod
(
expr
),
exprTypmod
(
expr
),
colColl
,
colColl
,
COERCE_
DONTCARE
);
COERCE_
IMPLICIT_CAST
);
}
}
tle
=
makeTargetEntry
((
Expr
*
)
expr
,
tle
=
makeTargetEntry
((
Expr
*
)
expr
,
...
...
src/backend/optimizer/util/clauses.c
View file @
a29f7ed5
...
@@ -2789,7 +2789,7 @@ eval_const_expressions_mutator(Node *node,
...
@@ -2789,7 +2789,7 @@ eval_const_expressions_mutator(Node *node,
relabel
->
resulttype
=
exprType
(
arg
);
relabel
->
resulttype
=
exprType
(
arg
);
relabel
->
resulttypmod
=
exprTypmod
(
arg
);
relabel
->
resulttypmod
=
exprTypmod
(
arg
);
relabel
->
resultcollid
=
collate
->
collOid
;
relabel
->
resultcollid
=
collate
->
collOid
;
relabel
->
relabelformat
=
COERCE_
DONTCARE
;
relabel
->
relabelformat
=
COERCE_
IMPLICIT_CAST
;
relabel
->
location
=
collate
->
location
;
relabel
->
location
=
collate
->
location
;
/* Don't create stacked RelabelTypes */
/* Don't create stacked RelabelTypes */
...
@@ -3625,7 +3625,7 @@ simplify_function(Oid funcid, Oid result_type, int32 result_typmod,
...
@@ -3625,7 +3625,7 @@ simplify_function(Oid funcid, Oid result_type, int32 result_typmod,
fexpr
.
funcid
=
funcid
;
fexpr
.
funcid
=
funcid
;
fexpr
.
funcresulttype
=
result_type
;
fexpr
.
funcresulttype
=
result_type
;
fexpr
.
funcretset
=
func_form
->
proretset
;
fexpr
.
funcretset
=
func_form
->
proretset
;
fexpr
.
funcformat
=
COERCE_
DONTCARE
;
fexpr
.
funcformat
=
COERCE_
EXPLICIT_CALL
;
fexpr
.
funccollid
=
result_collid
;
fexpr
.
funccollid
=
result_collid
;
fexpr
.
inputcollid
=
input_collid
;
fexpr
.
inputcollid
=
input_collid
;
fexpr
.
args
=
args
;
fexpr
.
args
=
args
;
...
@@ -3959,7 +3959,7 @@ evaluate_function(Oid funcid, Oid result_type, int32 result_typmod,
...
@@ -3959,7 +3959,7 @@ evaluate_function(Oid funcid, Oid result_type, int32 result_typmod,
newexpr
->
funcid
=
funcid
;
newexpr
->
funcid
=
funcid
;
newexpr
->
funcresulttype
=
result_type
;
newexpr
->
funcresulttype
=
result_type
;
newexpr
->
funcretset
=
false
;
newexpr
->
funcretset
=
false
;
newexpr
->
funcformat
=
COERCE_
DONTCARE
;
/* doesn't matter */
newexpr
->
funcformat
=
COERCE_
EXPLICIT_CALL
;
/* doesn't matter */
newexpr
->
funccollid
=
result_collid
;
/* doesn't matter */
newexpr
->
funccollid
=
result_collid
;
/* doesn't matter */
newexpr
->
inputcollid
=
input_collid
;
newexpr
->
inputcollid
=
input_collid
;
newexpr
->
args
=
args
;
newexpr
->
args
=
args
;
...
@@ -4089,7 +4089,7 @@ inline_function(Oid funcid, Oid result_type, Oid result_collid,
...
@@ -4089,7 +4089,7 @@ inline_function(Oid funcid, Oid result_type, Oid result_collid,
fexpr
->
funcid
=
funcid
;
fexpr
->
funcid
=
funcid
;
fexpr
->
funcresulttype
=
result_type
;
fexpr
->
funcresulttype
=
result_type
;
fexpr
->
funcretset
=
false
;
fexpr
->
funcretset
=
false
;
fexpr
->
funcformat
=
COERCE_
DONTCARE
;
/* doesn't matter */
fexpr
->
funcformat
=
COERCE_
EXPLICIT_CALL
;
/* doesn't matter */
fexpr
->
funccollid
=
result_collid
;
/* doesn't matter */
fexpr
->
funccollid
=
result_collid
;
/* doesn't matter */
fexpr
->
inputcollid
=
input_collid
;
fexpr
->
inputcollid
=
input_collid
;
fexpr
->
args
=
args
;
fexpr
->
args
=
args
;
...
...
src/backend/parser/parse_agg.c
View file @
a29f7ed5
...
@@ -1001,7 +1001,7 @@ build_aggregate_fnexprs(Oid *agg_input_types,
...
@@ -1001,7 +1001,7 @@ build_aggregate_fnexprs(Oid *agg_input_types,
args
,
args
,
InvalidOid
,
InvalidOid
,
agg_input_collation
,
agg_input_collation
,
COERCE_
DONTCARE
);
COERCE_
EXPLICIT_CALL
);
/* see if we have a final function */
/* see if we have a final function */
if
(
!
OidIsValid
(
finalfn_oid
))
if
(
!
OidIsValid
(
finalfn_oid
))
...
@@ -1027,5 +1027,5 @@ build_aggregate_fnexprs(Oid *agg_input_types,
...
@@ -1027,5 +1027,5 @@ build_aggregate_fnexprs(Oid *agg_input_types,
args
,
args
,
InvalidOid
,
InvalidOid
,
agg_input_collation
,
agg_input_collation
,
COERCE_
DONTCARE
);
COERCE_
EXPLICIT_CALL
);
}
}
src/include/nodes/primnodes.h
View file @
a29f7ed5
...
@@ -316,7 +316,7 @@ typedef enum CoercionContext
...
@@ -316,7 +316,7 @@ typedef enum CoercionContext
}
CoercionContext
;
}
CoercionContext
;
/*
/*
* CoercionForm -
information showing how to display a function-call node
* CoercionForm -
how to display a node that could have come from a cast
*
*
* NB: equal() ignores CoercionForm fields, therefore this *must* not carry
* NB: equal() ignores CoercionForm fields, therefore this *must* not carry
* any semantically significant information. We need that behavior so that
* any semantically significant information. We need that behavior so that
...
@@ -328,8 +328,7 @@ typedef enum CoercionForm
...
@@ -328,8 +328,7 @@ typedef enum CoercionForm
{
{
COERCE_EXPLICIT_CALL
,
/* display as a function call */
COERCE_EXPLICIT_CALL
,
/* display as a function call */
COERCE_EXPLICIT_CAST
,
/* display as an explicit cast */
COERCE_EXPLICIT_CAST
,
/* display as an explicit cast */
COERCE_IMPLICIT_CAST
,
/* implicit cast, so hide it */
COERCE_IMPLICIT_CAST
/* implicit cast, so hide it */
COERCE_DONTCARE
/* special case for planner */
}
CoercionForm
;
}
CoercionForm
;
/*
/*
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment