Bug #10094 Displays wrong error message for UNIQUE key index on CHAR(255) Unicode datatype
Submitted: 22 Apr 2005 12:26 Modified: 2 May 2005 5:39
Reporter: Disha Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server Severity:S1 (Critical)
Version:5.0.4 Beta-standard OS:Windows (Windows Server 2003)
Assigned to: Assigned Account CPU Architecture:Any

[22 Apr 2005 12:26] Disha
Description:
Create a table 't4' using CHAR(255) Unicode datatype. Insert the values in table 't4' with atleast two same values . If tried to make UNIQUE key index on that column it does not display appropriate error message.

How to repeat:
1. Set the delimiter.
     Delimiter //

2.  Use database 'test' i.e. execute the following SQL statement:
         use test//

3. Create a table 't4' ie execute the following SQL statement:
          create table t4 (f235 char(255) unicode)//

4. Insert values in table 't4' ie execute the following SQL statement:
           insert into t4 values ('abc'),('bcd'),('abc')//

5. Set unique index ie execute the following SQL statement:
           ALTER TABLE t4 ADD UNIQUE Index_1 (f235)//

6. Observe that the execution displays the following error message
    ERROR 1062 (23000): Duplicate entry '' for key 1
			
				
 Expected Results: Step 5 execution should display the proper error message as:
 ERROR 1062 (23000): Duplicate entry 'abc' for key 1.

 Actual Results  : Step 5 execution displays the error message as:
 ERROR 1062 (23000): Duplicate entry '' for key 1
[2 May 2005 5:39] Alexander Barkov
Duplicate with:

http://bugs.mysql.com/bug.php?id=1406