MySQL Forums
Forum List  »  NDB clusters

Re: Prefixed indexes
Posted by: Bruno ASTIER
Date: September 14, 2015 06:18AM

HI Jon,

Thanks for reply.


I understood that if SQL statement is valid then it is passed to engine,which will ignore prefixes in case of NDB. Right ?

But I'm still confused, are 'UNIQUE' indexes and 'PRIMARY KEY' subject to the same rule ? I mean, if statement is valid, does NDB engine should ignore prefixes ?

I have no chance with these :
- create table t (c1 int not null, c2 varchar(500), primary key (c2(50)))engine=ndb;
- create table t (c1 int not null, c2 varchar(500), unique index i1 (c2(50))) engine=ndb;
- create unique index i2 on t (c2(50));
- alter table t add unique index i3 (c2(50));

I always get this error back :
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


Are these statements valid ?



Regards, Bruno.

PS : sorry for my bad English, hope you understand me

Options: ReplyQuote


Subject
Views
Written By
Posted
1987
September 11, 2015 04:21AM
885
September 14, 2015 05:38AM
Re: Prefixed indexes
816
September 14, 2015 06:18AM
560
September 14, 2015 11:28AM
502
September 15, 2015 02:34AM


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.