summaryrefslogtreecommitdiff
path: root/sql/item_strfunc.h
diff options
context:
space:
mode:
Diffstat (limited to 'sql/item_strfunc.h')
-rw-r--r--sql/item_strfunc.h54
1 files changed, 14 insertions, 40 deletions
diff --git a/sql/item_strfunc.h b/sql/item_strfunc.h
index ea6229068fe..30a9ba4492d 100644
--- a/sql/item_strfunc.h
+++ b/sql/item_strfunc.h
@@ -144,8 +144,7 @@ class Item_str_conv :public Item_str_func
{
protected:
uint multiply;
- uint (*converter)(CHARSET_INFO *cs, char *src, uint srclen,
- char *dst, uint dstlen);
+ my_charset_conv_case converter;
String tmp_value;
public:
Item_str_conv(Item *item) :Item_str_func(item) {}
@@ -158,13 +157,7 @@ class Item_func_lcase :public Item_str_conv
public:
Item_func_lcase(Item *item) :Item_str_conv(item) {}
const char *func_name() const { return "lcase"; }
- void fix_length_and_dec()
- {
- collation.set(args[0]->collation);
- multiply= collation.collation->casedn_multiply;
- converter= collation.collation->cset->casedn;
- max_length= args[0]->max_length * multiply;
- }
+ void fix_length_and_dec();
};
class Item_func_ucase :public Item_str_conv
@@ -172,13 +165,7 @@ class Item_func_ucase :public Item_str_conv
public:
Item_func_ucase(Item *item) :Item_str_conv(item) {}
const char *func_name() const { return "ucase"; }
- void fix_length_and_dec()
- {
- collation.set(args[0]->collation);
- multiply= collation.collation->caseup_multiply;
- converter= collation.collation->cset->caseup;
- max_length= args[0]->max_length * multiply;
- }
+ void fix_length_and_dec();
};
@@ -355,26 +342,19 @@ public:
class Item_func_encode :public Item_str_func
{
- protected:
- SQL_CRYPT sql_crypt;
- String seed;
public:
- Item_func_encode(Item *a, char *seed_arg):
- Item_str_func(a), sql_crypt(seed_arg)
- {
- seed.copy(seed_arg, strlen(seed_arg), default_charset_info);
- }
+ Item_func_encode(Item *a, Item *seed):
+ Item_str_func(a, seed) {}
String *val_str(String *);
void fix_length_and_dec();
const char *func_name() const { return "encode"; }
- void print(String *str);
};
class Item_func_decode :public Item_func_encode
{
public:
- Item_func_decode(Item *a, char *seed_arg): Item_func_encode(a, seed_arg) {}
+ Item_func_decode(Item *a, Item *seed): Item_func_encode(a, seed) {}
String *val_str(String *);
const char *func_name() const { return "decode"; }
};
@@ -428,8 +408,8 @@ public:
bool fix_fields(THD *thd, Item **ref);
void fix_length_and_dec()
{
- max_length= ((USERNAME_LENGTH + HOSTNAME_LENGTH + 1) *
- system_charset_info->mbmaxlen);
+ max_length= (USERNAME_LENGTH +
+ (HOSTNAME_LENGTH + 1) * SYSTEM_CHARSET_MBMAXLEN);
}
const char *func_name() const { return "user"; }
const char *fully_qualified_func_name() const { return "user()"; }
@@ -496,12 +476,12 @@ public:
void update_used_tables();
const char *func_name() const { return "make_set"; }
- bool walk(Item_processor processor, byte *arg)
+ bool walk(Item_processor processor, bool walk_subquery, uchar *arg)
{
- return item->walk(processor, arg) ||
- Item_str_func::walk(processor, arg);
+ return item->walk(processor, walk_subquery, arg) ||
+ Item_str_func::walk(processor, walk_subquery, arg);
}
- Item *transform(Item_transformer transformer, byte *arg);
+ Item *transform(Item_transformer transformer, uchar *arg);
void print(String *str);
};
@@ -510,15 +490,9 @@ class Item_func_format :public Item_str_func
{
String tmp_str;
public:
- Item_func_format(Item *org,int dec);
+ Item_func_format(Item *org, Item *dec);
String *val_str(String *);
- void fix_length_and_dec()
- {
- collation.set(default_charset());
- uint char_length= args[0]->max_length/args[0]->collation.collation->mbmaxlen;
- max_length= ((char_length + (char_length-args[0]->decimals)/3) *
- collation.collation->mbmaxlen);
- }
+ void fix_length_and_dec();
const char *func_name() const { return "format"; }
void print(String *);
};