summaryrefslogtreecommitdiff
path: root/storage/connect/connect.cc
diff options
context:
space:
mode:
Diffstat (limited to 'storage/connect/connect.cc')
-rw-r--r--storage/connect/connect.cc10
1 files changed, 10 insertions, 0 deletions
diff --git a/storage/connect/connect.cc b/storage/connect/connect.cc
index cc95ff0cacc..d7b8b466d50 100644
--- a/storage/connect/connect.cc
+++ b/storage/connect/connect.cc
@@ -801,7 +801,12 @@ RCODE CntIndexRead(PGLOBAL g, PTDB ptdb, OPVAL op,
if (!valp->IsTypeNum()) {
if (colp->GetColUse(U_VAR)) {
+#if defined(WORDS_BIGENDIAN)
+ ((char*)&lg)[0]= ((char*)kp)[1];
+ ((char*)&lg)[1]= ((char*)kp)[0];
+#else // !WORDS_BIGENDIAN
lg= *(short*)kp;
+#endif //!WORDS_BIGENDIAN
kp+= sizeof(short);
rcb= valp->SetValue_char(kp, (int)lg);
} else
@@ -919,7 +924,12 @@ int CntIndexRange(PGLOBAL g, PTDB ptdb, const uchar* *key, uint *len,
if (!valp->IsTypeNum()) {
if (colp->GetColUse(U_VAR)) {
+#if defined(WORDS_BIGENDIAN)
+ ((char*)&lg)[0]= ((char*)kp)[1];
+ ((char*)&lg)[1]= ((char*)kp)[0];
+#else // !WORDS_BIGENDIAN
lg= *(short*)p;
+#endif //!WORDS_BIGENDIAN
p+= sizeof(short);
rcb= valp->SetValue_char((char*)p, (int)lg);
} else