Skip to content

Commit

Permalink
Rebased to master
Browse files Browse the repository at this point in the history
  • Loading branch information
muhammadshoaib committed Nov 1, 2023
1 parent a658cae commit 73bc918
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/backend/utils/adt/agtype.c
Original file line number Diff line number Diff line change
Expand Up @@ -5627,7 +5627,7 @@ Datum age_tointeger(PG_FUNCTION_ARGS)

/* convert it if it is a regular integer string */
result = strtoi64(string, &endptr, 10);

/*
* If it isn't an integer string, try converting it as a float
* string.
Expand All @@ -5647,7 +5647,9 @@ Datum age_tointeger(PG_FUNCTION_ARGS)
*/
if (!is_valid || isnan(f) || isinf(f) ||
f < PG_INT64_MIN || f > (double)PG_INT64_MAX)
{
PG_RETURN_NULL();
}

result = (int64) f;
}
Expand Down
2 changes: 1 addition & 1 deletion src/backend/utils/adt/agtype_parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ bool is_valid_agtype_number(const char *str, int len)
agtype_lex_context *make_agtype_lex_context(text *t, bool need_escapes)
{
return make_agtype_lex_context_cstring_len(
VARDATA_ANY(t), VARSIZE_ANY_EXHDR(t), need_escapes);
VARDATA_ANY(t), VARSIZE_ANY_EXHDR(t), need_escapes);
}

agtype_lex_context *make_agtype_lex_context_cstring_len(char *str, int len,
Expand Down

0 comments on commit 73bc918

Please sign in to comment.