Bug #9985 PRIMARY KEY accepts USING but not TYPE for index type
Submitted: 18 Apr 2005 23:20 Modified: 23 Aug 2005 14:05
Reporter: Dean Ellis Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S2 (Serious)
Version:4.1.12 OS:
Assigned to: Antony Curtis CPU Architecture:Any

[18 Apr 2005 23:20] Dean Ellis
Description:
The PRIMARY KEY clause accepts USING, but does not acecpt TYPE, to specify index type for the key.

SHOW CREATE TABLE (and thus mysqldump) then report a CREATE TABLE statement with "TYPE", instead of "USING", making the statement invalid.

How to repeat:
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 ( a int, PRIMARY KEY USING BTREE (a) ) ENGINE=MyISAM;
SHOW CREATE TABLE t1;
DROP TABLE t1;
CREATE TABLE t1 ( a int, PRIMARY KEY TYPE BTREE (a) ) ENGINE=MyISAM;

Suggested fix:
n/a
[23 Aug 2005 14:05] Andrey Hristov
Cannot reproduce any more. SHOW CREATE TABLE returns now USING instead of TYPE.mysql> DROP TABLE IF EXISTS t1;
Query OK, 0 rows affected, 1 warning (0.00 sec)

mysql> CREATE TABLE t1 ( a int, PRIMARY KEY USING BTREE (a) ) ENGINE=MyISAM;
Query OK, 0 rows affected (0.06 sec)

mysql> SHOW CREATE TABLE t1;
+-------+---------------------------------------------------------------------------------------------------------------------------------+
| Table | Create Table                                                                                                                    |
+-------+---------------------------------------------------------------------------------------------------------------------------------+
| t1    | CREATE TABLE `t1` (
  `a` int(11) NOT NULL default '0',
  PRIMARY KEY  USING BTREE (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 |
+-------+---------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)