Bug #946 selecting a single column returns large integers instead of the text contents
Submitted: 29 Jul 2003 7:45 Modified: 31 Aug 2003 11:37
Reporter: Tau Ceti Email Updates:
Status: No Feedback Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:3.23.54 OS:Linux (Redhat 8)
Assigned to: CPU Architecture:Any

[29 Jul 2003 7:45] Tau Ceti
Description:
When running a select on our database if just one field is selected with a limit it returns large integers. If more than one field is selected, there is something more than a limit (like a where clause) or the limit is removed the select performs as expected. The field is a char(20) and is a unique key.

From a describe:
| Field           | Type     | NULL | Key | Default | Extra |
| account_name    | char(20) |      | UNI |         |       |

How to repeat:
# First a test of a specific row
mysql> select account_name from account where account_name = 'tauceti';
+--------------+
| account_name |
+--------------+
| tauceti      |
+--------------+
1 row in set (0.00 sec)

# Next, the bug. Just the limit and that field are present
mysql> select account_name from account limit 10;
+--------------+
| account_name |
+--------------+
| 012642752    |
| 013442670    |
| 013700461    |
| 013723699    |
| 013820635    |
| 019849508    |
| 026569968    |
| 027629177    |
| 028665706    |
| 029502379    |
+--------------+
10 rows in set (0.00 sec)

# Add a where clause and it works fine
mysql> select account_name from account where account_name like 't%' limit 10;
+--------------+
| account_name |
+--------------+
| tany         |
| tangl        |
| tangelx      |
| tanguben     |
| taran        |
| taraxb       |
| tarrent      |
| tatiano      |
| tauceti      |
| tbaxin       |
+--------------+
10 rows in set (0.00 sec)

# Add a second column and it also works fine
mysql> select account_name, employee_type from account limit 10;
+--------------+---------------+
| account_name | employee_type |
+--------------+---------------+
| tnesaka      | NOEMP         |
| soba         | NOEMP         |
| psegian      | NOEMP         |
| kcax         | NOEMP         |
| covbil83     | NOEMP         |
| sanzer       | NOEMP         |
| mcarms       | NOEMP         |
| hubers       | NOEMP         |
| cparkens     | NOEMP         |
| reel         | NOEMP         |
+--------------+---------------+
10 rows in set (0.01 sec)
[29 Jul 2003 12:03] Indrek Siitan
I wasn't able to repeat the behaviour you described.

Have you compiled MySQL on your own or are you using a binary 
distribution (our Linux binary, our RPM, RedHat's RPM)? If you have
compiled it on your own, you should switch to using our binary
or RPM. Can you also upgrade to the latest 3.23 version (3.23.57
as of today) or the latest 4.0 (4.0.14) and see if the problem still
persists?
[30 Jul 2003 13:00] Tau Ceti
We're using the supplied RPM with the current distro. We're okay with the bug for now, none of our queries look like what causes the bug, I stumbled apon it while testing some things.
[31 Jul 2003 2:36] Alexander Keremidarski
Hello,

This is extremely weird.

+--------------+
| account_name |
+--------------+
| 012642752    |
| 013442670    |

This output looks like another column with some kind of unique IDs.
I never saw anthing like this before

What is whole structure of your table?
SHOW CREATE TABLE account;
[14 Feb 2005 22:54] 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".