Wrong count(*)
Date: November 15, 2005 07:19AM
mysql> select count(*) from vote where model=49;
+----------+
| count(*) |
+----------+
| 2 |
+----------+
1 row in set (0.00 sec)
mysql> select count(id) from vote where model=49;
+-----------+
| count(id) |
+-----------+
| 4 |
+-----------+
1 row in set (0.00 sec)
mysql> select * from vote where model=49;
+-----+-------+---------------+
| id | model | login |
+-----+-------+---------------+
| 228 | 49 | <b>Script</b> |
| 229 | 49 | <b>Script</b> |
| 332 | 49 | <b>Script</b> |
| 333 | 49 | <b>Script</b> |
+-----+-------+---------------+
4 rows in set (0.00 sec)
mysql> show create table vote;
+-------+-------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
-------------------------------------+
| Table | Create Table
|
+-------+-------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
-------------------------------------+
| vote | CREATE TABLE `vote` (
`id` int(11) NOT NULL auto_increment,
`model` int(11) NOT NULL default '0',
`login` text NOT NULL,
PRIMARY KEY (`id`),
KEY `model_2` (`model`,`login`(32))
) ENGINE=MyISAM DEFAULT CHARSET=latin1 |
+-------+-------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
-------------------------------------+
1 row in set (0.00 sec)
mysql>
server version: 4.1.14
I guess no further explanations are needed.
Made repair table and myisamchk several times with different options – doesn’t solved.
Or I am deeply wrong somewhere, but I can’t find out.
Sorry, you can't reply to this topic. It has been closed.
© 1995-2008 MySQL AB, 2008- Sun Microsystems, Inc.