===== sql/field.cc 1.409 vs edited =====
--- 1.409/sql/field.cc	2007-08-13 21:39:23 +02:00
+++ edited/sql/field.cc	2007-08-24 10:47:27 +02:00
@@ -7622,6 +7622,13 @@
     ptr= (uchar*) from;
   }
   else
+#ifdef WORDS_BIGENDIAN
+  if (table->s->db_low_byte_first)
+  {
+    store_length(to,packlength,length,0);
+  }
+  else
+#endif
     memcpy(to,from,packlength);			// Copy length
   if (length)
   {
@@ -7658,8 +7665,17 @@
 
 const uchar *Field_blob::unpack(uchar *to, const uchar *from)
 {
-  memcpy(to,from,packlength);
   uint32 length=get_length(from);
+#ifdef WORDS_BIGENDIAN
+  if (table->s->db_low_byte_first)
+  {
+    store_length(to,packlength,length,1);
+  }
+  else
+#endif
+  {
+    memcpy(to,from,packlength);
+  }
   from+=packlength;
   if (length)
     memcpy_fixed(to+packlength, &from, sizeof(from));
