Bug #3088 | upper() does not work as expected in where with varchar binary fields | ||
---|---|---|---|
Submitted: | 7 Mar 2004 2:43 | Modified: | 10 Mar 2004 1:40 |
Reporter: | Christian Kirsch | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | MySQL Server | Severity: | S2 (Serious) |
Version: | 4.1.1 | OS: | Linux (Linux) |
Assigned to: | Alexander Barkov | CPU Architecture: | Any |
[7 Mar 2004 2:43]
Christian Kirsch
[9 Mar 2004 22:15]
Alexander Barkov
Sorry, but the bug system is not the appropriate forum for asking support questions. Your problem is not the result of a bug. For a list of more appropriate places to ask for help using MySQL products, please visit http://www.mysql.com/support/ Thank you for your interest in MySQL. Additional info: This is not a bug. This is incompatible change since 4.0. "a varchar(10) binary" is an array of bytes, and UPPER() does not change it anymore. Thank you for reporting! I wrote a letter to our doc team to check the manual, and fix according to the latest changes. If you need possible workarounds please write to mysql@lists.mysql.com with a copy to bar@mysql.com.
[10 Mar 2004 1:40]
Alexander Barkov
Addition: several workarounds are possible depending on the reason why you use a binary field type with case insensitive search. One of them is: create table test (a varchar(10) character set latin1 collate latin1_bin); insert into test values ('bla'); select a from test where upper(a) like '%BLA%'; If it does not work for you, please write to mysql@lists.mysql.com with a copy to bar@mysql.com.
[10 Mar 2004 4:42]
Christian Kirsch
I happen to disagree with Alexander's point of view. Why should the semantic of VARCHAR BINARY differ completely from that of VARCHAR? Why should a VARCHAR BINARY be an array of bytes despite its name? There are already byte data types available in MySQL.