On Tuesday 17 December 2002 03:09, Lopez David E-r9374c wrote: > Problem is type SMALLINT needs to be MEDIUMINT (MyISAM). > > column: id SMALLINT UNSIGNED NOT NULL AUTO_INCREMENT > > My solution is to use the following ALTER statement: > > ALTER TABLE messages CHANGE id > id MEDIUMINT UNSIGNED NOT NULL AUTO_INCREMENT > > My question is: what happens to the sequence of > numbers in this primary key?
> The manual states that if you don't change the > AUTO_INCREMENT column, the sequence number will > not be affected. It also says that if you drop > a AUTO_INCREMENT column and then add another > AUTO_INCREMENT column, MySQL will resequence the > new column. > > Well I'm kinda in-between these two extremes. I want > to increase the width but keep the sequence. As usual, > this is a primary key which will affect other tables > (foreign keys). The total rows affected is 14 million. If you wil use CHANGE or MODIFY, sequence number will not be affected, too. > > BTW I expected the rows would be around 50. It's now > near 60k. So much for my foresight. -- For technical support contracts, goto https://order.mysql.com/?ref=ensita This email is sponsored by Ensita.net http://www.ensita.net/ __ ___ ___ ____ __ / |/ /_ __/ __/ __ \/ / Egor Egorov / /|_/ / // /\ \/ /_/ / /__ [EMAIL PROTECTED] /_/ /_/\_, /___/\___\_\___/ MySQL AB / Ensita.net <___/ www.mysql.com --------------------------------------------------------------------- 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