List:Commits« Previous MessageNext Message »
From:Mats Kindahl Date:September 6 2007 8:05pm
Subject:bk commit into 5.1 tree (mats:1.2571) BUG#29549
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of mats. When mats does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet@stripped, 2007-09-06 22:05:03+02:00, mats@stripped +4 -0
  BUG#29549 (Endians: test failures on Solaris):
  
  Refactoring code to add parameter to pack() and unpack() functions with
  purpose of indicating if data should be packed in little-endian or
  native order. Using new functions to always pack data for binary log
  in little-endian order.
  
  Eliminating several versions of virtual pack() and unpack() functions
  in favor for one single virtual function which is overridden in subclasses.

  sql/field.cc@stripped, 2007-09-06 22:04:52+02:00, mats@stripped +145 -109
    Eliminating all two-argument pack() and unpack() functions and moving
    functionality into the four-argument version.
    
    Using pad_char for the field instead of spaces when unpacking.
    
    Adding some Doxygen documentation.

  sql/field.h@stripped, 2007-09-06 22:04:52+02:00, mats@stripped +50 -30
    Eliminating all virtual pack() and unpack() functions except the four-
    argument version, which now is the function that shall be overridden.
    The two-argument versions are convenience functions, to prevent changes
    to code that uses these.

  sql/log_event.cc@stripped, 2007-09-06 22:04:53+02:00, mats@stripped +2 -0
    Adding missing #ifndef causing compile failure.

  sql/rpl_record.cc@stripped, 2007-09-06 22:04:53+02:00, mats@stripped +5 -31
    Debriding code. Using new pack() and unpack() functions to always pack
    fields little-endian.

diff -Nrup a/sql/field.cc b/sql/field.cc
--- a/sql/field.cc	2007-08-13 21:39:23 +02:00
+++ b/sql/field.cc	2007-09-06 22:04:52 +02:00
@@ -1373,11 +1373,57 @@ int Field::store(const char *to, uint le
 
 
 /**
+   Pack the field into a format suitable for storage and transfer.
+
+   To implement packing functionality, only the virtual function
+   should be overridden. The other functions are just convenience
+   functions and hence should not be overridden.
+
+   The value of <code>low_byte_first</code> is dependent on how the
+   packed data is going to be used: for local use, e.g., temporary
+   store on disk or in memory, use the native format since that is
+   faster. For data that is going to be transfered to other machines
+   (e.g., when writing data to the binary log), data should always be
+   stored in little-endian format.
+
+   @note The default method for packing fields just copy the raw bytes
+   of the record into the destination, but never more than
+   <code>max_length</code> characters.
+
+   @param to
+   Pointer to memory area where representation of field should be put.
+
+   @param from
+   Pointer to memory area where record representation of field is
+   stored.
+
+   @param max_length
+   Maximum length of the field, as given in the column definition. For
+   example, for <code>CHAR(1000)</code>, the <code>max_length</code>
+   is 1000. This information is sometimes needed to decide how to pack
+   the data.
+
+   @param low_byte_first
+   @c TRUE if integers should be stored little-endian, @c FALSE if
+   native format should be used.
+*/
+uchar *Field::pack(uchar *to, const uchar *from,
+                   uint max_length, bool low_byte_first)
+{
+  uint32 length= pack_length();
+  set_if_smaller(length, max_length);
+  memcpy(to, from, length);
+  return to+length;
+}
+
+/**
    Unpack a field from row data.
 
-   This method is used to unpack a field from a master whose size 
-   of the field is less than that of the slave.
-  
+   This method is used to unpack a field from a master whose size of
+   the field is less than that of the slave.
+
+   This is the default method for unpacking a field.
+
    @param   to         Destination of the data
    @param   from       Source of the data
    @param   param_data Pack length of the field data
@@ -1386,7 +1432,8 @@ int Field::store(const char *to, uint le
 */
 const uchar *Field::unpack(uchar* to,
                            const uchar *from, 
-                           uint param_data)
+                           uint param_data,
+                           bool /* low_byte_first */)
 {
   uint length=pack_length();
   int from_type= 0;
@@ -1401,17 +1448,14 @@ const uchar *Field::unpack(uchar* to,
   }
   uint len= (param_data && (param_data < length)) ?
             param_data : length;
-  /*
-    If the length is the same, use old unpack method.
-    If the param_data is 0, use the old unpack method.
-      This is possible if the table map was generated from a down-level
-      master or if the data was not available on the master.
-    If the real_types are not the same, use the old unpack method.
-  */
+
   if ((length == param_data) ||
       (param_data == 0) ||
       (from_type != real_type()))
-    return(unpack(to, from));
+  {
+    memcpy(to, from, length);
+    return from+length;
+  }
   memcpy(to, from, param_data > length ? length : len);
   return from+len;
 }
