MONTHNAME() & DAYNAME() are now UCS2 compatible
This commit is contained in:
parent
79f8a525a3
commit
f6f23ce8d0
@ -160,7 +160,10 @@ String* Item_func_monthname::val_str(String* str)
|
|||||||
return (String*) 0;
|
return (String*) 0;
|
||||||
}
|
}
|
||||||
null_value=0;
|
null_value=0;
|
||||||
return &month_names[month-1];
|
|
||||||
|
String *m=&month_names[month-1];
|
||||||
|
str->copy(m->ptr(), m->length(), m->charset(), thd_charset());
|
||||||
|
return str;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Returns the quarter of the year
|
// Returns the quarter of the year
|
||||||
@ -234,7 +237,10 @@ String* Item_func_dayname::val_str(String* str)
|
|||||||
uint weekday=(uint) val_int(); // Always Item_func_daynr()
|
uint weekday=(uint) val_int(); // Always Item_func_daynr()
|
||||||
if (null_value)
|
if (null_value)
|
||||||
return (String*) 0;
|
return (String*) 0;
|
||||||
return &day_names[weekday];
|
|
||||||
|
String *d=&day_names[weekday];
|
||||||
|
str->copy(d->ptr(), d->length(), d->charset(), thd_charset());
|
||||||
|
return str;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -85,7 +85,12 @@ public:
|
|||||||
const char *func_name() const { return "monthname"; }
|
const char *func_name() const { return "monthname"; }
|
||||||
String *val_str(String *str);
|
String *val_str(String *str);
|
||||||
enum Item_result result_type () const { return STRING_RESULT; }
|
enum Item_result result_type () const { return STRING_RESULT; }
|
||||||
void fix_length_and_dec() { decimals=0; max_length=10; maybe_null=1; }
|
void fix_length_and_dec()
|
||||||
|
{
|
||||||
|
decimals=0;
|
||||||
|
max_length=10*thd_charset()->mbmaxlen;
|
||||||
|
maybe_null=1;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -192,7 +197,12 @@ class Item_func_dayname :public Item_func_weekday
|
|||||||
const char *func_name() const { return "dayname"; }
|
const char *func_name() const { return "dayname"; }
|
||||||
String *val_str(String *str);
|
String *val_str(String *str);
|
||||||
enum Item_result result_type () const { return STRING_RESULT; }
|
enum Item_result result_type () const { return STRING_RESULT; }
|
||||||
void fix_length_and_dec() { decimals=0; max_length=9; maybe_null=1; }
|
void fix_length_and_dec()
|
||||||
|
{
|
||||||
|
decimals=0;
|
||||||
|
max_length=9*thd_charset()->mbmaxlen;
|
||||||
|
maybe_null=1;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user