Bug#22646 LC_TIME_NAMES: Assignment to non-UTF8 target fails
Problem: After introducing of LC_TIME_NAMES variable, the function date_format() can return international non-ascii characters in month and weekday names. Thus, it cannot return a binary string anymore, because inserting a result of date_format() into a column with non-utf8 character set produces garbage. Fix: date_format() now returns a character string, using "collation_connection" to detect character set and collation for the returned value. This allows to insert results of date_format() properly into columns with various character sets. mysql-test/r/ctype_utf8.result: Adding test case. Fixing old result. mysql-test/t/ctype_utf8.test: Adding test case. sql/item_timefunc.cc: DATE_FORMAT() now returns a character string instead of binary string: - make_date_time() now converts localte data from UTF8 to the character set of "str" argument, instead of copying as is. - fix_dec_and_length() now uses "collation_connection" instead of "binary" for the result, it also now multiplies to mbmaxlen when calculating max_length
Showing
Please register or sign in to comment