Bug #3741 NULL-able columns can not be indexed
Submitted: 13 May 2004 10:30 Modified: 13 May 2004 12:17
Reporter: Anders Karlsson Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Cluster: Cluster (NDB) storage engine Severity:S4 (Feature request)
Version:mysql-4.1 bk OS:
Assigned to: Magnus Blåudd CPU Architecture:Any

[13 May 2004 10:30] Anders Karlsson
Description:
A non-NOT NULL column cannot be indexed in an NDB table.

How to repeat:
create table t2(c1 int, key(c1)) type=NDB;
This will fail.
[13 May 2004 10:47] Magnus Blåudd
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.mysql.com/documentation/ and the instructions on
how to report a bug at http://bugs.mysql.com/how-to-report.php
[13 May 2004 11:05] Magnus Blåudd
Hi Anders,

I assume you get the error "Column 'colname' is used with UNIQUE or INDEX but is not defined as NOT NULL" when trying to create an index on a column which is NULL. This is correct behaviour, right now.

We are working on adding support for creating an index on a column which is NULL. 

The error is returned from sql_table.cc at line 899, if a table handler has not set the table_flag HA_NULL_KEY to indicate that the storage engine supports this "feature". We will add this flag to ha_ndbcluster.cc when a fix has been made to the unique indexes in NDB to support NULL in indexes, the ordered indexes of NDB already supports this.

It will be included in MySQL 4.1.

Best regards
Magnus Svensson

-- 
Magnus Svensson, Software Engineer
MySQL AB, www.mysql.com
Office: +46 709 164 491
[13 May 2004 11:14] Anders Karlsson
The documentation doesn't seem to cover the NDB table type at this point, and the
features of it. If this is not a bug, it should be documented.