List:General Discussion« Previous MessageNext Message »
From:Paul DuBois Date:June 13 2002 9:08pm
Subject:Re: Why does Key==Mul in DESCRIBE TABLE for unique key?
View as plain text  
At 14:54 -0500 6/13/02, Gerald Clark wrote:
>CREATE TABLE X (FLD1 INT PRIMARY KEY);
>or
>CREATE TABLE X (FLD1 INT, UNIQUE(FLD1));
>
>UNIQUE applies to an index, not a field.

That latter statement is equivalent to the one he used.
The problem is that the column isn't declared NOT NULL.
Your PRIMARY KEY declaration would result in the intended
effect, too, because it automatically causes the column to
be declared NOT NULL.

>
>
>
>Andy Sy wrote:
>
>>----- Original Message ----- From: "Paul DuBois" <paul@stripped>
>>To: "Andy Sy" <andy@stripped>; <mysql@stripped>
>>Sent: Friday, June 14, 2002 2:45 AM
>>Subject: Re: Why does Key==Mul in DESCRIBE TABLE for unique key?
>>
>>>At 2:03 +0800 6/14/02, Andy Sy wrote:
>>>
>>>>mysql> CREATE TABLE X (FLD1 INT UNIQUE);
>>>>Query OK, 0 rows affected (0.05 sec)
>>>>
>>>>mysql> DESCRIBE X;
>>>>+-------+---------+------+-----+---------+-------+
>>>>| Field | Type    | Null | Key | Default | Extra |
>>>>+-------+---------+------+-----+---------+-------+
>>>>| FLD1  | int(11) | YES  | MUL | NULL    |       |
>>>>+-------+---------+------+-----+---------+-------+
>>>>
>>>>Doesn't MUL mean a key can exist multiple times
>>>>in the index?
>>>>
>>>Right. It means it's part of a non-unique index.
>>>
>>
>>But I declared the field as UNIQUE (see the CREATE
>>TABLE statement).
>>
>>
>>
>>---------------------------------------------------------------------
>>Before posting, please check:
>>   http://www.mysql.com/manual.php   (the manual)
>>   http://lists.mysql.com/           (the list archive)
>>
>>To request this thread, e-mail <mysql-thread111900@stripped>
>>To unsubscribe, e-mail 
>><mysql-unsubscribe-gerald_clark=suppliersystems.com@stripped>
>>Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
>>
>
>
>
>---------------------------------------------------------------------
>Before posting, please check:
>   http://www.mysql.com/manual.php   (the manual)
>   http://lists.mysql.com/           (the list archive)
>
>To request this thread, e-mail <mysql-thread111908@stripped>
>To unsubscribe, e-mail <mysql-unsubscribe-paul=snake.net@stripped>
>Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Thread
delete corruptsNick Traenkner13 Jun
  • Re: delete corruptscal13 Jun
  • Re: delete corruptsRalf Narozny13 Jun
  • Re: delete corruptscal13 Jun
  • Re: delete corruptsNick Traenkner13 Jun
  • Re: delete corruptscal13 Jun
    • about MySQL CCsavaidis16 Jun
      • Re: about MySQL CCMikeParton16 Jun
  • Why does Key==Mul in DESCRIBE TABLE for unique key?Andy Sy13 Jun
    • Re: Why does Key==Mul in DESCRIBE TABLE for unique key?Paul DuBois13 Jun
  • Re: Why does Key==Mul in DESCRIBE TABLE for unique key?Andy Sy13 Jun
    • Re: Why does Key==Mul in DESCRIBE TABLE for unique key?Paul DuBois13 Jun
  • Re: Why does Key==Mul in DESCRIBE TABLE for unique key?Gerald Clark13 Jun
    • Re: Why does Key==Mul in DESCRIBE TABLE for unique key?Paul DuBois13 Jun