Bug #24518 create function CHARSET utf8 is add automatiquely
Submitted: 22 Nov 2006 19:52 Modified: 22 Nov 2006 21:09
Reporter: Amir Boutarfa Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:5.1.12 OS:Linux (REDHAT )
Assigned to: CPU Architecture:Any
Tags: charset, collation, FUNCTION

[22 Nov 2006 19:52] Amir Boutarfa
Description:
All server is in charset utf8 and collation utf8_unicode_ci
when i create function returning char or varchar a CHARSET utf8 is add automatiquely.
if i create this function
CREATE FUNCTION bonjour (s CHAR(20)) RETURNS CHAR(50)
RETURN CONCAT('Bonjour, ',s,'!');

so when i call this function, then return is in utf8_general_ci. I'am waiting for a utf8_unicode_ci.

I test mysql 5.0.28 it's the same.
On Mysql 5.1.9 and 5.0.24 there is no problème.

How to repeat:
In 5.1.12 create this function
CREATE FUNCTION bonjour (s CHAR(20)) RETURNS CHAR(50)
RETURN CONCAT('Bonjour, ',s,'!');
whithout CHARSET

Open MysqlAdminitrator and look this function : CHARSET uft8 is add on the return value.

If you create this function on 5.1.9 and open MysqlAdminitrator, there is no CHARSET ADD
[22 Nov 2006 21:09] Sveta Smirnova
Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://dev.mysql.com/doc/ and the instructions on
how to report a bug at http://bugs.mysql.com/how-to-report.php

Please check Change Log available at http://dev.mysql.com/doc/refman/5.1/en/news-5-1-12.html: "The value returned by a stored function returning a string value was not of the declared character set. (Bug#16211)"