Guru's
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.
BTW I expected the rows would be around 50. It's now
near 60k. So much for my foresight.
Thanks a ton
David
Filter: MySQL, SELECT, QUERY
---
David E Lopez
email: [EMAIL PROTECTED]
---------------------------------------------------------------------
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