aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/adt/jsonpath_exec.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/utils/adt/jsonpath_exec.c')
-rw-r--r--src/backend/utils/adt/jsonpath_exec.c29
1 files changed, 15 insertions, 14 deletions
diff --git a/src/backend/utils/adt/jsonpath_exec.c b/src/backend/utils/adt/jsonpath_exec.c
index 8d83b2edb35..930bd265842 100644
--- a/src/backend/utils/adt/jsonpath_exec.c
+++ b/src/backend/utils/adt/jsonpath_exec.c
@@ -64,6 +64,7 @@
#include "funcapi.h"
#include "lib/stringinfo.h"
#include "miscadmin.h"
+#include "nodes/miscnodes.h"
#include "regex/regex.h"
#include "utils/builtins.h"
#include "utils/date.h"
@@ -1041,15 +1042,15 @@ executeItemOptUnwrapTarget(JsonPathExecContext *cxt, JsonPathItem *jsp,
char *tmp = DatumGetCString(DirectFunctionCall1(numeric_out,
NumericGetDatum(jb->val.numeric)));
double val;
- bool have_error = false;
+ ErrorSaveContext escontext = {T_ErrorSaveContext};
- val = float8in_internal_opt_error(tmp,
- NULL,
- "double precision",
- tmp,
- &have_error);
+ val = float8in_internal(tmp,
+ NULL,
+ "double precision",
+ tmp,
+ (Node *) &escontext);
- if (have_error || isinf(val) || isnan(val))
+ if (escontext.error_occurred || isinf(val) || isnan(val))
RETURN_ERROR(ereport(ERROR,
(errcode(ERRCODE_NON_NUMERIC_SQL_JSON_ITEM),
errmsg("numeric argument of jsonpath item method .%s() is out of range for type double precision",
@@ -1062,15 +1063,15 @@ executeItemOptUnwrapTarget(JsonPathExecContext *cxt, JsonPathItem *jsp,
double val;
char *tmp = pnstrdup(jb->val.string.val,
jb->val.string.len);
- bool have_error = false;
+ ErrorSaveContext escontext = {T_ErrorSaveContext};
- val = float8in_internal_opt_error(tmp,
- NULL,
- "double precision",
- tmp,
- &have_error);
+ val = float8in_internal(tmp,
+ NULL,
+ "double precision",
+ tmp,
+ (Node *) &escontext);
- if (have_error || isinf(val) || isnan(val))
+ if (escontext.error_occurred || isinf(val) || isnan(val))
RETURN_ERROR(ereport(ERROR,
(errcode(ERRCODE_NON_NUMERIC_SQL_JSON_ITEM),
errmsg("string argument of jsonpath item method .%s() is not a valid representation of a double precision number",