diff options
Diffstat (limited to 'sql/field_conv.cc')
-rw-r--r-- | sql/field_conv.cc | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/sql/field_conv.cc b/sql/field_conv.cc index 588a99f560f..ce914f7b368 100644 --- a/sql/field_conv.cc +++ b/sql/field_conv.cc @@ -1,4 +1,5 @@ -/* Copyright (C) 2000-2003 MySQL AB +/* + Copyright (c) 2000, 2010, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -11,7 +12,8 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ /** @@ -727,15 +729,11 @@ Copy_field::get_copy_func(Field *to,Field *from) if (((Field_varstring*) to)->length_bytes != ((Field_varstring*) from)->length_bytes) return do_field_string; - if (to_length != from_length) - return (((Field_varstring*) to)->length_bytes == 1 ? - (from->charset()->mbmaxlen == 1 ? do_varstring1 : - do_varstring1_mb) : - (from->charset()->mbmaxlen == 1 ? do_varstring2 : - do_varstring2_mb)); - else - return (((Field_varstring*) from)->length_bytes == 1 ? - do_varstring1 : do_varstring2); + return (((Field_varstring*) to)->length_bytes == 1 ? + (from->charset()->mbmaxlen == 1 ? do_varstring1 : + do_varstring1_mb) : + (from->charset()->mbmaxlen == 1 ? do_varstring2 : + do_varstring2_mb)); } else if (to_length < from_length) return (from->charset()->mbmaxlen == 1 ? |