Skip to content

Commit 4821cd9

Browse files
committed
Fix swapping key numeric values on Big Endian machines.
Fix typo error in CntIndexRange for big endian swapping modified: storage/connect/connect.cc
1 parent 37a803c commit 4821cd9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

storage/connect/connect.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -925,8 +925,8 @@ int CntIndexRange(PGLOBAL g, PTDB ptdb, const uchar* *key, uint *len,
925925
if (!valp->IsTypeNum()) {
926926
if (colp->GetColUse(U_VAR)) {
927927
#if defined(WORDS_BIGENDIAN)
928-
((char*)&lg)[0]= ((char*)kp)[1];
929-
((char*)&lg)[1]= ((char*)kp)[0];
928+
((char*)&lg)[0]= ((char*)p)[1];
929+
((char*)&lg)[1]= ((char*)p)[0];
930930
#else // !WORDS_BIGENDIAN
931931
lg= *(short*)p;
932932
#endif //!WORDS_BIGENDIAN

0 commit comments

Comments
 (0)