I'm used to PostgreSQL and don't understand this behaviour on MySQL.
This table (from SugarCRM) has 3057 rows:
mysql> SELECT count(*) FROM tasks ;
+----------+
| count(*) |
+----------+
| 3057 |
+----------+
But when running SELECT * FROM tasks
:
mysql> SELECT * FROM tasks ;
...
2344 rows in set (0,02 sec)
I'm using a fairly old version of MySQL, but the issue is I'm just trying to dump the database and restore to a new version.
# mysql --version
mysql Ver 14.14 Distrib 5.1.51, for slackware-linux-gnu (x86_64) using EditLine wrapper
Do you have any ideas?
SELECT * FROM tasks LIMIT 4000;
? – Leatherback2344 rows in set (0,02 sec)
– Borneselect SQL_NO_CACHE count(*) from tasks
? – LimacineSELECT version()
. – Gallegosselect SQL_NO_CACHE count(*) from tasks
returns 3057 rows.select SQL_NO_CACHE * from tasks
returns 2344 rows. – BorneSELECT version()
shows version5.1.51
as well. – BorneREPAIR TABLE tbl_name
. – Gallegos