Re: storage engine: how to identify PRIMARY keys?
Vlad Lesin <[email protected]> Tue, 10 May 2016 19:57:24 +0300
| Newsgroups | gmane.comp.db.mysql.devel |
|---|---|
| Message-ID | <[email protected]> |
If I understand your question correctly you need something like this: table->s->primary_key - pk field number, equals to MAX_KEY if there is no explicit pk. On 10/05/16 12:11, Christoph Rupp wrote: > Hi, > > in the ::create() method of my storage engine I want to create indices > for all columns where (*field)->m_indexed is true. > > As far as I understand there are different types of indices: > - PRIMARY: always unique > - INDEX: usually not unique (can have duplicate keys) > > but I have not been able to figure out whether a FIELD object is a > primary key or not. > > I saw that the Schema description (TABLE->s) has more information > about the columns, but it seems they're already sorted by priority > (i.e. primary key is first), whereas the FIELD objects are not sorted. > > Thanks > Christoph > -- Best regards, Vlad -- MySQL Internals Mailing List For list archives: http://lists.mysql.com/internals To unsubscribe: http://lists.mysql.com/internals