#2141 (ok 2.11) \"PRIMARY and INDEX keys should not both be set ..\"

2.8.0.3
fixed
1
2015-01-12
2006-05-05
No

Hi,

I have a table:
----------------------------------
CREATE TABLE `ImportFiles` (
`filesize` int(11) NOT NULL,
`date` datetime NOT NULL,
`filename` varchar(255) NOT NULL,
`imported` tinyint(4) NOT NULL,
PRIMARY KEY (`filename`,`filesize`,`date`),
KEY `filename` (`filename`,`imported`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
----------------------------------

Now in phpMyAdmin it shows "PRIMARY and INDEX keys
should not both be set for column `filename`".

I think this is not logical because it's perfectly
legal to have those 2 indexes because MySQL (afaik) is
not capable of using 2 indexes on the same table.

Greetings,
Steven

Discussion

  • Marc Delisle

    Marc Delisle - 2006-05-08

    Logged In: YES
    user_id=210714

    See also bug #1083301 but let's keep both reports for
    completeness.

     
  • Marc Delisle

    Marc Delisle - 2006-05-25

    Logged In: YES
    user_id=210714

    Which version of MySQL are you using?

     
  • Marc Delisle

    Marc Delisle - 2006-05-25
    • assigned_to: nobody --> lem9
     
  • Steven Van Ingelgem

    Logged In: YES
    user_id=569271

    The one from Debian unstable. I think it is 5.0.20a or
    something like that. (For sure 5.0, but the last numbers I
    don't remember)

     
  • Steven Van Ingelgem

    Logged In: YES
    user_id=569271

    Ofcourse not ;). I thought it was not possible in MySQL. I
    was wrong. That's all there is to it. Is there a switch that
    this error doesn't appear in < 5?

     
  • Marc Delisle

    Marc Delisle - 2006-05-29

    Logged In: YES
    user_id=210714

    I'll have a look.

     
  • Marc Delisle

    Marc Delisle - 2006-06-08

    Logged In: YES
    user_id=210714

    There is no check about the MySQL version.

     
  • Marc Delisle

    Marc Delisle - 2006-06-08
    • assigned_to: lem9 --> nobody
     
  • Marc Delisle

    Marc Delisle - 2007-03-08
    • assigned_to: nobody --> lem9
    • status: open --> open-rejected
     
  • Marc Delisle

    Marc Delisle - 2007-03-08
    • status: open-rejected --> closed-rejected
     
  • Sebastian Mendel

    • assigned_to: lem9 --> cybot_tm
    • status: closed-rejected --> open-accepted
     
  • Sebastian Mendel

    Logged In: YES
    user_id=326580
    Originator: NO

    fixed in trunk, will be in 2.11

     
  • Sebastian Mendel

    • priority: 5 --> 1
    • summary: "PRIMARY and INDEX keys should not both be set for column" --> (ok 2.11) "PRIMARY and INDEX keys should not both be set .."
    • status: open-accepted --> open-fixed
     
  • Marc Delisle

    Marc Delisle - 2007-08-21
    • summary: (ok 2.11) "PRIMARY and INDEX keys should not both be set .." --> (ok 2.11) \"PRIMARY and INDEX keys should not both be set ..\"
    • status: open-fixed --> closed-fixed
     
  • Michal Čihař

    Michal Čihař - 2013-06-11
    • Status: closed-fixed --> fixed