Bug #19196 Attempt to create index on usupported field type gives wrong error code
Submitted: 19 Apr 2006 13:08 Modified: 23 Apr 2006 1:50
Reporter: Martin Skold Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Cluster: Cluster (NDB) storage engine Severity:S3 (Non-critical)
Version: OS:
Assigned to: Martin Skold CPU Architecture:Any

[19 Apr 2006 13:08] Martin Skold
Description:
If trying to create an index on a bit field or a BLOB field, the error:
743: "Unsupported character set in table or index"
correct error code should be:
906 "Unsupported attribute type in index"

How to repeat:
-- source include/have_ndb.inc
-- source include/not_embedded.inc
                                                                                
--disable_warnings
DROP TABLE IF EXISTS t1;
--enable_warnings
                                                                                
CREATE TABLE t1 (
  auto int(5) unsigned NOT NULL auto_increment,
  string char(10),
  vstring varchar(10),
  bin binary(2),
  vbin varbinary(7),
  tiny tinyint(4) DEFAULT '0' NOT NULL ,
  short smallint(6) DEFAULT '1' NOT NULL ,
  medium mediumint(8) DEFAULT '0' NOT NULL,
  long_int int(11) DEFAULT '0' NOT NULL,
  longlong bigint(13) DEFAULT '0' NOT NULL,
  real_float float(13,1) DEFAULT 0.0 NOT NULL,
  real_double double(16,4),
  real_decimal decimal(16,4),
  utiny tinyint(3) unsigned DEFAULT '0' NOT NULL,
  ushort smallint(5) unsigned zerofill DEFAULT '00000' NOT NULL,
  umedium mediumint(8) unsigned DEFAULT '0' NOT NULL,
  ulong int(11) unsigned DEFAULT '0' NOT NULL,
  ulonglong bigint(13) unsigned DEFAULT '0' NOT NULL,
  bits bit(3),
  options enum('zero','one','two','three','four') not null,
  flags set('zero','one','two','three','four') not null,
  date_field date,
  year_field year,
  time_field time,
  date_time datetime,
  time_stamp timestamp,
  PRIMARY KEY (auto)
) engine=ndb;
                                                                                
create index i1 on t1(bits);
                                                                                
DROP TABLE t1;

Suggested fix:
Change returned error.
[19 Apr 2006 13:17] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/5141
[20 Apr 2006 9:11] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/5194
[20 Apr 2006 10:09] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/5197
[20 Apr 2006 11:35] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/5200
[21 Apr 2006 6:49] Martin Skold
Pushed to 5.0.21 and 5.1.10
[23 Apr 2006 1:50] 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 bugfix in 5.0.21 and 5.1.10 changelogs; closed.