Bug #2102 | STRCMP not working on Windows | ||
---|---|---|---|
Submitted: | 11 Dec 2003 22:40 | Modified: | 12 Dec 2003 5:01 |
Reporter: | Jean-Sébastien Goupil | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | MySQL Server: Command-line Clients | Severity: | S3 (Non-critical) |
Version: | 4.0.15-nt | OS: | Windows (WinXP Pro English) |
Assigned to: | CPU Architecture: | Any |
[11 Dec 2003 22:40]
Jean-Sébastien Goupil
[12 Dec 2003 5:01]
MySQL Verification Team
Yes strings on Windows is handled as insensitive, however please see below the sample using the binary definition. Also for to handle character set behavior, the version 4.1.X offers better features. C:\mysql\bin>mysql -uroot test Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 2 to server version: 4.0.17-nt Type 'help;' or '\h' for help. Type '\c' to clear the buffer. mysql> create table mytbl (nome varchar(30)); Query OK, 0 rows affected (0.08 sec) mysql> insert into mytbl values ("MyOption"); Query OK, 1 row affected (0.00 sec) mysql> select * from mytbl where strcmp(nome,"myoption")=0; +----------+ | nome | +----------+ | MyOption | +----------+ 1 row in set (0.00 sec) mysql> alter table mytbl modify nome varchar(30) binary; Query OK, 1 row affected (0.09 sec) Records: 1 Duplicates: 0 Warnings: 0 mysql> select * from mytbl where strcmp(nome,"myoption")=0; Empty set (0.01 sec) mysql> select * from mytbl where strcmp(nome,"MyOption")=0; +----------+ | nome | +----------+ | MyOption | +----------+ 1 row in set (0.00 sec)
[12 Dec 2003 17:38]
Paul DuBois
To clarify a bit: STRCMP() is case-insensitive as of MySQL 4.0. I have updated the STRCMP() description in the manual to make this clearer. Please see: http://www.mysql.com/doc/en/String_comparison_functions.html