Fix bug in record_image_ops on big endian machines.

The buildfarm pointed out the problem.

Fix based on suggestion by Robert Haas.
This commit is contained in:
Kevin Grittner 2013-10-10 11:23:31 -05:00
parent 4d212bac17
commit 15e46fd1dd
1 changed files with 3 additions and 6 deletions

View File

@ -1464,9 +1464,8 @@ record_image_cmp(PG_FUNCTION_ARGS)
}
else if (tupdesc1->attrs[i1]->attbyval)
{
cmpresult = memcmp(&(values1[i1]),
&(values2[i2]),
tupdesc1->attrs[i1]->attlen);
if (values1[i1] != values2[i2])
cmpresult = (values1[i1] < values2[i2]) ? -1 : 1;
}
else
{
@ -1695,9 +1694,7 @@ record_image_eq(PG_FUNCTION_ARGS)
}
else if (tupdesc1->attrs[i1]->attbyval)
{
result = (memcmp(&(values1[i1]),
&(values2[i2]),
tupdesc1->attrs[i1]->attlen) == 0);
result = (values1[i1] == values2[i2]);
}
else
{