Bug #37707 UCASE Doesn't work when executing a query.... Compares as case insensitive
Submitted: 28 Jun 2008 3:21 Modified: 28 Jul 2008 12:23
Reporter: James Just James Email Updates:
Status: No Feedback Impact on me:
None 
Category:MySQL Server Severity:S2 (Serious)
Version:MySQL 5.0.51a-3ubuntu5.1 OS:Linux (ubuntu)
Assigned to: CPU Architecture:Any

[28 Jun 2008 3:21] James Just James
Description:
MYSQL is not being case sensitive on linux

look at the following query and you'll notice that it returns a lower case result, when it shouldn't!

below i've included an html page example:
copy and paste into a file and open...
cheers

<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html dir="ltr" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml" lang="en"><head>

<link rel="icon" href="http://localhost/phpmyadmin/favicon.ico" type="image/x-icon">
<link rel="shortcut icon" href="http://localhost/phpmyadmin/favicon.ico" type="image/x-icon">
<title>SQL result - phpMyAdmin 2.11.3deb1ubuntu1</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

</head><body bgcolor="#ffffff">
<h1>SQL result</h1>
<p>
    <b>Host:</b> localhost<br>
    <b>Database:</b> sometbl<br>
    <b>Generation Time:</b> Jun 27, 2008 at 11:14 PM<br>
    <b>Generated by:</b> phpMyAdmin 2.11.3deb1ubuntu1 / MySQL 5.0.51a-3ubuntu5.1<br>
    <b>SQL query:</b>
SELECT * FROM `sometbl` . `tbl_people` WHERE ( ( `id_number` = 0 ) AND ( (
`fname` = UCASE( "ROOT" ) ) AND ( `lname` = UCASE( "" ) ) ) AND (
`password` = SHA1( "password" ) ) ) LIMIT 0, 30 ; <br>
    <b>Rows:</b> 1    </p>

<table id="table_results" class="data">
<thead><tr>
<th>id
</th><th class="condition">id_number
<span class="tblcomment"></span></th><th class="condition">fname
</th><th class="condition">lname
</th><th>sex
<span class="tblcomment"></span></th><th>email
</th><th class="condition">password
<span class="tblcomment"></span></th><th>number
<span class="tblcomment"></span></th><th>othernumber
<span class="tblcomment"></span></th><th>locale
<span class="tblcomment"></span></th><th>order
<span class="tblcomment"></span></th></tr>
</thead>
        <tbody>
    <tr class="odd">
    <td class="nowrap" align="right">36</td>
    <td class="condition nowrap" align="right">0</td>
    <td class="condition">root</td>
    <td class="condition"> </td>
    <td class="" align="right"><i>NULL</i></td>
    <td class=""><i>NULL</i></td>
    <td class="condition">5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8</td>
    <td class="nowrap" align="right">255</td>
    <td class="nowrap" align="right">131071</td>
    <td class="">en_CA.utf8</td>
    <td class="">0_1_2_3_4_5_6_7_8_9_10_11</td>
</tr>
            
</tbody>
</table>
</body></html>

How to repeat:
execute the shown query...

Suggested fix:
???
[28 Jun 2008 3:21] James Just James
example query

Attachment: SQLBUG.htm (text/html), 2.10 KiB.

[28 Jun 2008 12:23] Sveta Smirnova
Thank you for the report.

It looks like you use case insenstitive colaltion, so results of comparision are expected. Please provide output of SHOW CREATE TABLE tbl_people to be sure.
[28 Jul 2008 23:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".