@@ -2716,8 +2760,16 @@ uint Field_new_decimal::is_equal(Create_
 */
 const uchar *Field_new_decimal::unpack(uchar* to, 
                                        const uchar *from, 
-                                       uint param_data)
+                                       uint param_data,
+                                       bool /* low_byte_first */)
 {
+  if (param_data == 0)
+  {
+    uint const length= pack_length();
+    memcpy(to, from, pack_length());
+    return from + length;
+  }
+
   uint from_precision= (param_data & 0xff00) >> 8U;
   uint from_decimal= param_data & 0x00ff;
   uint length=pack_length();
@@ -6355,7 +6407,9 @@ void Field_string::sql_type(String &res)
 }
 
 
-uchar *Field_string::pack(uchar *to, const uchar *from, uint max_length)
+uchar *Field_string::pack(uchar *to, const uchar *from,
+                          uint max_length,
+                          bool /* low_byte_first */)
 {
   uint length=      min(field_length,max_length);
   uint local_char_length= max_length/field_charset->mbmaxlen;
@@ -6363,11 +6417,15 @@ uchar *Field_string::pack(uchar *to, con
     local_char_length= my_charpos(field_charset, from, from+length,
                                   local_char_length);
   set_if_smaller(length, local_char_length);
-  while (length && from[length-1] == ' ')
+  while (length && from[length-1] == field_charset->pad_char)
     length--;
+
+  // Length always stored little-endian
   *to++= (uchar) length;
   if (field_length > 255)
     *to++= (uchar) (length >> 8);
+
+  // Store the actual bytes of the string
   memcpy(to, from, length);
   return to+length;
 }
@@ -6391,32 +6449,24 @@ uchar *Field_string::pack(uchar *to, con
 */
 const uchar *Field_string::unpack(uchar *to,
                                   const uchar *from,
-                                  uint param_data)
-{
-  uint from_len= param_data & 0x00ff;                 // length.
-  uint length= 0;
-  uint f_length;
-  f_length= (from_len < field_length) ? from_len : field_length;
-  DBUG_ASSERT(f_length <= 255);
-  length= (uint) *from++;
-  bitmap_set_bit(table->write_set,field_index);
-  store((const char *)from, length, system_charset_info);
-  return from+length;
-}
-
-
-const uchar *Field_string::unpack(uchar *to, const uchar *from)
+                                  uint param_data,
+                                  bool /* low_byte_first */)
 {
+  uint from_length=
+    param_data ? min(param_data & 0x00ff, field_length) : field_length;
   uint length;
-  if (field_length > 255)
+
+  if (from_length > 255)
   {
     length= uint2korr(from);
     from+= 2;
   }
   else
     length= (uint) *from++;
-  memcpy(to, from, (int) length);
-  bfill(to+length, field_length - length, ' ');
+
+  memcpy(to, from, length);
+  // Pad the string with the pad character of the fields charset
+  bfill(to + length, field_length - length, field_charset->pad_char);
   return from+length;
 }
 
@@ -6796,16 +6846,22 @@ uint32 Field_varstring::data_length()
   Here the number of length bytes are depending on the given max_length
 */
 
-uchar *Field_varstring::pack(uchar *to, const uchar *from, uint max_length)
+uchar *Field_varstring::pack(uchar *to, const uchar *from,
+                             uint max_length,
+                             bool /* low_byte_first */)
 {
   uint length= length_bytes == 1 ? (uint) *from : uint2korr(from);
   set_if_smaller(max_length, field_length);
   if (length > max_length)
     length=max_length;
-  *to++= (char) (length & 255);
+
+  /* Length always stored little-endian */
+  *to++= length & 0xFF;
   if (max_length > 255)
-    *to++= (char) (length >> 8);
-  if (length)
+    *to++= (length >> 8) & 0xFF;
+
+  /* Store bytes of string */
+  if (length > 0)
     memcpy(to, from+length_bytes, length);
   return to+length;
 }
@@ -6851,7 +6907,8 @@ uchar *Field_varstring::pack_key(uchar *
 */
 
 const uchar *Field_varstring::unpack_key(uchar *to, const uchar *key,
-                                         uint max_length)
+                                         uint max_length,
+                                         bool /* low_byte_first */)
 {
   /* get length of the blob key */
   uint32 length= *key++;
@@ -6901,6 +6958,9 @@ uchar *Field_varstring::pack_key_from_ke
 
    This method is used to unpack a varstring field from a master
    whose size of the field is less than that of the slave.
+
+   @note
+   The string length is always packed little-endian.
   
    @param   to         Destination of the data
    @param   from       Source of the data
@@ -6910,7 +6970,8 @@ uchar *Field_varstring::pack_key_from_ke
 */
 const uchar *Field_varstring::unpack(uchar *to, 
                                      const uchar *from,
-                                     uint param_data)
+                                     uint param_data,
+                                     bool /* low_byte_first */)
 {
   uint length;
   uint l_bytes= (param_data && (param_data < field_length)) ? 
@@ -6922,28 +6983,7 @@ const uchar *Field_varstring::unpack(uch
     if (length_bytes == 2)
       to[1]= 0;
   }
-  else
-  {
-    length= uint2korr(from);
-    to[0]= *from++;
-    to[1]= *from++;
-  }
-  if (length)
-    memcpy(to+ length_bytes, from, length);
-  return from+length;
-}
-
-
-/*
-  unpack field packed with Field_varstring::pack()
-*/
-
-const uchar *Field_varstring::unpack(uchar *to, const uchar *from)
-{
-  uint length;
-  if (length_bytes == 1)
-    length= (uint) (*to= *from++);
-  else
+  else /* l_bytes == 2 */
   {
     length= uint2korr(from);
     to[0]= *from++;
@@ -7608,22 +7648,23 @@ void Field_blob::sql_type(String &res) c
   }
 }
 
-
-uchar *Field_blob::pack(uchar *to, const uchar *from, uint max_length)
+uchar *Field_blob::pack(uchar *to, const uchar *from,
+                        uint max_length, bool low_byte_first)
 {
   uchar *save= ptr;
   ptr= (uchar*) from;
   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;
-  }
-  else
-    memcpy(to,from,packlength);			// Copy length
-  if (length)
+  /*
+    Store max length, which will occupy packlength bytes. If the max
+    length given is smaller than the actual length of the blob, we
+    just store the initial bytes of the blob.
+  */
+  store_length(to, packlength, min(length, max_length), low_byte_first);
+
+  /*
+    Store the actual blob data, which will occupy 'length' bytes.
+   */
+  if (length > 0)
   {
     get_ptr((uchar**) &from);
     memcpy(to+packlength, from,length);
@@ -7644,19 +7685,13 @@ uchar *Field_blob::pack(uchar *to, const
 
    @param   to         Destination of the data
    @param   from       Source of the data
-   @param   param_data <not used>
 
    @return  New pointer into memory based on from + length of the data
 */
 const uchar *Field_blob::unpack(uchar *to, 
                                 const uchar *from,
-                                uint param_data)
-{
-  return unpack(to, from);
-}
-
-
-const uchar *Field_blob::unpack(uchar *to, const uchar *from)
+                                uint /* param_data */,
+                                bool /* low_byte_first */)
 {
   memcpy(to,from,packlength);
   uint32 length=get_length(from);
@@ -7761,7 +7796,8 @@ uchar *Field_blob::pack_key(uchar *to, c
 */
 
 const uchar *Field_blob::unpack_key(uchar *to, const uchar *from,
-                                    uint max_length)
+                                    uint max_length,
+                                    bool /* low_byte_first */)
 {
   /* get length of the blob key */
   uint32 length= *from++;
@@ -8672,9 +8708,11 @@ void Field_bit::sql_type(String &res) co
 }
 
 
-uchar *Field_bit::pack(uchar *to, const uchar *from, uint max_length)
+uchar *Field_bit::pack(uchar *to, const uchar *from,
+                       uint max_length,
+                       bool /* low_byte_first */)
 {
-  DBUG_ASSERT(max_length);
+  DBUG_ASSERT(max_length > 0);
   uint length;
   if (bit_len > 0)
   {
@@ -8720,17 +8758,34 @@ uchar *Field_bit::pack(uchar *to, const 
 */
 const uchar *Field_bit::unpack(uchar *to,
                                const uchar *from,
-                               uint param_data)
+                               uint param_data,
+                               bool /* low_byte_first */)
 {
   uint const from_len= (param_data >> 8U) & 0x00ff;
   uint const from_bit_len= param_data & 0x00ff;
   /*
-    If the master and slave have the same sizes, then use the old
-    unpack() method.
+    If the parameter data is undefined, or if the master and slave
+    have the same sizes, then use the old unpack() method.
   */
-  if ((from_bit_len == bit_len) &&
-      (from_len == bytes_in_rec)) 
-    return(unpack(to, from));
+  if (param_data == 0 ||
+      (from_bit_len == bit_len) && (from_len == bytes_in_rec))
+  {
+    if (bit_len > 0)
+    {
+      /*
+        set_rec_bits is a macro, don't put the post-increment in the
+        argument since that might cause strange side-effects.
+
+        For the choice of the second argument, see the explanation for
+        Field_bit::pack().
+      */
+      set_rec_bits(*from, bit_ptr + (to - ptr), bit_ofs, bit_len);
+      from++;
+    }
+    memcpy(to, from, bytes_in_rec);
+    return from + bytes_in_rec;
+  }
+
   /*
     We are converting a smaller bit field to a larger one here.
     To do that, we first need to construct a raw value for the original
@@ -8755,25 +8810,6 @@ const uchar *Field_bit::unpack(uchar *to
   store(value, new_len, system_charset_info);
   my_afree(value);
   return from + len;
-}
-
-
-const uchar *Field_bit::unpack(uchar *to, const uchar *from)
-{
-  if (bit_len > 0)
-  {
-    /*
-      set_rec_bits is a macro, don't put the post-increment in the
-      argument since that might cause strange side-effects.
-
-      For the choice of the second argument, see the explanation for
-      Field_bit::pack().
-    */
-    set_rec_bits(*from, bit_ptr + (to - ptr), bit_ofs, bit_len);
-    from++;
-  }
-  memcpy(to, from, bytes_in_rec);
-  return from + bytes_in_rec;
 }
 
 
diff -Nrup a/sql/field.h b/sql/field.h
--- a/sql/field.h	2007-08-04 11:08:07 +02:00
+++ b/sql/field.h	2007-09-06 22:04:52 +02:00
@@ -339,32 +339,45 @@ public:
     return str;
   }
   virtual bool send_binary(Protocol *protocol);
-  virtual uchar *pack(uchar *to, const uchar *from, uint max_length=~(uint) 0)
+
+  virtual uchar *pack(uchar *to, const uchar *from,
+                      uint max_length, bool low_byte_first);
+  /**
+     @overload Field::pack(uchar*, const uchar*, uint, bool)
+  */
+  uchar *pack(uchar *to, const uchar *from)
   {
-    uint32 length=pack_length();
-    memcpy(to,from,length);
-    return to+length;
+    DBUG_ENTER("Field::pack");
+    uchar *result= this->pack(to, from, UINT_MAX, table->s->db_low_byte_first);
+    DBUG_RETURN(result);
   }
-  virtual const uchar *unpack(uchar* to, const uchar *from, uint param_data);
-  virtual const uchar *unpack(uchar* to, const uchar *from)
+
+  virtual const uchar *unpack(uchar* to, const uchar *from,
+                              uint param_data, bool low_byte_first);
+  /**
+     @overload Field::unpack(uchar*, const uchar*, uint, bool)
+  */
+  const uchar *unpack(uchar* to, const uchar *from)
   {
-    uint length=pack_length();
-    memcpy(to,from,length);
-    return from+length;
+    DBUG_ENTER("Field::unpack");
+    const uchar *result= unpack(to, from, 0U, table->s->db_low_byte_first);
+    DBUG_RETURN(result);
   }
-  virtual uchar *pack_key(uchar* to, const uchar *from, uint max_length)
+
+  virtual uchar *pack_key(uchar* to, const uchar *from,
+                          uint max_length, bool low_byte_first)
   {
-    return pack(to,from,max_length);
+    return pack(to, from, max_length, low_byte_first);
   }
   virtual uchar *pack_key_from_key_image(uchar* to, const uchar *from,
-					uint max_length)
+					uint max_length, bool low_byte_first)
   {
-    return pack(to,from,max_length);
+    return pack(to, from, max_length, low_byte_first);
   }
   virtual const uchar *unpack_key(uchar* to, const uchar *from,
-                                  uint max_length)
+                                  uint max_length, bool low_byte_first)
   {
-    return unpack(to,from);
+    return unpack(to, from, max_length, low_byte_first);
   }
   virtual uint packed_col_length(const uchar *to, uint length)
   { return length;}
@@ -629,7 +642,8 @@ public:
   uint size_of() const { return sizeof(*this); } 
   uint32 pack_length() const { return (uint32) bin_size; }
   uint is_equal(Create_field *new_field);
-  virtual const uchar *unpack(uchar* to, const uchar *from, uint param_data);
+  virtual const uchar *unpack(uchar* to, const uchar *from,
+                              uint param_data, bool low_byte_first);
 };
 
 
