aboutsummaryrefslogtreecommitdiff
path: root/src/backend/parser/parse_node.c
diff options
context:
space:
mode:
authorPeter Eisentraut <peter@eisentraut.org>2022-01-14 10:46:49 +0100
committerPeter Eisentraut <peter@eisentraut.org>2022-01-14 11:26:08 +0100
commitc4cc2850f4d16092c2b7b39964c097260935a72c (patch)
treeb4fe8e12dcf959b0df61ff55d57d44562a315ae0 /src/backend/parser/parse_node.c
parent93415a3b5ac8d8a2951ca0db887d8a173b8630a0 (diff)
downloadpostgresql-c4cc2850f4d16092c2b7b39964c097260935a72c.tar.gz
postgresql-c4cc2850f4d16092c2b7b39964c097260935a72c.zip
Rename value node fields
For the formerly-Value node types, rename the "val" field to a name specific to the node type, namely "ival", "fval", "sval", and "bsval". This makes some code clearer and catches mixups better. Reviewed-by: Pavel Stehule <pavel.stehule@gmail.com> Discussion: https://www.postgresql.org/message-id/flat/8c1a2e37-c68d-703c-5a83-7a6077f4f997@enterprisedb.com
Diffstat (limited to 'src/backend/parser/parse_node.c')
-rw-r--r--src/backend/parser/parse_node.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/backend/parser/parse_node.c b/src/backend/parser/parse_node.c
index ba9baf140c3..95913c80215 100644
--- a/src/backend/parser/parse_node.c
+++ b/src/backend/parser/parse_node.c
@@ -376,7 +376,7 @@ make_const(ParseState *pstate, A_Const *aconst)
switch (nodeTag(&aconst->val))
{
case T_Integer:
- val = Int32GetDatum(aconst->val.ival.val);
+ val = Int32GetDatum(intVal(&aconst->val));
typeid = INT4OID;
typelen = sizeof(int32);
@@ -385,7 +385,7 @@ make_const(ParseState *pstate, A_Const *aconst)
case T_Float:
/* could be an oversize integer as well as a float ... */
- if (scanint8(aconst->val.fval.val, true, &val64))
+ if (scanint8(aconst->val.fval.fval, true, &val64))
{
/*
* It might actually fit in int32. Probably only INT_MIN can
@@ -415,7 +415,7 @@ make_const(ParseState *pstate, A_Const *aconst)
/* arrange to report location if numeric_in() fails */
setup_parser_errposition_callback(&pcbstate, pstate, aconst->location);
val = DirectFunctionCall3(numeric_in,
- CStringGetDatum(aconst->val.fval.val),
+ CStringGetDatum(aconst->val.fval.fval),
ObjectIdGetDatum(InvalidOid),
Int32GetDatum(-1));
cancel_parser_errposition_callback(&pcbstate);
@@ -432,7 +432,7 @@ make_const(ParseState *pstate, A_Const *aconst)
* We assume here that UNKNOWN's internal representation is the
* same as CSTRING
*/
- val = CStringGetDatum(aconst->val.sval.val);
+ val = CStringGetDatum(strVal(&aconst->val));
typeid = UNKNOWNOID; /* will be coerced later */
typelen = -2; /* cstring-style varwidth type */
@@ -443,7 +443,7 @@ make_const(ParseState *pstate, A_Const *aconst)
/* arrange to report location if bit_in() fails */
setup_parser_errposition_callback(&pcbstate, pstate, aconst->location);
val = DirectFunctionCall3(bit_in,
- CStringGetDatum(aconst->val.bsval.val),
+ CStringGetDatum(aconst->val.bsval.bsval),
ObjectIdGetDatum(InvalidOid),
Int32GetDatum(-1));
cancel_parser_errposition_callback(&pcbstate);