Page 1 of 1

Wrong codepage

Posted: 18.02.2008, 19:32
by mobileuser
I have the table
CREATE TABLE `patient` (
`idPatient` int(10) unsigned NOT NULL auto_increment,
`LName` varchar(45) default NULL,
`FName` varchar(45) default NULL,
`PName` varchar(45) default NULL,
`Street` varchar(45) default NULL,
`House` int(10) unsigned default NULL,
`Building` varchar(3) default NULL,
`Apartament` varchar(10) default NULL,
PRIMARY KEY (`idPatient`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8

My TZConnection has codepage=cp1251

when I execute a query

'select a.*,concat_ws(' ',a.lname,a.fname,a.pname) as fio,a.street,
concat_ws(',',a.street,
concat_ws('/', a.house,a.building),
a.apartament
) as address
from patient as a
order by a.lname,a.fname,a.pname'

the field 'address' don't displays in codepage=cp1251
but the field 'fio' is right.

But if I execute the query

select a.*,concat_ws(' ',a.lname,a.fname,a.pname) as fio,a.street,
concat_ws(',',a.street,
concat_ws('/',cast(a.house as char),a.building),
a.apartament
) as address
from patient as a
order by a.lname,a.fname,a.pname'

then all it's ok

Why?Is it bug or propery of Mysql?