Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

The Database Forum


You are currently viewing our The Database Forum as a guest. Please register to participate.
Login



Reply
mysql case sensitivty
Old 05-01-2009, 04:43 PM mysql case sensitivty
Super Talker

Posts: 130
Trades: 0
Has anyone ever seen it where you do a join on two tables and the field that you're doing the join on are of different cases and it doesn't join? Both tables have a collation of latin_swedish_ci. I've tried the same query on a different server and it works fine. The server where it fails is 5.0.32 and the two servers that work are 5.0.51 and 5.0.24. Is there somewhere else that this case sensitivity could be affecting the outcome?
__________________
flann

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
flann is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 05-01-2009, 04:59 PM Re: mysql case sensitivty
NullPointer's Avatar
Will Code for Food

Posts: 2,784
Name: Matt
Location: Irvine, CA
Trades: 0
Use a left join and explicity denote which columns should be mapped to which columns:
Code:
SELECT * FROM t1 LEFT JOIN ( t2 )
                 ON ( t2.c = t1.c )
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
NullPointer is online now
Reply With Quote
View Public Profile Visit NullPointer's homepage!
 
Old 05-01-2009, 05:18 PM Re: mysql case sensitivty
Super Talker

Posts: 130
Trades: 0
That is exactly how i'm doing the join. I even tried switching it to an inner join to see if that had any effect.
__________________
flann

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
flann is offline
Reply With Quote
View Public Profile
 
Old 05-01-2009, 07:21 PM Re: mysql case sensitivty
tripy's Avatar
Do not try this at home!

Posts: 3,621
Name: Thierry
Location: I'm the uber Spaminator !
Trades: 0
Are you really sure the tables both have an case insensitive collation ?

Just to verify, I took a test table, and tried to join it to itself between an user name and username.
The username was an upper() of the name, and it worked.
Maybe it's another clause of the join that prevent it from working.
Did you tried to join just on that (var)char field to see the results ?
__________________
Only a biker knows why a dog sticks his head out the window.

Last edited by tripy; 05-01-2009 at 07:31 PM..
tripy is offline
Reply With Quote
View Public Profile Visit tripy's homepage!
 
Old 05-03-2009, 04:57 PM Re: mysql case sensitivty
Super Talker

Posts: 130
Trades: 0
I have looked at the create statment's for the tables and also verified it in the INFORMATION_SCHEMA database to make sure. I've taken the tables out of a bigger query and only used the two tables. The join failed and then I updated the field that was lowercase and made it upper case and the join worked. Switched it back to lower case and it failed again. I wrap the upper() around the field and it works. I've also tried joining other tables with the same collation on the same server and they work with different cases. Something is causing it, and I'm not going to stop looking until I understand why. Hopefully with your help . Thank you.
__________________
flann

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
flann is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to mysql case sensitivty
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.14722 seconds with 12 queries