diff options
author | Alexander Barkov <bar@mnogosearch.org> | 2013-11-08 14:18:16 +0400 |
---|---|---|
committer | Alexander Barkov <bar@mnogosearch.org> | 2013-11-08 14:18:16 +0400 |
commit | a33bb001445d2576f15437d9392bc70736ab419a (patch) | |
tree | 878fd523c8bcdac7fdfe7af8800bc28c92969fe1 /sql/item.cc | |
parent | 5ce11d8b4ca2a57968656925a69ed8114d5374f6 (diff) | |
download | mariadb-git-a33bb001445d2576f15437d9392bc70736ab419a.tar.gz |
MDEV-4842 STR_TO_DATE does not work with UCS2/UTF16/UTF32
Diffstat (limited to 'sql/item.cc')
-rw-r--r-- | sql/item.cc | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/sql/item.cc b/sql/item.cc index 803c9fee576..a415464a2f9 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -218,6 +218,24 @@ bool Item::val_bool() } +String *Item::val_str(String *str, String *converter, CHARSET_INFO *cs) +{ + String *res= val_str(str); + if (null_value) + return (String *) 0; + + if (!cs) + return res; + + uint errors; + if ((null_value= converter->copy(res->ptr(), res->length(), + collation.collation, cs, &errors))) + return (String *) 0; + + return converter; +} + + String *Item::val_string_from_real(String *str) { double nr= val_real(); |