[osmosis-dev] Two tag keys with different capitalisation

Anthony osm at inbox.org
Tue Dec 1 17:25:02 GMT 2009


On Tue, Dec 1, 2009 at 12:20 PM, Anthony <osm at inbox.org> wrote:
> On Tue, Dec 1, 2009 at 12:17 PM, Marcus Wolschon
> <marcus.wolschon at googlemail.com> wrote:
>> How is that a problem for MySQL?
>> "h" and "H" have different binary representations and are
>> thus different keys, are they now?
>
> By default MySQL treats all comparisons on varchars as case insensitive.

mysql> create table blah ( `k` varchar(255) NOT NULL default '',
primary key (k));
Query OK, 0 rows affected (0.00 sec)

mysql> insert into blah values ('hellO');
         Query OK, 1 row affected (0.00 sec)

mysql> select * from blah where k='hello';
+-------+
| k     |
+-------+
| hellO |
+-------+
1 row in set (0.02 sec)

The exception would be if your default collation is binary (which
would have the same side-effect as to making your sorts bunch all the
capital letters together and all the lowercase letters together).

If you need to sort 'H' next to 'h', but don't want to treat 'H' as
equal to 'h', you need to use a database other than MySQL.




More information about the osmosis-dev mailing list