diff options
author | Alexander Barkov <bar@mnogosearch.org> | 2013-11-08 20:59:08 +0400 |
---|---|---|
committer | Alexander Barkov <bar@mnogosearch.org> | 2013-11-08 20:59:08 +0400 |
commit | e02ad98c63506c3260ac3a365e72886d7d02304a (patch) | |
tree | 88ff7149921c8f4e47d5a628bfdc8f4241ad8c06 /sql/item.cc | |
parent | 7876d53b5f17e2c906f41d97e22514c1e36640bb (diff) | |
parent | d79d0c4045f5b93ded001ca6b963727b3362cd15 (diff) | |
download | mariadb-git-e02ad98c63506c3260ac3a365e72886d7d02304a.tar.gz |
Merge 5.5 -> 10.0-base
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 26c75ccfd40..f1968e952be 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -263,6 +263,24 @@ String *Item::val_str_ascii(String *str) } +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(); |