Commit b4a723e4 authored by bell@sanja.is.com.ua's avatar bell@sanja.is.com.ua

post merge changes: added safe_charset_converter to other static functions

parent 8aad35f9
......@@ -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;
......
......@@ -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);
};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment