Fix alignment issue in DatumToBytea

(cherry picked from commit 2fca5ff3b5)
pull/5009/head
Hadi Moshayedi 2021-02-16 13:41:57 -08:00 committed by Halil Ozan Akgul
parent 39a142b4d9
commit 495470d291
1 changed files with 5 additions and 1 deletions

View File

@ -1087,7 +1087,11 @@ DatumToBytea(Datum value, Form_pg_attribute attrForm)
{ {
if (attrForm->attbyval) if (attrForm->attbyval)
{ {
store_att_byval(VARDATA(result), value, attrForm->attlen); Datum tmp;
store_att_byval(&tmp, value, attrForm->attlen);
memcpy_s(VARDATA(result), datumLength + VARHDRSZ,
&tmp, attrForm->attlen);
} }
else else
{ {