@@ -1176,9 +1190,10 @@ public:
   int cmp(const uchar *,const uchar *);
   void sort_string(uchar *buff,uint length);
   void sql_type(String &str) const;
-  uchar *pack(uchar *to, const uchar *from, uint max_length=~(uint) 0);
-  virtual const uchar *unpack(uchar* to, const uchar *from, uint param_data);
-  const uchar *unpack(uchar* to, const uchar *from);
+  virtual uchar *pack(uchar *to, const uchar *from,
+                      uint max_length, bool low_byte_first);
+  virtual const uchar *unpack(uchar* to, const uchar *from,
+                              uint param_data, bool low_byte_first);
   int pack_cmp(const uchar *a,const uchar *b,uint key_length,
                my_bool insert_or_update);
   int pack_cmp(const uchar *b,uint key_length,my_bool insert_or_update);
@@ -1250,13 +1265,15 @@ public:
   uint get_key_image(uchar *buff,uint length, imagetype type);
   void set_key_image(const uchar *buff,uint length);
   void sql_type(String &str) const;
-  uchar *pack(uchar *to, const uchar *from, uint max_length=~(uint) 0);
+  virtual uchar *pack(uchar *to, const uchar *from,
+                      uint max_length, bool low_byte_first);
   uchar *pack_key(uchar *to, const uchar *from, uint max_length);
   uchar *pack_key_from_key_image(uchar* to, const uchar *from,
                                  uint max_length);
