diff options
Diffstat (limited to 'sql/field.cc')
-rw-r--r-- | sql/field.cc | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/sql/field.cc b/sql/field.cc index 23dca96164e..c8e1572d60f 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -7622,6 +7622,13 @@ uchar *Field_blob::pack(uchar *to, const uchar *from, uint max_length) 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 *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)); |