Bug #54960 Concat is not working with ucs2 character set
Submitted: 2 Jul 2010 11:46 Modified: 2 Aug 2010 12:41
Reporter: Ugandiran Chandrasekar Email Updates:
Status: No Feedback Impact on me:
None 
Category:MySQL Server: Charsets Severity:S3 (Non-critical)
Version:5.1.41 OS:Any
Assigned to: CPU Architecture:Any
Tags: character set, collation

[2 Jul 2010 11:46] Ugandiran Chandrasekar
Description:
Concat function is not working with ucs2 character set when we are trying to concat
different data types like varchar,date,int.
if we give all the values as varchar its working.

How to repeat:
 
DROP PROCEDURE IF EXISTS EMPLOYEE;
CREATE PROCEDURE EMPLOYEE(IN FROM_DATE DATE,
                         IN TO_DATE DATE,
                         IN DEPT VARCHAR (500) charset ucs2,
                         IN LOGIN_ID VARCHAR (50) charset ucs2,
                         IN START_INDEX INT,
                         IN END_LIMIT INT,
                         IN ORDER_BY_CLAUSE VARCHAR (50) charset ucs2
)
	BEGIN
			set @sql	=	
						concat(' SELECT * FROM EMPLOYEE WHERE ',
									 ' DATE_FORMAT(DATE_OF_JOIN,''%Y-%m-%d'') BETWEEN	DATE_FORMAT(''',FROM_DATE,''',''%Y-%m-%d'') ',
									 ' AND DATE_FORMAT(''',TO_DATE,''',''%Y-%m-%d'') AND EMP_DEPT IN (',DEPT,')',
									 ' ORDER BY ',
									 ORDER_BY_CLAUSE,
									 ' LIMIT ',
									 START_INDEX,
									 ',',
									 END_LIMIT
									 );
			PREPARE STMT FROM @sql;
			EXECUTE STMT;
	END;						 

Suggested fix:
expecting.
[2 Jul 2010 12:41] Valeriy Kravchuk
Please, check with a newer version, 5.1.48, and in case of the same problem, please, show how exactly you call this procedure, what results you get and what results you expect.
[2 Aug 2010 23:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".