RE: Primary key not unique on InnoDB table

2010-10-15 Thread Travis Ard
ct: Fwd: Primary key not unique on InnoDB table Based on my reply below, do you recommend I continue to have these indexes ? -- Forwarded message -- From: Tompkins Neil Date: Wed, Oct 13, 2010 at 8:22 PM Subject: Re: Primary key not unique on InnoDB table To: Travis Ard Cc: &q

Fwd: Primary key not unique on InnoDB table

2010-10-15 Thread Tompkins Neil
Based on my reply below, do you recommend I continue to have these indexes ? -- Forwarded message -- From: Tompkins Neil Date: Wed, Oct 13, 2010 at 8:22 PM Subject: Re: Primary key not unique on InnoDB table To: Travis Ard Cc: "[MySQL]" Hi Travis, Thanks for you

Re: Primary key not unique on InnoDB table

2010-10-13 Thread Tompkins Neil
requirements. > > -Travis > > -Original Message- > From: Tompkins Neil [mailto:neil.tompk...@googlemail.com] > Sent: Wednesday, October 13, 2010 8:37 AM > To: [MySQL] > Subject: Primary key not unique on InnoDB table > > I've the following table. But why i

RE: Primary key not unique on InnoDB table

2010-10-13 Thread Travis Ard
and add to your storage requirements. -Travis -Original Message- From: Tompkins Neil [mailto:neil.tompk...@googlemail.com] Sent: Wednesday, October 13, 2010 8:37 AM To: [MySQL] Subject: Primary key not unique on InnoDB table I've the following table. But why isn't the pri

Re: Primary key not unique on InnoDB table

2010-10-13 Thread Tompkins Neil
Shawn it is fine. I thought my primary key was just 1 field. On Wed, Oct 13, 2010 at 4:44 PM, Shawn Green (MySQL) < shawn.l.gr...@oracle.com> wrote: > On 10/13/2010 11:37 AM, Tompkins Neil wrote: > >> Shawn, sorry my error, I didn't realise I had two fields as the primary >> key >> >> > That's

Re: Primary key not unique on InnoDB table

2010-10-13 Thread Shawn Green (MySQL)
On 10/13/2010 11:37 AM, Tompkins Neil wrote: Shawn, sorry my error, I didn't realise I had two fields as the primary key That's misinformation. You can have multiple fields as a primary key. Show us what you think is duplicate data and I may be able to help you fix your definition -- Shaw

Re: Primary key not unique on InnoDB table

2010-10-13 Thread Shawn Green (MySQL)
On 10/13/2010 10:37 AM, Tompkins Neil wrote: I've the following table. But why isn't the primary key unique, e.g. preventing duplicates if entered ? CREATE TABLE `players_master` ( `players_id` bigint(20) NOT NULL AUTO_INCREMENT, `default_teams_id` bigint(20) NOT NULL, `first_name` va

Re: Primary key not unique on InnoDB table

2010-10-13 Thread Tompkins Neil
Of course, sorry totally stupid should I recognised that. Thanks Neil On Wed, Oct 13, 2010 at 3:46 PM, Krishna Chandra Prajapati < prajapat...@gmail.com> wrote: > Hi Neil, > > Yes, primary key is always unique. > > In your case, you are using composite key (players_id,default_teams_id). > > _Kri

Re: Primary key not unique on InnoDB table

2010-10-13 Thread Tompkins Neil
I see what you mean. Infact this is wrong and I will be dropping the second field in the primary key. 2010/10/13 João Cândido de Souza Neto > A primary key with an auto_increment is ok, but I cant think about a > primary > key with two fiels where one of them is autoincrement. Am I completely

Re: Primary key not unique on InnoDB table

2010-10-13 Thread Jo�o C�ndido de Souza Neto
A primary key with an auto_increment is ok, but I cant think about a primary key with two fiels where one of them is autoincrement. Am I completely wrong? -- João Cândido de Souza Neto "Tompkins Neil" escreveu na mensagem news:aanlkti=xnjcaiq7bmoxg-q+4nowdhv8uaj9dcqrol...@mail.gmail.com...

Re: Primary key not unique on InnoDB table

2010-10-13 Thread Tompkins Neil
Sorry Joao, I thought that was pretty standard to have a primary key with auto_increment ?? 2010/10/13 João Cândido de Souza Neto > Sorry, the word is counpound instead of composed. > > -- > João Cândido de Souza Neto > > ""João Cândido de Souza Neto"" escreveu na > mensagem news:2010101

Re: Primary key not unique on InnoDB table

2010-10-13 Thread Krishna Chandra Prajapati
Hi Neil, Yes, primary key is always unique. In your case, you are using composite key (players_id,default_teams_id). _Krishna On Wed, Oct 13, 2010 at 8:07 PM, Tompkins Neil wrote: > I've the following table. But why isn't the primary key unique, e.g. > preventing duplicates if entered ? > >

Re: Primary key not unique on InnoDB table

2010-10-13 Thread Jo�o C�ndido de Souza Neto
Sorry, the word is counpound instead of composed. -- João Cândido de Souza Neto ""João Cândido de Souza Neto"" escreveu na mensagem news:20101013144314.9787.qm...@lists.mysql.com... > I´d never seen before a composed primary key that has an auto_increment > field on it. > > May be I can

Re: Primary key not unique on InnoDB table

2010-10-13 Thread Jo�o C�ndido de Souza Neto
I´d never seen before a composed primary key that has an auto_increment field on it. May be I can be wrong but I think it wont work properly. As far as I know, if you have an auto_increment field it must be your single primary key. Am I wrong? -- João Cândido de Souza Neto "Tompkins Neil"

Primary key not unique on InnoDB table

2010-10-13 Thread Tompkins Neil
I've the following table. But why isn't the primary key unique, e.g. preventing duplicates if entered ? CREATE TABLE `players_master` ( `players_id` bigint(20) NOT NULL AUTO_INCREMENT, `default_teams_id` bigint(20) NOT NULL, `first_name` varchar(100) COLLATE utf8_unicode_ci NOT NULL, `se