Hi

here's my mysql version:

Code:
mysql> show variables like '%version%';
+-------------------------+------------------------------+
| Variable_name           | Value                        |
+-------------------------+------------------------------+
| innodb_version          | 1.1.8                        |
| protocol_version        | 10                           |
| slave_type_conversions  |                              |
| version                 | 5.5.27                       |
| version_comment         | MySQL Community Server (GPL) |
| version_compile_machine | x86                          |
| version_compile_os      | Win32                        |
+-------------------------+------------------------------+
7 rows in set (0.00 sec)
here's my create table display:

Code:
create table if not exists test1(
test1_id int,
test1_string varchar(10),
constraint pk_test1 primary key (test1_id) using hash comment 'primary key index for test1'
);

create table if not exists test1_child(
test1_child_id int,
test1_id int not null,
test1_child_string varchar(10),
constraint fk_test1_child_test_id foreign key fk_test1_child_test_id (test1_id) references test1 (test1_id)
);
later, I decided to have different index name and foreign key constraint_name on test1_child, so I did the following:

from http://dev.mysql.com/doc/refman/5.5/en/create-table.html

CREATE [TEMPORARY] TABLE [IF NOT EXISTS] tbl_name
{ LIKE old_tbl_name | (LIKE old_tbl_name) }

create_definition:
col_name column_definition
| [CONSTRAINT [symbol]] PRIMARY KEY [index_type] (index_col_name,...)
[index_option] ...
| {INDEX|KEY} [index_name] [index_type] (index_col_name,...)
[index_option] ...
| [CONSTRAINT [symbol]] UNIQUE [INDEX|KEY]
[index_name] [index_type] (index_col_name,...)
[index_option] ...
| {FULLTEXT|SPATIAL} [INDEX|KEY] [index_name] (index_col_name,...)
[index_option] ...
| [CONSTRAINT [symbol]] FOREIGN KEY
[index_name] (index_col_name,...) reference_definition
| CHECK (expr)

Code:
alter able test1_child drop foreign key fk_test1_child_test_id;

alter table test1_child drop index fk_test1_child_test_id;


alter table test1_child add constraint fk_test1_child_test_id foreign key fk_test1_child_test_id_index (test1_id) references test1(test1_id);
however results show something I don't expect.

Code:
mysql> show index from test1_child;
+-------------+------------+------------------------+--------------+------------
-+-----------+-------------+----------+--------+------+------------+---------+--
-------------+
| Table       | Non_unique | Key_name               | Seq_in_index | Column_name
 | Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comment | I
ndex_comment |
+-------------+------------+------------------------+--------------+------------
-+-----------+-------------+----------+--------+------+------------+---------+--
-------------+
| test1_child |          1 | fk_test1_child_test_id |            1 | test1_id
 | A         |           0 |     NULL | NULL   |      | BTREE      |         |
             |
+-------------+------------+------------------------+--------------+------------
-+-----------+-------------+----------+--------+------+------------+---------+--

from the referential_constraints
Code:
mysql> select CONSTRAINT_SCHEMA, CONSTRAINT_NAME, UNIQUE_CONSTRAINT_SCHEMA, UNIQ
UE_CONSTRAINT_NAME, REFERENCED_TABLE_NAME from INFORMATION_SCHEMA.REFERENTIAL_CO
NSTRAINTS where table_name='test1_child';
+-------------------+------------------------+--------------------------+-------
-----------------+-----------------------+
| CONSTRAINT_SCHEMA | CONSTRAINT_NAME        | UNIQUE_CONSTRAINT_SCHEMA | UNIQUE
_CONSTRAINT_NAME | REFERENCED_TABLE_NAME |
+-------------------+------------------------+--------------------------+-------
-----------------+-----------------------+
| certify           | fk_test1_child_test_id | certify                  | PRIMAR
Y                | test1                 |
+-------------------+------------------------+--------------------------+-------
-----------------+-----------------------+
1 row in set (0.00 sec)
as you will have observe the foreign key constraint name is the same as the index_name, could anyone explain why?

is it possible to have different index name and different foreign key constraint name?

thanks a lot!