Skip to content

Commit

Permalink
fix conversion of varchar to binary varbinary and vice versa (babelfi…
Browse files Browse the repository at this point in the history
…sh-for-postgresql#248)

Release syscache reference when returning not null nodes from string literal hook to avoid cache reference leak

Engine PR: babelfish-for-postgresql#248
Extension PR: babelfish-for-postgresql/babelfish_extensions#1957

Task: 1940
Signed-off-by: Tanzeel Khan <[email protected]>
  • Loading branch information
tanscorpio7 authored and Jason Teng committed Nov 17, 2023
1 parent 19c6eca commit 5dad5ed
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/backend/parser/parse_coerce.c
Original file line number Diff line number Diff line change
Expand Up @@ -334,9 +334,11 @@ coerce_type(ParseState *pstate, Node *node,
targetTypeMod, baseTypeMod,
newcon, DatumGetCString(con->constvalue),
ccontext, cformat, location);
if (result) /* runtimer error function returned */
if (result)
{
ReleaseSysCache(baseType);
return result;

}
/*
* If the result is NULL, the newcon should be already updated properly.
* Keep advancing the code.
Expand Down

0 comments on commit 5dad5ed

Please sign in to comment.