List:General Discussion« Previous MessageNext Message »
From:fabsk Date:January 24 2006 6:08pm
Subject:Re: count(*) send a wrong value
View as plain text  
Le mardi 24 janvier 2006 à 09:19 +0100, Martijn Tonies a écrit :
>> CREATE TABLE `tp_participation` (
>>   `uid` int(11) NOT NULL default '0',
>>   `challenge_id` int(11) NOT NULL default '0',
>>   `response` text collate latin1_general_ci NOT NULL,
>>   `points` int(11) default NULL,
>>   UNIQUE KEY `tp_id_part` (`uid`,`challenge_id`),
>>   KEY `tp_idx_part_solution` (`challenge_id`,`response`(4))
> ) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;
> > select * from tp_participation where challenge_id=20
> > > 10 records.
> >
> > select challenge_id from tp_participation where challenge_id=20
> > > _two_ records with the value "20".
>
> What are the results if you drop all constraints and indices?
> 

Thank you a lot for your answer. The bug is there: if I drop the index
'tp_idx_part_solution', the result of the count is OK.
I recreated this index and the cound drop to "2" again.

Fabien

Thread
count(*) send a wrong valuefabsk23 Jan
  • Re: count(*) send a wrong valuemysql23 Jan
    • Re: count(*) send a wrong valueFabien SK23 Jan
    • Re: count(*) send a wrong valuefabsk23 Jan
    • Re: count(*) send a wrong valueMichael Stassen23 Jan
  • Re: count(*) send a wrong valueRhino23 Jan
    • Re: count(*) send a wrong valuefabsk24 Jan
  • Re: count(*) send a wrong valueHank24 Jan
  • Re: count(*) send a wrong valueMartijn Tonies24 Jan
    • Re: count(*) send a wrong valuefabsk24 Jan
      • Re: count(*) send a wrong valueFabien SK24 Jan
        • Re: count(*) send a wrong valueFabien SK24 Jan