Re: User-JDBC-Realm: User case-sensitiv?
Hi Todd, On Fri, May 16, 2008 at 11:23 PM, Boyd, Todd M. [EMAIL PROTECTED] wrote: You can use WHERE x LIKE condition to perform a case-sensitive search without modifying the structure of the table(s) involved by using the BINARY keyword. well, I could so so - however, I'm talking about Tomcat's Authentication (User-Realm). Since I don't want to patch Tomcat, I had to change the tables. Sure, there are a lot of possible solutions, however, it would ease up things if MySQL would behave as expected by the common programmer. Just an example: What, if you create a databse-independent software (as what we do), that runs on any database providing a JDBC 2.0-compliant driver and supports SQL 2.0-standard? AFAIK DB2 doesn't know the binary attribute, not sure about Oracle, Postgres, Informix etc. So what you'd have to to then is evaluate every database for those kind of features and provide different create-scripts for each database providing such a feature. Or, even worse, you'll have to write code within your application handling each such feature (if db == mysql soSomethingElse) Folks, from the from the interperability-point-of-view I guess MySQL is behaving badly here since it just doesn't stick to one of the principles of computing: A != a No problem if MySQL would offer this behaviour as a feature (i.e. create table foo (bar varchar(10) NOCASE)), but how they did it ist just the wrong way round, IMHO. Anyways, I guess we're getting slightly off topic here. To get back to the topic, I'm wondering how many percent of the Tomcat-users using a MySQL are aware of the fact that the user-id is not case-sensitive, when they use a JDBC-realm as their user-database. Cheers Gregor -- what's puzzlin' you, is the nature of my game gpgp-fp: 79A84FA526807026795E4209D3B3FE028B3170B2 gpgp-key available @ http://pgpkeys.pca.dfn.de:11371 - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: User-JDBC-Realm: User case-sensitiv?
Gregor Schneider wrote: Hi guys, I'm just a bit puzzled, maybe one of you can shed some light: We're running Tomcat 5.5 here having created a JDBC-realm holding our users their credentials: The DDL of the MySQL-Tables shows like However, we've just discovered that Tomcat doesn't care at all abot case-sensivity of the user-names being entered. I ran through the Tomcat-docs but couldn't find any hint on that issue. Needless to say that personally I find this behaviour quite annoying and would die for a hint how to get rid of that behaviour. I'm *guessing* that this could be a factor: http://dev.mysql.com/doc/refman/5.0/en/case-sensitivity.html BugBear - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: User-JDBC-Realm: User case-sensitiv?
Hi Paul. thanks a lot, that's the reason why. I'm wondering what those guys from MySQL thought when introducing this feature... Anyways, thanks again! Gregor -- what's puzzlin' you, is the nature of my game gpgp-fp: 79A84FA526807026795E4209D3B3FE028B3170B2 gpgp-key available @ http://pgpkeys.pca.dfn.de:11371 - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: User-JDBC-Realm: User case-sensitiv?
When you think about how many people would be asking how to make them case-insensitive versus how many need to perform case-sensitive searching, it makes sense to me. Todd Boyd Web Programmer -Original Message- From: Gregor Schneider [mailto:[EMAIL PROTECTED] 8 snip! I'm wondering what those guys from MySQL thought when introducing this feature... - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: User-JDBC-Realm: User case-sensitiv?
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Gregor, Gregor Schneider wrote: | thanks a lot, that's the reason why. | | I'm wondering what those guys from MySQL thought when introducing this | feature... Try this: ALTER TABLE users ~ MODIFY COLUMN user_name VARCHAR(40) BINARY ; No need to get all worked up over adjustable behavior :) - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkgtwk4ACgkQ9CaO5/Lv0PBcKACgoUGbeNbXSlEPxTOQ+Gd2mjJk zAQAn23/FqOo+krg1U29TQR/zcTR9yt2 =vUa3 -END PGP SIGNATURE- - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: User-JDBC-Realm: User case-sensitiv?
Gregor, You can use WHERE x LIKE condition to perform a case-sensitive search without modifying the structure of the table(s) involved by using the BINARY keyword. SELECT * FROM `foo` WHERE `bar` LIKE BINARY 'tesT' will not pull the record test or Test, but only matches the record tesT. Todd Boyd Web Programmer -Original Message- 8 snip! Usually, a database is transparent for the programmer: He doesn't need to about the details of the soring-mechanisms, but *what* he has to know is that fooBar != FooBar - fullstop. if you application needs a feature, that i.e. a search is case-insensitiv, then he will have to code it - there are tons of functions available just exactly for this purpose (i.s. String.equalsIgnoreCase() etc.). Anyways, coming slightly back topic: If somebody else should run into the same problem, it's easy to fix by either using a sliglty modified create-table - statement having the binary-attribute: create table foo ( bar varchar (40) binary not null; ) or changing existing tables using this alter-statement also containing the binary-attribute: alter table [table-name] change [column-name-old] [column-name-new] varchar(length) binary; - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]