Justin Swanhart ([info]swanhart) wrote,
@ 2008-08-26 19:29:00
Previous Entry  Add to memories!  Tell a Friend!  Next Entry
MySQL bug #31031
I came across this behavior today while writing some additional comprehensive ALTER TABLE tests for use in the test suite that we run against the Kickfire database appliance to ensure quality.

mysql> CREATE TABLE `t1` (
-> `col1` tinyint(4) DEFAULT NULL,
-> `id` int(11) NOT NULL DEFAULT '0' COMMENT 'min=1,max=65535',
-> PRIMARY KEY (`id`)
-> ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
Query OK, 0 rows affected (0.00 sec)

mysql> alter table t1 drop column id,
-> add column id int auto_increment primary key;
ERROR 1089 (HY000): Incorrect prefix key; the used key part isn't a string, the used length is longer than the key part, or the storage engine doesn't support unique prefix keys

This is a regression in 5.0 (and 5.1, I didn't try 6) that was reported almost one year ago. This alter table works just fine in 4.1 and there isn't any reason it should complain about 'prefix index length' when there are no prefix indexes involved.

Ask MySQL to fix this regression in 5.0 before 5.1 GA.

http://bugs.mysql.com/bug.php?id=31031



(Post a new comment)


(Anonymous)
2008-08-27 10:38 am UTC (link)
Hi Justin,

You mention in the bug that you are a customer - could you open up a support issue about this please? We can link them internally to help to raise their priority (as well as help push them internally with the development team)..

Many thanks

Mark Leith (one of the Support managers)

(Reply to this) (Thread)


[info]swanhart
2008-08-27 05:29 pm UTC (link)
Will do.

(Reply to this) (Parent)

min=1.max=65535
(Anonymous)
2008-08-30 08:59 pm UTC (link)
FYI your comment doesn't represent the datatype you have selected.

A. you should be using UNSIGNED
B. SMALLINT UNSIGNED will support what your comment is?

But then, it's only a comment?

Regards

Ronald
http://ronaldbradford.com

(Reply to this) (Thread)

Re: min=1 max=65535
[info]swanhart
2008-09-01 08:43 pm UTC (link)
You are right - the values in the table now do not necessitate an int, but that doesn't mean that I won't try to insert a larger value later.

The comments in this example are used for KFDB metadata. We feature a vertically oriented column store and based on the comment will pick an appropriately sized initial storage format on disk for the specified value range.

(Reply to this) (Parent)

Doesn't seem like a bug
[info]shantanuo
2008-09-23 01:34 pm UTC (link)
alter table t1 drop column id, drop primary key, add column id int auto_increment primary key;

(Reply to this)


Create an Account
Forgot your login or password?
Login w/ OpenID
English • Español • Deutsch • Русский…