0001-in-JsonExprState-just-store-a-pointer-to-the-input-F.patch
text/x-patch
Filename: 0001-in-JsonExprState-just-store-a-pointer-to-the-input-F.patch
Type: text/x-patch
Part: 0
Patch
Format: format-patch
Series: patch 0001
Subject: in JsonExprState just store a pointer to the input FmgrInfo
| File | + | − |
|---|---|---|
| src/backend/executor/execExpr.c | 4 | 1 |
| src/backend/executor/execExprInterp.c | 1 | 1 |
| src/include/executor/execExpr.h | 1 | 1 |
From 7c0d831f3baf6fb6ec27d1e033209535945e4858 Mon Sep 17 00:00:00 2001
From: Andrew Dunstan <andrew@dunslane.net>
Date: Mon, 18 Jul 2022 11:03:13 -0400
Subject: [PATCH 1/3] in JsonExprState just store a pointer to the input
FmgrInfo
---
src/backend/executor/execExpr.c | 5 ++++-
src/backend/executor/execExprInterp.c | 2 +-
src/include/executor/execExpr.h | 2 +-
3 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/src/backend/executor/execExpr.c b/src/backend/executor/execExpr.c
index c8d7145fe3..a55e5000e2 100644
--- a/src/backend/executor/execExpr.c
+++ b/src/backend/executor/execExpr.c
@@ -2606,11 +2606,14 @@ ExecInitExprRec(Expr *node, ExprState *state,
(jexpr->result_coercion && jexpr->result_coercion->via_io))
{
Oid typinput;
+ FmgrInfo *finfo;
/* lookup the result type's input function */
getTypeInputInfo(jexpr->returning->typid, &typinput,
&jsestate->input.typioparam);
- fmgr_info(typinput, &jsestate->input.func);
+ finfo = palloc0(sizeof(FmgrInfo));
+ fmgr_info(typinput, finfo);
+ jsestate->input.finfo = finfo;
}
jsestate->args = NIL;
diff --git a/src/backend/executor/execExprInterp.c b/src/backend/executor/execExprInterp.c
index 723770fda0..0512a81c7c 100644
--- a/src/backend/executor/execExprInterp.c
+++ b/src/backend/executor/execExprInterp.c
@@ -4664,7 +4664,7 @@ ExecEvalJsonExprCoercion(ExprEvalStep *op, ExprContext *econtext,
/* strip quotes and call typinput function */
char *str = *isNull ? NULL : JsonbUnquote(jb);
- return InputFunctionCall(&jsestate->input.func, str,
+ return InputFunctionCall(jsestate->input.finfo, str,
jsestate->input.typioparam,
jexpr->returning->typmod);
}
diff --git a/src/include/executor/execExpr.h b/src/include/executor/execExpr.h
index 1e3f1bbee8..e55a572854 100644
--- a/src/include/executor/execExpr.h
+++ b/src/include/executor/execExpr.h
@@ -754,7 +754,7 @@ typedef struct JsonExprState
struct
{
- FmgrInfo func; /* typinput function for output type */
+ FmgrInfo *finfo; /* typinput function for output type */
Oid typioparam;
} input; /* I/O info for output type */
--
2.34.1