Bug #12581 Selecting informations about *one* key
Submitted: 15 Aug 2005 12:26 Modified: 30 Jun 2009 17:09
Reporter: Pavel Ptáček Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S4 (Feature request)
Version:4.1.12a OS:Windows (Windows XP)
Assigned to: CPU Architecture:Any

[15 Aug 2005 12:26] Pavel Ptáček
Description:
I have encountered problem.. When i need to check *if* the index key *is* non_unique or to do some other checks with keys, there is *only one* MySQL statement what allows this:

SHOW INDEX FROM table

But when i want to check *known* key, theres *no* way how to do that through MySQL queries...

I have tried this:

SELECT something FROM (SHOW INDEX FROM uzivatele) AS q

but i won't work :P

Note: If i will find out, i will post here, but i think i won't :P

How to repeat:
Please repeat through email to:
pavelptacek (AT) centrum (DOT) cz
[30 Jun 2009 17:09] Valeriy Kravchuk
In MySQL 5.x this can be done with a query to INFORMATION_SCHEMA.STATISTICS table. Read http://dev.mysql.com/doc/refman/5.0/en/statistics-table.html about the details.