MySQL Forums
Forum List  »  Federated Storage Engine

index not defined as NOT NULL
Posted by: off mct
Date: September 21, 2005 03:21AM

I created a table in host apple:
CREATE TABLE `NullIndex` (
`id` int(10) unsigned NOT NULL auto_increment,
`a` int(11) default NULL,
`b` varchar(100) NOT NULL default '',
PRIMARY KEY (`id`),
KEY `a` (`a`)
) ENGINE=MyISAM;

Then, I created a federated table in another machine:
CREATE TABLE `NullIndex` (
`id` int(10) unsigned NOT NULL auto_increment,
`a` int(11) default NULL,
`b` varchar(100) NOT NULL default '',
PRIMARY KEY (`id`),
KEY `a` (`a`)
) ENGINE=FEDERATED
COMMENT='mysql://devel:devel@apple/test/NullIndex';

This produced an error:
ERROR 1121: Column 'a' is used with UNIQUE or INDEX but is not defined as NOT NULL

I'm not sure why this happened but I was able to solve the problem by removing "KEY `a` (`a`)" in the federated table DDL such that:
CREATE TABLE `NullIndex` (
`id` int(10) unsigned NOT NULL auto_increment,
`a` int(11) default NULL,
`b` varchar(100) NOT NULL default '',
PRIMARY KEY (`id`)
) ENGINE=FEDERATED
COMMENT='mysql://devel:devel@apple/test/NullIndex';

I don't exactly know what are the drawbacks of this workaround but maybe somebody has the proper solution for this.

Thanks a lot.

Options: ReplyQuote


Subject
Views
Written By
Posted
index not defined as NOT NULL
7013
September 21, 2005 03:21AM
3685
October 26, 2006 05:23PM
3432
October 26, 2006 05:46PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.