=== modified file 'sql/field_conv.cc'
--- sql/field_conv.cc	2012-06-14 18:05:31 +0000
+++ sql/field_conv.cc	2013-03-20 17:35:07 +0000
@@ -828,23 +828,27 @@ Copy_field::get_copy_func(Field *to,Fiel
 
 int field_conv(Field *to,Field *from)
 {
-  if (to->real_type() == from->real_type() &&
+  const enum_field_types to_real_type= to->real_type();
+  const enum_field_types from_real_type= from->real_type();
+
+  if (to_real_type == from_real_type &&
       !(to->type() == MYSQL_TYPE_BLOB && to->table->copy_blobs))
   {
-    if (to->pack_length() == from->pack_length() &&
+    const uint32 to_pack_length= to->pack_length();
+    if (to_pack_length == from->pack_length() &&
         !(to->flags & UNSIGNED_FLAG && !(from->flags & UNSIGNED_FLAG)) &&
         to->decimals() == from->decimals() &&
-	to->real_type() != MYSQL_TYPE_ENUM &&
-	to->real_type() != MYSQL_TYPE_SET &&
-        to->real_type() != MYSQL_TYPE_BIT &&
-        (to->real_type() != MYSQL_TYPE_NEWDECIMAL ||
+	to_real_type != MYSQL_TYPE_ENUM &&
+	to_real_type != MYSQL_TYPE_SET &&
+        to_real_type != MYSQL_TYPE_BIT &&
+        (to_real_type != MYSQL_TYPE_NEWDECIMAL ||
          to->field_length == from->field_length) &&
         from->charset() == to->charset() &&
         (!(to->table->in_use->variables.sql_mode &
            (MODE_NO_ZERO_IN_DATE | MODE_NO_ZERO_DATE | MODE_INVALID_DATES)) ||
          (to->type() != MYSQL_TYPE_DATE &&
           to->type() != MYSQL_TYPE_DATETIME)) &&
-        (from->real_type() != MYSQL_TYPE_VARCHAR ||
+        (from_real_type != MYSQL_TYPE_VARCHAR ||
          ((Field_varstring*)from)->length_bytes ==
           ((Field_varstring*)to)->length_bytes))
     {						// Identical fields
@@ -854,7 +858,7 @@ int field_conv(Field *to,Field *from)
         if memcpy() is implemented with prefetch-write
        */
       if (to->ptr != from->ptr)
-        memcpy(to->ptr,from->ptr,to->pack_length());
+        memcpy(to->ptr,from->ptr,to_pack_length);
       return 0;
     }
   }
@@ -868,13 +872,13 @@ int field_conv(Field *to,Field *from)
     */
     if (to->table->copy_blobs ||
         (!blob->value.is_alloced() &&
-         from->real_type() != MYSQL_TYPE_STRING &&
-         from->real_type() != MYSQL_TYPE_VARCHAR))
+         from_real_type != MYSQL_TYPE_STRING &&
+         from_real_type != MYSQL_TYPE_VARCHAR))
       blob->value.copy();
     return blob->store(blob->value.ptr(),blob->value.length(),from->charset());
   }
-  if (from->real_type() == MYSQL_TYPE_ENUM &&
-      to->real_type() == MYSQL_TYPE_ENUM &&
+  if (from_real_type == MYSQL_TYPE_ENUM &&
+      to_real_type == MYSQL_TYPE_ENUM &&
       from->val_int() == 0)
   {
     ((Field_enum *)(to))->store_type(0);

