I did more investigation and found out that
1) with MySQL 4.1.10-nt both queries executed from Query Browser work fine (no error) - I haven't chance to test it with my application through ODBC connection 2) when I set initial statement in MyODBC "SET CHARACTER SET 'cp1250'" instead of "SET NAMES 'cp1250'" for connection to MySQL 4.1.9-nt-log queries from my application work fine and that is what I need

mysql> show create table files \G
*************************** 1. row ***************************
      Table: files
Create Table: CREATE TABLE `files` (
 `FileName` char(100) collate latin2_czech_cs NOT NULL default '',
`CommandType` enum('NONE','ON_SUCCESS','ON_NOTRANSMIT') collate latin2_czech_cs NOT NULL default 'NONE',
 `Command` char(128) collate latin2_czech_cs default NULL,
 PRIMARY KEY  (`FileName`,`CommandType`)
) ENGINE=MyISAM DEFAULT CHARSET=latin2 COLLATE=latin2_czech_cs
1 row in set (0.01 sec)

mysql> show variables like '%char%';
+--------------------------+---------------------------------------------------------+
| Variable_name | Value |
+--------------------------+---------------------------------------------------------+
| character_set_client | cp1250 | | character_set_connection | latin2 | | character_set_database | latin2 | | character_set_results | cp1250 | | character_set_server | latin2 | | character_set_system | utf8 | | character_sets_dir | D:\Program Files\MySQL\MySQL Server 4.1\share\charsets/ |
+--------------------------+---------------------------------------------------------+
7 rows in set (0.00 sec)

mysql> show variables like '%col%';
+----------------------+-------------------+
| Variable_name        | Value             |
+----------------------+-------------------+
| collation_connection | cp1250_general_ci |
| collation_database   | latin2_czech_cs   |
| collation_server     | latin2_general_ci |
| protocol_version     | 10                |
+----------------------+-------------------+
4 rows in set (0.00 sec)

I am still wondering why
SELECT * FROM files WHERE filename = 'file1.txt' OR filename = 'file2.txt'
was working and
SELECT * FROM files WHERE filename IN('file1.txt', 'file2.txt')
wasn't

Dusan

----- Original Message ----- From: "Gleb Paharenko" <[EMAIL PROTECTED]>
To: <mysql@lists.mysql.com>
Sent: Thursday, June 02, 2005 2:13 PM
Subject: Re: Illegal mix of collations for operation IN


Hello.

Usually debugging of such kind of problems starts with examination of
the output of:
 show variables like '%char%';
 show variables like '%colla%';

Send the output of:
 show create table your_table;



Hello,

I have problem which I don't understand.

if I send command (from Query Browser or from C++ Builder application)
SELECT FileName FROM Files WHERE FileName = 'FILE1.TXT' OR FileName =
'FILE2.TXT'
query executes without any problem but command
SELECT FileName FROM Files WHERE FileName IN ('FILE1.TXT', 'FILE2.TXT')
throws error "illegal mix of collations for operation 'IN' "

I thought that IN is somehow by optimizer translated to ORs
Could someone explain me why first query is OK and second not? Please.

I'm using WinXP SP2 and MySQL 4.1.9-nt-log
databases and tables use CHARSET=latin2 COLLATE=latin2_czech_cs
I already read some articles about the topic in MySQL forum but they
didn't helped me
much.

Thanks in advance

Dusan Pavlica
Du$an Pavlica <[EMAIL PROTECTED]> wrote:


--
For technical support contracts, goto https://order.mysql.com/?ref=ensita
This email is sponsored by Ensita.NET http://www.ensita.net/
  __  ___     ___ ____  __
 /  |/  /_ __/ __/ __ \/ /    Gleb Paharenko
/ /|_/ / // /\ \/ /_/ / /__   [EMAIL PROTECTED]
/_/  /_/\_, /___/\___\_\___/   MySQL AB / Ensita.NET
      <___/   www.mysql.com




--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]



--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to