-  virtual const uchar *unpack(uchar* to, const uchar *from, uint param_data);
-  const uchar *unpack(uchar* to, const uchar *from);
-  const uchar *unpack_key(uchar* to, const uchar *from, uint max_length);
+  virtual const uchar *unpack(uchar* to, const uchar *from,
+                              uint param_data, bool low_byte_first);
+  const uchar *unpack_key(uchar* to, const uchar *from,
+                          uint max_length, bool low_byte_first);
   int pack_cmp(const uchar *a, const uchar *b, uint key_length,
                my_bool insert_or_update);
   int pack_cmp(const uchar *b, uint key_length,my_bool insert_or_update);
@@ -1421,13 +1438,15 @@ public:
     memcpy_fixed(ptr+packlength,&tmp,sizeof(char*));
     return 0;
   }
-  uchar *pack(uchar *to, const uchar *from, uint max_length= ~(uint) 0);
+  virtual uchar *pack(uchar *to, const uchar *from,
+                      uint max_length, bool low_byte_first);
   uchar *pack_key(uchar *to, const uchar *from, uint max_length);
   uchar *pack_key_from_key_image(uchar* to, const uchar *from,
                                  uint max_length);
-  virtual const uchar *unpack(uchar *to, const uchar *from, uint param_data);
-  const uchar *unpack(uchar *to, const uchar *from);
-  const uchar *unpack_key(uchar* to, const uchar *from, uint max_length);
+  virtual const uchar *unpack(uchar *to, const uchar *from,
+                              uint param_data, bool low_byte_first);
+  const uchar *unpack_key(uchar* to, const uchar *from,
+                          uint max_length, bool low_byte_first);
   int pack_cmp(const uchar *a, const uchar *b, uint key_length,
                my_bool insert_or_update);
   int pack_cmp(const uchar *b, uint key_length,my_bool insert_or_update);
