diff options
author | Sergey Glukhov <Sergey.Glukhov@sun.com> | 2008-12-23 18:08:04 +0400 |
---|---|---|
committer | Sergey Glukhov <Sergey.Glukhov@sun.com> | 2008-12-23 18:08:04 +0400 |
commit | c06df92af647e67731cb3a76bd91d57219407f01 (patch) | |
tree | 6e4d53e89ddfb94f9a4c162bc2a2cffb3cede106 /sql/item_timefunc.h | |
parent | 7658444b9716497fcbad8de74478f52ba3f37ca9 (diff) | |
download | mariadb-git-c06df92af647e67731cb3a76bd91d57219407f01.tar.gz |
Bug#37575 UCASE fails on monthname
The MONTHNAME/DAYNAME functions
returns binary string, so the LOWER/UPPER functions
are not effective on the result of MONTHNAME/DAYNAME call.
Character set of the MONTHNAME/DAYNAME function
result has been changed to connection character set.
include/m_ctype.h:
added my_charset_repertoire function
mysql-test/r/ctype_ucs.result:
test result
mysql-test/r/func_time.result:
test result
mysql-test/t/ctype_ucs.test:
test case
mysql-test/t/func_time.test:
test case
sql/item_timefunc.cc:
Item_func_monthname::fix_length_and_dec and
Item_func_dayname::fix_length_and_dec methods have been
modified to use connection character set
sql/item_timefunc.h:
Item_func_monthname::fix_length_and_dec and
Item_func_dayname::fix_length_and_dec methods have been
modified to use connection character set
sql/mysql_priv.h:
added max_month_name_length, max_day_name_length fields into MY_LOCALE struct
sql/mysqld.cc:
The test_lc_time_sz function controls modifications
of the locale database in debugging mode.
sql/sql_locale.cc:
initialization of max_month_name_length, max_day_name_length fields
strings/ctype.c:
added my_charset_repertoire function
Diffstat (limited to 'sql/item_timefunc.h')
-rw-r--r-- | sql/item_timefunc.h | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/sql/item_timefunc.h b/sql/item_timefunc.h index 81a6c3e98bd..161a77f60b4 100644 --- a/sql/item_timefunc.h +++ b/sql/item_timefunc.h @@ -108,18 +108,13 @@ public: class Item_func_monthname :public Item_func_month { + MY_LOCALE *locale; public: Item_func_monthname(Item *a) :Item_func_month(a) {} const char *func_name() const { return "monthname"; } String *val_str(String *str); enum Item_result result_type () const { return STRING_RESULT; } - void fix_length_and_dec() - { - collation.set(&my_charset_bin); - decimals=0; - max_length=10*my_charset_bin.mbmaxlen; - maybe_null=1; - } + void fix_length_and_dec(); }; @@ -272,18 +267,13 @@ public: class Item_func_dayname :public Item_func_weekday { + MY_LOCALE *locale; public: Item_func_dayname(Item *a) :Item_func_weekday(a,0) {} const char *func_name() const { return "dayname"; } String *val_str(String *str); enum Item_result result_type () const { return STRING_RESULT; } - void fix_length_and_dec() - { - collation.set(&my_charset_bin); - decimals=0; - max_length=9*MY_CHARSET_BIN_MB_MAXLEN; - maybe_null=1; - } + void fix_length_and_dec(); }; |