473,322 Members | 1,431 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

collation problems with utf8

I'm having a problem with something that seems like it should be super-easy,
and yet is making me crazy. I have a simple table "A", with one column,
"C". There are two rows in this table, with values "FOO" and "foo". And I
have an index on C. Now, I perform the following query:

select * from A where C="FOO" or C="foo";

I only get back one row:

+---------+
| C +
+---------+
| foo +
+---------+

The problem doesn't occur if I get rid of the index. Here's the actual
table description (the default character set and collation of the database
are also utf8 and utf8_bin, respectively):

create table A (
C varchar(255) character set utf8 collate utf8_bin,
index(C)
) type=INNODB default character set utf8 collate utf8_bin;
insert into A values ("FOO"),("foo");

The following query works (i.e. returns both rows), but bypasses the index
(which is a problem when working with the real table, which has hundreds of
thousands of entries):

select * from A where C collate utf8_bin = "FOO" or C collate utf8_bin =
"foo";

Is this a bug? Am I messing up my set up? Giving a bad query? Or is this
the way indices are supposed to work? It seems like it should be easy, but
for some reason the index seems to be interfering with things.

Daniel
Jul 20 '05 #1
0 1304

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: DH | last post by:
I must work with phpMyAdmin 2.6.0-pl3 installed on a client's Windows NT web server. I've not previously encountered options for charset and collation using phpMyAdmin, and am not sure what to set...
1
by: Bob Bedford | last post by:
I've no access to mysql NG, so I ask here: I've two identical tables (wich are created by usins the same script, but must be separated). When I execute a query wich return fields and do a...
0
by: Temba | last post by:
Hi there, I've been searching for about 6 hours to get a problem solved. I installed MySQL 4.1.7 on the Debian web-server. Normally this worked: insert into logbook...
2
by: Andrew Butchart | last post by:
I have had some problems with a web site that I am working on. The DBA set up all of the tables using the default collation sequence of SQL_Latin1_General_CP1_CI_AS HOWEVER, the recordset that is...
2
by: Marco | last post by:
I need to migrate an application from SQL 7.0 to SQL 2000. I know that they use different collations, and this causes problems when 7.0 applications are moved to 2000. I would like to find a...
0
by: polinaskulski | last post by:
Hi, I've got a production server with the default collation and User DBs with the different collation. Now when I create temporary tables and compare with the permanent ones we have collation...
3
by: David Greenberg | last post by:
Hi When we installed SqlServer2000 we left the default collation name (Sql_Latin1_General_CPI_CI_AS). The user defined databases we created afterwards were defined with a different collation name...
27
by: Nasir | last post by:
Hi there, Is it posible to set the collation of SQL server 2005 like Oracle, which is that objects names and column names are case-insensitive, but data is sensitive;e.g: In Oracle: --create...
2
by: Mike Sumner | last post by:
Platform Windows 2000 professional Using phpMyadmin Just struggling a little over two issues. On front end page of phpMyadmin I have various information for global settings. I'm not sure...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.