Consider the following table:
create table t (
n1 int, n2 int, index (n1, n2),
u1 int, u2 int, unique index (u1, u2));
According to the SHOW COLUMNS documentation I was expecting Key = UNI
for u1
because of
If Key is UNI, the column is the first column of a UNIQUE index. (A UNIQUE index permits multiple NULL values, but you can tell whether the column permits NULL by checking the Null field.)
What am I missing?
.
Output of desc t;
(without the columns Default
and Extra
)
Field Type Null Key Default Extra n1 int(11) YES MUL n2 int(11) YES u1 int(11) YES MUL u2 int(11) YES
.
Output of show index from t;
(without some irrelevant columns)
Table Non_unique Key_name Seq_in_index Column_name Cardinality t 0 u1 1 u1 0 t 0 u1 2 u2 0 t 1 n1 1 n1 0 t 1 n1 2 n2 0