Skip to content

Commit

Permalink
Fix issue #23.
Browse files Browse the repository at this point in the history
ifxConvertNodeConst() calls varcharin() directly, but misunderstood
the function call conventions of varcharin() which wants to have three
arguments. So instead of DirectFunctionCall2() use DirectFunctionCall3()
and pass InvalidOid as the second type OID parameter.

See also issue #23 for details.

Reported by github user novakka4096.
  • Loading branch information
Bernd Helmle committed Oct 1, 2018
1 parent 857e183 commit e7b2d41
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions ifx_conv.c
Original file line number Diff line number Diff line change
Expand Up @@ -2328,8 +2328,9 @@ static Const *ifxConvertNodeConst(Const *oldNode, bool *converted,
if (oldNode->constisnull)
datVal= PointerGetDatum(NULL);
else
datVal = DirectFunctionCall2(varcharin,
datVal = DirectFunctionCall3(varcharin,
CStringGetDatum(TextDatumGetCString(oldNode->constvalue)),
InvalidOid,
oldNode->consttypmod);

newNode = makeConst(VARCHAROID,
Expand Down Expand Up @@ -2360,8 +2361,9 @@ static Const *ifxConvertNodeConst(Const *oldNode, bool *converted,
if (oldNode->constisnull)
datVal = PointerGetDatum(NULL);
else
datVal = DirectFunctionCall2(varcharin,
datVal = DirectFunctionCall3(varcharin,
CStringGetDatum(text_to_cstring(DatumGetTextP(oldNode->constvalue))),
InvalidOid,
oldNode->consttypmod);

if (oldNode->consttypmod == -1)
Expand Down

0 comments on commit e7b2d41

Please sign in to comment.