From 9cbc7792e6ebab1fce1d0aed8d1319d4a05aac8d Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 28 Aug 2007 07:42:43 +0200 Subject: Bug#29549 rpl_ndb_myisam2ndb,rpl_ndb_innodb2ndb failed on Solaris for pack_length issue sql/field.cc: Bug#29549 rpl_ndb_myisam2ndb,rpl_ndb_innodb2ndb failed on Solaris for pack_length issue - correct previous patch --- sql/field.cc | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'sql/field.cc') diff --git a/sql/field.cc b/sql/field.cc index c8e1572d60f..ed1877fca78 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -7616,19 +7616,16 @@ uchar *Field_blob::pack(uchar *to, const uchar *from, uint max_length) uint32 length=get_length(); // Length of from string if (length > max_length) { - ptr=to; length=max_length; - store_length(length); // Store max length - ptr= (uchar*) from; + store_length(to,packlength,length,TRUE); } - else #ifdef WORDS_BIGENDIAN - if (table->s->db_low_byte_first) + else if (!table->s->db_low_byte_first) { - store_length(to,packlength,length,0); + store_length(to,packlength,length,TRUE); } - else #endif + else memcpy(to,from,packlength); // Copy length if (length) { @@ -7667,9 +7664,9 @@ const uchar *Field_blob::unpack(uchar *to, const uchar *from) { uint32 length=get_length(from); #ifdef WORDS_BIGENDIAN - if (table->s->db_low_byte_first) + if (!table->s->db_low_byte_first) { - store_length(to,packlength,length,1); + store_length(to,packlength,length,FALSE); } else #endif -- cgit v1.2.1 From 413a59a3bcf64bffe39ae26c72cf3d98140fc281 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 28 Aug 2007 10:37:29 +0200 Subject: A fix for handling endianess in Field_blob::unpack(). sql/field.cc: Changed per Tomas` request. --- sql/field.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sql/field.cc') diff --git a/sql/field.cc b/sql/field.cc index ed1877fca78..816f4e68957 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -7662,7 +7662,7 @@ const uchar *Field_blob::unpack(uchar *to, const uchar *Field_blob::unpack(uchar *to, const uchar *from) { - uint32 length=get_length(from); + uint32 length=get_length(from,TRUE); #ifdef WORDS_BIGENDIAN if (!table->s->db_low_byte_first) { -- cgit v1.2.1 From d27ec7a5e7ffe02b1f42488e7f50b10c4c79e731 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 29 Aug 2007 09:44:37 +0200 Subject: Bug#29549 rpl_ndb_myisam2ndb,rpl_ndb_innodb2ndb failed on Solaris for pack_length issue - reverting patch as there where unknows sideeffects that we do not have time to follow up on just now --- sql/field.cc | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) (limited to 'sql/field.cc') diff --git a/sql/field.cc b/sql/field.cc index 816f4e68957..651bada28f6 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -7619,12 +7619,6 @@ uchar *Field_blob::pack(uchar *to, const uchar *from, uint max_length) length=max_length; store_length(to,packlength,length,TRUE); } -#ifdef WORDS_BIGENDIAN - else if (!table->s->db_low_byte_first) - { - store_length(to,packlength,length,TRUE); - } -#endif else memcpy(to,from,packlength); // Copy length if (length) @@ -7662,17 +7656,8 @@ const uchar *Field_blob::unpack(uchar *to, const uchar *Field_blob::unpack(uchar *to, const uchar *from) { - uint32 length=get_length(from,TRUE); -#ifdef WORDS_BIGENDIAN - if (!table->s->db_low_byte_first) - { - store_length(to,packlength,length,FALSE); - } - else -#endif - { - memcpy(to,from,packlength); - } + uint32 length=get_length(from); + memcpy(to,from,packlength); from+=packlength; if (length) memcpy_fixed(to+packlength, &from, sizeof(from)); -- cgit v1.2.1