Bug #18133 Adding index to unsigned int causes on-line add index not to be used
Submitted: 10 Mar 2006 13:06 Modified: 23 Apr 2006 1:00
Reporter: Martin Skold Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Cluster: Cluster (NDB) storage engine Severity:S3 (Non-critical)
Version:5.1.8 OS:
Assigned to: Martin Skold CPU Architecture:Any

[10 Mar 2006 13:06] Martin Skold
Description:
Adding an index to a table on a field of type unsigned int causes add index
to be done as an copying alter table. If the index is on an int field the
add index will be on-line (no table copying).

How to repeat:
CREATE TABLE t1 (
  a int NOT NULL PRIMARY KEY,
  b int not null,
  c int)
engine = ndbcluster;
insert t1 values(1, 2, 3), (2, 2, 4);
--error 1169
create unique index ib on t1(b);

CREATE TABLE t1 (
  a int NOT NULL PRIMARY KEY,
  b int unsigned not null,
  c int)
engine = ndbcluster;
insert t1 values(1, 2, 3), (2, 2, 4);
--error 1022
create unique index ib on t1(b);
Notice the different error code here!!
Thus is because of failure in the copying
phase in the old style alter-table

Suggested fix:
Fix compare_tables to handle unsigned attributes
as no change of table definition.
[21 Apr 2006 6:47] Martin Skold
Pushed to 5.1.10
[23 Apr 2006 1:00] Jon Stephens
Thank you for your bug report. This issue has been committed to our
source repository of that product and will be incorporated into the
next release.

If necessary, you can access the source repository and build the latest
available version, including the bugfix, yourself. More information 
about accessing the source trees is available at
    http://www.mysql.com/doc/en/Installing_source_tree.html

Additional info:

Documented in 5.1.10 changelog. Closed.