Bug #4011 Mysql return invalid column names when query is written in small caps.
Submitted: 4 Jun 2004 18:24 Modified: 21 Aug 2004 6:34
Reporter: Sylwester Zarebski
Status: No Feedback
Category:Client Severity:S3 (Non-critical)
Version:4.1.2-alpha-standard OS:Linux (RH 9)
Assigned to: Dean Ellis Target Version:

[4 Jun 2004 18:24] Sylwester Zarebski
Description:
Mysql database sometimes returns bad column names when query is written in small caps. It
shows:
mysql> select * from email where eml_userid=1;
+------+------+------------------+-------+------------+
| B   |     | @               |         @    |  @         |
+------+------+------------------+-------+------------+
| 1    | 1    | adamp@isp.net.pl | adamp | isp.net.pl |
+------+------+------------------+-------+------------+
1 row in set (0.01 sec)

When i change some letters then:
mysql> SELECT * from email where eml_userid=1;
+--------+------------+------------------+----------+------------+
| eml_id | eml_userid | eml_address      | eml_user | eml_domain |
+--------+------------+------------------+----------+------------+
|      1 |          1 | adamp@isp.net.pl | adamp    | isp.net.pl |
+--------+------------+------------------+----------+------------+
1 row in set (0.01 sec)

I do not know if this is mysqld problem, or client libraries problem, but sometimes it
only shows in mysql client, sometimes in php (in php i got array with strange indexes).
Sometimes it vanishes if i restard mysql, but not everytime. Now i tried a test, have
mysql client open and restart a database, and problem shows (the same as i paste few
lines up), but then i quit all mysql clients, restart database, and problem is gone (!!).
What it may be?

How to repeat:
Very hard, i've never had a problem with 3.23 converted databases, but for few new
created dbs sometimes queries behave strange. I can send You my databases if it helps, or
it is my well known problem?

Suggested fix:
Change query to have some big caps.
[4 Jun 2004 19:03] Dean Ellis
Can you provide a repeatable test case, with the SQL to create, populate and query the
table, demonstrating this behavior?  I'm not having any success repeating it, so some
form of test case would be very helpful.
[8 Jun 2004 21:32] Sylwester Zarebski
No, i can not provide repeatable test, because i encounter this bug few times only. To
find some past few days i played with mysql client, and now i mostly suspect it. Let me
explain my test.. i commonly open mysql client in screen session and let it be under some
screen for few days, and then from some moment client start to show weird result's
columns. If i quit client and run again, the same problem shows (is it in mysql cache??),
but if i quit client, and do not run for e.g. one or two days, then client do show
correctly. Very weird... and except it (very minor problem) everything works pretty nice
(and much better than 3.xx versions).
Problem resolution#2: do not run mysql client too long ;-).