Try show index from t1;
Show index from t2;

-----Original Message-----
From: Jacek Becla [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, May 03, 2005 4:00 PM
To: Jay Blanchard
Cc: mysql@lists.mysql.com
Subject: Re: how to check if keys disabled?

Jay

Are you sure? DESCRIBE tells me the table has an index, but not whether 
the index is enabled or not:

mysql> create table t1 (x int primary key);
Query OK, 0 rows affected (0.01 sec)

mysql> create table t2 (x int primary key);
Query OK, 0 rows affected (0.01 sec)

mysql> alter table t1 disable keys;
Query OK, 0 rows affected (0.00 sec)

mysql> describe t1;
+-------+---------+------+-----+---------+-------+
| Field | Type    | Null | Key | Default | Extra |
+-------+---------+------+-----+---------+-------+
| x     | int(11) | NO   | PRI |         |       |
+-------+---------+------+-----+---------+-------+
1 row in set (0.00 sec)

mysql> describe t2;
+-------+---------+------+-----+---------+-------+
| Field | Type    | Null | Key | Default | Extra |
+-------+---------+------+-----+---------+-------+
| x     | int(11) | NO   | PRI |         |       |
+-------+---------+------+-----+---------+-------+
1 row in set (0.00 sec)

Am I missing something?

thanks,
Jacek


Jay Blanchard wrote:
> [snip]
> How can I find out if keys are enabled/disabled for a given table?
> 
> Suppose I do:
> create table t1 (x int primary key);
> create table t2 (x int primary key);
> alter table t1 disable keys;
> 
> How can I now find out that t1 has keys disabled, and t2 enabled?
> [/snip]
> 
> DESCRIBE t1 or DESCRIBE t2


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to