diff options
author | Andrew Dunstan <andrew@dunslane.net> | 2022-04-15 07:47:12 -0400 |
---|---|---|
committer | Andrew Dunstan <andrew@dunslane.net> | 2022-04-15 07:49:20 -0400 |
commit | f7a605f636d62935b80f9905575d40bc4eeca5ae (patch) | |
tree | 58f88216d9b7989be87bdf76280e737426021f12 /src | |
parent | 5cd1c40b3ce9600f129fd1fea9850e1affaf31d5 (diff) | |
download | postgresql-f7a605f636d62935b80f9905575d40bc4eeca5ae.tar.gz postgresql-f7a605f636d62935b80f9905575d40bc4eeca5ae.zip |
Small cleanups in SQL/JSON code
These are to keep Coverity happy. In one case remove a redundant NULL
check, and in another explicitly ignore a function result that is already
known.
Diffstat (limited to 'src')
-rw-r--r-- | src/backend/parser/parse_expr.c | 2 | ||||
-rw-r--r-- | src/backend/utils/adt/jsonb.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/backend/parser/parse_expr.c b/src/backend/parser/parse_expr.c index 5fc0b1763c8..33eb19a33fc 100644 --- a/src/backend/parser/parse_expr.c +++ b/src/backend/parser/parse_expr.c @@ -3569,7 +3569,7 @@ coerceJsonFuncExpr(ParseState *pstate, Node *expr, location = exprLocation(expr); if (location < 0) - location = returning ? returning->format->location : -1; + location = returning->format->location; /* special case for RETURNING bytea FORMAT json */ if (returning->format->format_type == JS_FORMAT_JSON && diff --git a/src/backend/utils/adt/jsonb.c b/src/backend/utils/adt/jsonb.c index 56c588bbabd..26d81366c9f 100644 --- a/src/backend/utils/adt/jsonb.c +++ b/src/backend/utils/adt/jsonb.c @@ -2264,7 +2264,7 @@ JsonbUnquote(Jsonb *jb) { JsonbValue v; - JsonbExtractScalar(&jb->root, &v); + (void) JsonbExtractScalar(&jb->root, &v); if (v.type == jbvString) return pnstrdup(v.val.string.val, v.val.string.len); |