From ae04e233f30ceff4d29c2ae32fbc5bd966dda517 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 16 Jul 2005 00:52:00 +0300 Subject: post merge changes: added safe_charset_converter to other static functions --- sql/item.cc | 32 ++++++++++++++++++++++++++++++++ sql/item.h | 2 ++ 2 files changed, 34 insertions(+) diff --git a/sql/item.cc b/sql/item.cc index 49ab2c13a88..d26e4ba7c20 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -638,6 +638,38 @@ Item *Item_num::safe_charset_converter(CHARSET_INFO *tocs) } +Item *Item_static_int_func::safe_charset_converter(CHARSET_INFO *tocs) +{ + Item_string *conv; + char buf[64]; + String *s, tmp(buf, sizeof(buf), &my_charset_bin); + s= val_str(&tmp); + if ((conv= new Item_static_string_func(func_name, s->ptr(), s->length(), + s->charset()))) + { + conv->str_value.copy(); + conv->str_value.mark_as_const(); + } + return conv; +} + + +Item *Item_static_float_func::safe_charset_converter(CHARSET_INFO *tocs) +{ + Item_string *conv; + char buf[64]; + String *s, tmp(buf, sizeof(buf), &my_charset_bin); + s= val_str(&tmp); + if ((conv= new Item_static_string_func(func_name, s->ptr(), s->length(), + s->charset()))) + { + conv->str_value.copy(); + conv->str_value.mark_as_const(); + } + return conv; +} + + Item *Item_string::safe_charset_converter(CHARSET_INFO *tocs) { Item_string *conv; diff --git a/sql/item.h b/sql/item.h index cf6c0052a98..f195557fb69 100644 --- a/sql/item.h +++ b/sql/item.h @@ -1132,6 +1132,7 @@ public: Item_static_int_func(const char *str_arg, longlong i, uint length) :Item_int(NullS, i, length), func_name(str_arg) {} + Item *safe_charset_converter(CHARSET_INFO *tocs); void print(String *str) { str->append(func_name); } }; @@ -1242,6 +1243,7 @@ public: :Item_float(NullS, val_arg, decimal_par, length), func_name(str) {} void print(String *str) { str->append(func_name); } + Item *safe_charset_converter(CHARSET_INFO *tocs); }; -- cgit v1.2.1