Bug #41407 BUG IN A SELECT WITH/WITHOUT ORDER BY
Submitted: 11 Dec 2008 17:31 Modified: 11 Jan 2009 20:04
Reporter: Erico Fusco (OCA) Email Updates:
Status: No Feedback Impact on me:
None 
Category:MySQL Server: InnoDB storage engine Severity:S1 (Critical)
Version:5.1.30 OS:Linux
Assigned to: CPU Architecture:Any
Tags: order by, SELECT

[11 Dec 2008 17:31] Erico Fusco
Description:
Hi guys, I'm doing a select in a table MyISAM where I ran the TRUNCATE TABLE on it.

But when I do a select with ORDER BY, the data will there, but a select without a order by, the table is empty.

mysql> SELECT * FROM SITE_TARIFADOR;
Empty set (0.00 sec)

mysql> SELECT * FROM SITE_TARIFADOR ORDER BY NOMESITE;
+---------+------------+-----------------+---------------+----------+-----------+-------+-----------+---------+------+-----------------------------------------------------+------+-------------+---------+--------+----------+----------+----------------+------------+----------------+--------+
| CODSITE | NOMESITE   | INFOSITE        | DBSITE        | latitude | longitude | CNL   | CNL_LOCAL | PREFIXO | CAT  | DIRETORIOARQ                                        | UF   | tipoarquivo | comando | status | dataproc | procauto | prefixocentral | PREFIXOTEL | AUTH           | COR    |
+---------+------------+-----------------+---------------+----------+-----------+-------+-----------+---------+------+-----------------------------------------------------+------+-------------+---------+--------+----------+----------+----------------+------------+----------------+--------+
|       1 | Lapa A     | Lapa A - SP     | STN_LAPAA     | NULL     | NULL      | 11000 | SPO       | 11      | 011  | /var/www/invoice/tarifador/files/coletas/LAPAA/     | SP   |           1 | NULL    |      0 | NULL     | S        | NULL           | 11         | AUTH_LAPAA     | 008000 |
|       2 | Lapa B     | Lapa B - SP     | STN_LAPAB     | NULL     | NULL      | 11000 | SPO       | 11      | 011  | /var/www/invoice/tarifador/files/coletas/LAPAB/     | SP   |           1 | NULL    |      0 | NULL     | S        | NULL           | 11         | AUTH_LAPAB     | 000080 |
|       3 | Paulista A | Paulista A - SP | STN_PAULISTAA | NULL     | NULL      | 11000 | SPO       | 11      | 011  | /var/www/invoice/tarifador/files/coletas/PAULISTAA/ | SP   |           1 | NULL    |      0 | NULL     | S        | NULL           | 11         | AUTH_PAULISTAA | 666633 |
|       4 | Paulista B | Paulista B - SP | STN_PAULISTAB | NULL     | NULL      | 11000 | SPO       | 11      | 011  | /var/www/invoice/tarifador/files/coletas/PAULISTAB/ | SP   |           1 | NULL    |      0 | NULL     | S        | NULL           | 11         | AUTH_PAULISTAB | FF6600 |
+---------+------------+-----------------+---------------+----------+-----------+-------+-----------+---------+------+-----------------------------------------------------+------+-------------+---------+--------+----------+----------+----------------+------------+----------------+--------+
4 rows in set (0.00 sec)

mysql> SELECT * FROM SITE_TARIFADOR;
Empty set (0.00 sec)

How to repeat:
Create a MyISAM table.
Insert valyes on it.
Truncate the table.
SELECT all data without order by
SELECT all data with order by.
[11 Dec 2008 17:42] Erico Fusco
Is nots MyISAM, it's InnoDB!
[11 Dec 2008 20:04] Sveta Smirnova
Thank you for the report.

Please provide output of SHOW CREATE TABLE SITE_TARIFADOR;
[12 Jan 2009 0: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".