SQL
thank you.
I found how to set koi8r charset for the server:
to set default collation for configure.
But how to build mysql client and client library that default client sharset is koi8r?
It isn't useful to set this in my.cnf IMHO if I use only one charset for my application.
I want something like client default characterset during a building the mysql :)
Try commands : select charset('_R'); select collation('_R'); select charset('price') from analit ; select collation('price') from analit ;
If this command does not return koi8r then client gives to server string with another
charset as column 'price', but comparing two strings is possible only if they have
identical charsets and collations .
Thats all
Andrey Kotrekhov wrote:
Добрый день.
Andrey Kotrekhov wrote:
SQL Hi, all! I have a problem after migration from 4.0.20 to 4.1.2 I have a table `analit`. this is the result of show create table: CREATE TABLE `analit` ( `d` date NOT NULL default '0000-00-00', `service` binary(16) NOT NULL default '', `price` char(50) NOT NULL default '', `type` char(50) NOT NULL default '', `val` double NOT NULL default '0', `city` char(16) NOT NULL default '', `VIP` int(11) NOT NULL default '0', `currency` char(8) NOT NULL default 'unit', `label` int(11) NOT NULL default '0', `status` int(11) NOT NULL default '0', PRIMARY KEY (`d`,`service`,`price`,`type`,`city`,`VIP`), KEY `city` (`city`), KEY `d` (`d`), KEY `label` (`label`) ) ENGINE=MyISAM DEFAULT CHARSET=koi8r
The request return me a error:
mysql> select * from analit where price rlike '_R';
ERROR 1267 (HY000): Illegal mix of collations (koi8r_general_ci,IMPLICIT)
and (latin1_swedish_ci,COERCIBLE) for operation 'regexp'
I can't find this in docs. I try to set LC_COLLATE in environtment variables like setenv LC_COLLATE ru_RU.KOI8-R But there isn't any result.
What should I do?
Best regards. _______________________________________ Andrey Kotrekhov [EMAIL PROTECTED] ISP Alkar Teleport тел. +380 562 34-00-44
IMHO problem is when you try to check two differrent charsets, if _R is in a koi8r then you must try
select * from analit where price rlike _koi8r '_R';
Hmm... I have koi8 charset under FreeBSD, and I have the same effect if I try to do: select * from analit where price='something';
The problem take place if I try to compare char field without binary flag. Any ideas.
Maybe something was changed in my.cnf from 4.1.1 to 4.1.2, was it?
Best regards. _______________________________________ Andrey Kotrekhov [EMAIL PROTECTED] ISP Alkar Teleport тел. +380 562 34-00-44
Best regards. _______________________________________ Andrey Kotrekhov [EMAIL PROTECTED] ISP Alkar Teleport тел. +380 562 34-00-44
-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]