aboutsummaryrefslogtreecommitdiff
path: root/src/backend/parser/parse_node.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2022-05-12 15:17:30 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2022-05-12 15:17:30 -0400
commit23e7b38bfe396f919fdb66057174d29e17086418 (patch)
tree335c3962ef8afe0f6193d0413dbc51642276b147 /src/backend/parser/parse_node.c
parent93909599cdba64c8759d646983c0a4ef93de1e50 (diff)
downloadpostgresql-23e7b38bfe396f919fdb66057174d29e17086418.tar.gz
postgresql-23e7b38bfe396f919fdb66057174d29e17086418.zip
Pre-beta mechanical code beautification.
Run pgindent, pgperltidy, and reformat-dat-files. I manually fixed a couple of comments that pgindent uglified.
Diffstat (limited to 'src/backend/parser/parse_node.c')
-rw-r--r--src/backend/parser/parse_node.c83
1 files changed, 42 insertions, 41 deletions
diff --git a/src/backend/parser/parse_node.c b/src/backend/parser/parse_node.c
index a49c985d36e..4d39cf95945 100644
--- a/src/backend/parser/parse_node.c
+++ b/src/backend/parser/parse_node.c
@@ -382,55 +382,56 @@ make_const(ParseState *pstate, A_Const *aconst)
break;
case T_Float:
- {
- /* could be an oversize integer as well as a float ... */
-
- int64 val64;
- char *endptr;
-
- errno = 0;
- val64 = strtoi64(aconst->val.fval.fval, &endptr, 10);
- if (errno == 0 && *endptr == '\0')
{
- /*
- * It might actually fit in int32. Probably only INT_MIN can
- * occur, but we'll code the test generally just to be sure.
- */
- int32 val32 = (int32) val64;
+ /* could be an oversize integer as well as a float ... */
- if (val64 == (int64) val32)
- {
- val = Int32GetDatum(val32);
+ int64 val64;
+ char *endptr;
- typeid = INT4OID;
- typelen = sizeof(int32);
- typebyval = true;
+ errno = 0;
+ val64 = strtoi64(aconst->val.fval.fval, &endptr, 10);
+ if (errno == 0 && *endptr == '\0')
+ {
+ /*
+ * It might actually fit in int32. Probably only INT_MIN
+ * can occur, but we'll code the test generally just to be
+ * sure.
+ */
+ int32 val32 = (int32) val64;
+
+ if (val64 == (int64) val32)
+ {
+ val = Int32GetDatum(val32);
+
+ typeid = INT4OID;
+ typelen = sizeof(int32);
+ typebyval = true;
+ }
+ else
+ {
+ val = Int64GetDatum(val64);
+
+ typeid = INT8OID;
+ typelen = sizeof(int64);
+ typebyval = FLOAT8PASSBYVAL; /* int8 and float8 alike */
+ }
}
else
{
- val = Int64GetDatum(val64);
-
- typeid = INT8OID;
- typelen = sizeof(int64);
- typebyval = FLOAT8PASSBYVAL; /* int8 and float8 alike */
+ /* arrange to report location if numeric_in() fails */
+ setup_parser_errposition_callback(&pcbstate, pstate, aconst->location);
+ val = DirectFunctionCall3(numeric_in,
+ CStringGetDatum(aconst->val.fval.fval),
+ ObjectIdGetDatum(InvalidOid),
+ Int32GetDatum(-1));
+ cancel_parser_errposition_callback(&pcbstate);
+
+ typeid = NUMERICOID;
+ typelen = -1; /* variable len */
+ typebyval = false;
}
+ break;
}
- else
- {
- /* arrange to report location if numeric_in() fails */
- setup_parser_errposition_callback(&pcbstate, pstate, aconst->location);
- val = DirectFunctionCall3(numeric_in,
- CStringGetDatum(aconst->val.fval.fval),
- ObjectIdGetDatum(InvalidOid),
- Int32GetDatum(-1));
- cancel_parser_errposition_callback(&pcbstate);
-
- typeid = NUMERICOID;
- typelen = -1; /* variable len */
- typebyval = false;
- }
- break;
- }
case T_Boolean:
val = BoolGetDatum(boolVal(&aconst->val));