From a33bb001445d2576f15437d9392bc70736ab419a Mon Sep 17 00:00:00 2001 From: Alexander Barkov Date: Fri, 8 Nov 2013 14:18:16 +0400 Subject: MDEV-4842 STR_TO_DATE does not work with UCS2/UTF16/UTF32 --- sql/item.cc | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'sql/item.cc') 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(); -- cgit v1.2.1