From: Johan De Meersman Date: March 2 2011 2:21pm Subject: Re: Two Identical Values on Primary Key Column List-Archive: http://lists.mysql.com/mysql/224551 Message-Id: <90a27bb4-56df-4817-8da4-73dbb460d566@zimbra> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="=_346b0516-8e9e-45da-961e-e7160cb3ddb3" --=_346b0516-8e9e-45da-961e-e7160cb3ddb3 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Is it possible that someone did an alter table disable keys at some point, maybe for a bulk load, and forgot to re-enable them ? ----- Original Message ----- > From: "Rodrigo Ferreira" > To: mysql@stripped > Sent: Wednesday, 2 March, 2011 3:04:31 PM > Subject: Two Identical Values on Primary Key Column > Hi all, > I have just experienced a strange problem with mysql production > database. The table faqsessions have a primary key on column `Code` > and the above select return 2 rows! > mysql> > mysql> > mysql> show create table faqsessions; > +-------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ > +-------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ > `Code` int(11) unsigned NOT NULL auto_increment, > `sid` int(11) NOT NULL, > `ip` text NOT NULL, > `time` int(11) NOT NULL, > PRIMARY KEY (`Code`) > ) ENGINE=InnoDB AUTO_INCREMENT=1567573 DEFAULT CHARSET=latin1 | > +-------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ > 1 row in set (0.00 sec) > mysql> > mysql> > mysql> select * from faqsessions where time in (1268650281, > 1268650260); > +--------+--------+--------------+------------+ > +--------+--------+--------------+------------+ > +--------+--------+--------------+------------+ > 2 rows in set (1.49 sec) > mysql> > mysql> > mysql> select * from faqsessions where Code = 611179; > +--------+--------+--------------+------------+ > +--------+--------+--------------+------------+ > +--------+--------+--------------+------------+ > 1 row in set (0.00 sec) > Any idea? > Rodrigo Ferreira > CMDBA, CMDEV -- Bier met grenadyn Is als mosterd by den wyn Sy die't drinkt, is eene kwezel Hy die't drinkt, is ras een ezel --=_346b0516-8e9e-45da-961e-e7160cb3ddb3--