@@ -1602,9 +1621,10 @@ public:
   uint32 pack_length() const { return (uint32) (field_length + 7) / 8; }
   uint32 pack_length_in_rec() const { return bytes_in_rec; }
   void sql_type(String &str) const;
-  uchar *pack(uchar *to, const uchar *from, uint max_length=~(uint) 0);
-  virtual const uchar *unpack(uchar *to, const uchar *from, uint param_data);
-  const uchar *unpack(uchar* to, const uchar *from);
+  virtual uchar *pack(uchar *to, const uchar *from,
+                      uint max_length, bool low_byte_first);
+  virtual const uchar *unpack(uchar *to, const uchar *from,
+                              uint param_data, bool low_byte_first);
   virtual void set_default();
 
   Field *new_key_field(MEM_ROOT *root, struct st_table *new_table,
diff -Nrup a/sql/log_event.cc b/sql/log_event.cc
--- a/sql/log_event.cc	2007-08-27 20:22:01 +02:00
+++ b/sql/log_event.cc	2007-09-06 22:04:53 +02:00
@@ -5697,7 +5697,9 @@ Rows_log_event::Rows_log_event(const cha
                                *description_event)
   : Log_event(buf, description_event),
     m_row_count(0),
+#ifndef MYSQL_CLIENT
     m_table(NULL),
+#endif
     m_rows_buf(0), m_rows_cur(0), m_rows_end(0),
     m_curr_row(NULL), m_curr_row_end(NULL),
     m_key(NULL)
diff -Nrup a/sql/rpl_record.cc b/sql/rpl_record.cc
--- a/sql/rpl_record.cc	2007-08-26 14:31:03 +02:00
+++ b/sql/rpl_record.cc	2007-09-06 22:04:53 +02:00
@@ -65,6 +65,8 @@ pack_row(TABLE *table, MY_BITMAP const* 
   my_ptrdiff_t const rec_offset= record - table->record[0];
   my_ptrdiff_t const def_offset= table->s->default_values - table->record[0];
 
+  DBUG_ENTER("pack_row");
+
   /*
     We write the null bits and the packed records using one pass
     through all the fields. The null bytes are written little-endian,
@@ -96,26 +98,8 @@ pack_row(TABLE *table, MY_BITMAP const* 
           For big-endian machines, we have to make sure that the
           length is stored in little-endian format, since this is the
           format used for the binlog.
-
-          We do this by setting the db_low_byte_first, which is used
-          inside some store_length() to decide what order to write the
-          bytes in.
-
-          In reality, db_log_byte_first is only set for legacy table
-          type Isam, but in the event of a bug, we need to guarantee
-          the endianess when writing to the binlog.
-
-          This is currently broken for NDB due to BUG#29549, so we
-          will fix it when NDB has fixed their way of handling BLOBs.
         */
-#if 0
-        bool save= table->s->db_low_byte_first;
-        table->s->db_low_byte_first= TRUE;
-#endif
-        pack_ptr= field->pack(pack_ptr, field->ptr + offset);
-#if 0
-        table->s->db_low_byte_first= save;
-#endif
+        pack_ptr= field->pack(pack_ptr, field->ptr + offset, UINT_MAX, TRUE);
       }
 
       null_mask <<= 1;
@@ -144,7 +128,7 @@ pack_row(TABLE *table, MY_BITMAP const* 
   */
   DBUG_ASSERT(null_ptr == row_data + null_byte_count);
 
-  return static_cast<size_t>(pack_ptr - row_data);
+  DBUG_RETURN(static_cast<size_t>(pack_ptr - row_data));
 }
 #endif
 
@@ -242,18 +226,8 @@ unpack_row(RELAY_LOG_INFO const *rli,
           Use the master's size information if available else call
           normal unpack operation.
         */
-#if 0
-        bool save= table->s->db_low_byte_first;
-        table->s->db_low_byte_first= TRUE;
-#endif
         uint16 const metadata= tabledef->field_metadata(i);
-        if (tabledef && metadata)
-          pack_ptr= f->unpack(f->ptr, pack_ptr, metadata);
-        else
-          pack_ptr= f->unpack(f->ptr, pack_ptr);
-#if 0
-        table->s->db_low_byte_first= save;
-#endif
+        pack_ptr= f->unpack(f->ptr, pack_ptr, metadata, TRUE);
       }
 
       null_mask <<= 1;
Thread
bk commit into 5.1 tree (mats:1.2571) BUG#29549Mats Kindahl6 Sep
  • RE: bk commit into 5.1 tree (mats:1.2571) BUG#29549Chuck Bell7 Sep