diff options
Diffstat (limited to 'sql/item.cc')
-rw-r--r-- | sql/item.cc | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/sql/item.cc b/sql/item.cc index 065204dc9c3..6cdbccde729 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -272,9 +272,6 @@ bool Item::get_date_with_conversion(MYSQL_TIME *ltime, ulonglong fuzzydate) */ String *Item::val_str_ascii(String *str) { - if (!(collation.collation->state & MY_CS_NONASCII)) - return val_str(str); - DBUG_ASSERT(str != &str_value); uint errors; @@ -282,11 +279,15 @@ String *Item::val_str_ascii(String *str) if (!res) return 0; - if ((null_value= str->copy(res->ptr(), res->length(), - collation.collation, &my_charset_latin1, - &errors))) - return 0; - + if (!(res->charset()->state & MY_CS_NONASCII)) + str= res; + else + { + if ((null_value= str->copy(res->ptr(), res->length(), collation.collation, + &my_charset_latin1, &errors))) + return 0; + } + return str; } |