Skip to content

Commit 15e46fd

Browse files
committed
Fix bug in record_image_ops on big endian machines.
The buildfarm pointed out the problem. Fix based on suggestion by Robert Haas.
1 parent 4d212ba commit 15e46fd

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/backend/utils/adt/rowtypes.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1464,9 +1464,8 @@ record_image_cmp(PG_FUNCTION_ARGS)
14641464
}
14651465
else if (tupdesc1->attrs[i1]->attbyval)
14661466
{
1467-
cmpresult = memcmp(&(values1[i1]),
1468-
&(values2[i2]),
1469-
tupdesc1->attrs[i1]->attlen);
1467+
if (values1[i1] != values2[i2])
1468+
cmpresult = (values1[i1] < values2[i2]) ? -1 : 1;
14701469
}
14711470
else
14721471
{
@@ -1695,9 +1694,7 @@ record_image_eq(PG_FUNCTION_ARGS)
16951694
}
16961695
else if (tupdesc1->attrs[i1]->attbyval)
16971696
{
1698-
result = (memcmp(&(values1[i1]),
1699-
&(values2[i2]),
1700-
tupdesc1->attrs[i1]->attlen) == 0);
1697+
result = (values1[i1] == values2[i2]);
17011698
}
17021699
else
17031700
{

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy