Bug #3750 In CREATE statement, INDEX name check bug
Submitted: 13 May 2004 21:50 Modified: 14 May 2004 11:45
Reporter: Hyun-Woong Kim Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:4.1.2 OS:
Assigned to: CPU Architecture:Any

[13 May 2004 21:50] Hyun-Woong Kim
Description:
When I run example sql,
I got error like this "ERROR 1280 (42000): Incorrect index name 'stoc  '".

But if I insert table name before indexed column name, there is no error.

How to repeat:
CREATE TABLE stockholder (
stockholder_id		int(9) AUTO_INCREMENT,
company_code		int(4) NOT NULL,	
name			varchar(20) BINARY,
relationship		varchar(20) BINARY,
rrn			char(13),		

PRIMARY KEY (stockholder_id)
) TYPE=INNODB;

CREATE TABLE stockholder_stock (
stockholder_stock_id	int(9) AUTO_INCREMENT,	
stockholder_id		int(9) NOT NULL,
renewal_date		int(8) NOT NULL,
stock_count		int(9) NOT NULL,

PRIMARY KEY (stockholder_stock_id),
INDEX (stockholder_id),
FOREIGN KEY (stockholder_id) REFERENCES stockholder(stockholder_id) ON DELETE CASCADE,
UNIQUE ( stockholder_id, renewal_date )
) TYPE=INNODB;

Suggested fix:
Insert table name before indexed column name like this : 

INDEX stockholder_stock(stockholder_id)
[13 May 2004 22:29] Dean Ellis
Verified, thank you for the report.  It is possibly caused by the same bug reported in 3749.
[14 May 2004 11:45] Sergei Golubchik
duplicate of bug#3749
(it dissapears after fixing bug#3749)