Maybe it is because some of your id are bigger than 127 wich is the limit
for the Tinyint and when it is converted to this type, "127" is replacing
all your id bigger than 127. Then you have multiple id with 127.

Regards,

Stephan

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, September 11, 2002 10:01 AM
To: [EMAIL PROTECTED]
Subject: Problem with ALTER TABLE (err 1068)




Hello,
I have a problem with the command ALTER TABLE.
For example, this simple table "test" :
+---------+---------------+------+-----+---------+----------------+
| Field   | Type          | Null | Key | Default | Extra          |
+---------+---------------+------+-----+---------+----------------+
| id      | int(10)       |      | PRI | NULL    | auto_increment |
| texte   | varchar(255)  | YES  |     | NULL    |                |
+---------+---------------+------+-----+---------+----------------+

I want to modify the id column and convert it to tinyint type. The command
line
is :

ALTER TABLE test MODIFY COLUMN id tinyint(3) unsigned NOT NULL PRIMARY KEY
default NULL auto_increment;

I launch it and I have this error :

ERROR 1068: Multiple primary key defined

Obviously if I remove the PRIMARY KEY, it does not begin squalling...
The problem is that it's an automatic program which launches the ALTER TABLE
so
I'll be happy if I can keep the "PRIMARY KEY".
This was tested on a MySQL 4.0.2 as well as on 3.23.51.
Is it a limit of ALTER ? A syntax error ?... Thank for your answers and
sorry
for my english :)
Florent.



---------------------------------------------------------------------
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 <[EMAIL PROTECTED]>
To unsubscribe, e-mail
<[EMAIL PROTECTED]>
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 <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to