Bug #3549 Fast INSERT causes errors
Submitted: 23 Apr 2004 7:07 Modified: 25 May 2004 23:40
Reporter: [ name withheld ] Email Updates:
Status: No Feedback Impact on me:
None 
Category:MySQL Server: MyISAM storage engine Severity:S2 (Serious)
Version:Ver 14.3 Distrib 4.1.1-alpha OS:Linux (Slackware 9.1)
Assigned to: CPU Architecture:Any

[23 Apr 2004 7:07] [ name withheld ]
Description:
When executing lots (1000) of single INSERT statements from a single client in a short timespan (<=1 second), I get "Duplicate entry 'A' for key 3" and "Duplicate entry 'A' for key 7" errors while there is no duplication. When I slow things down by issuing a delay between inserts, there's no problem with the same data. The strange thing is that this error occurs most of the time (not always), and when it occurs, it always happens on records 301, 604, 810 and 908 (I didn't go further).

Using mysql  Ver 14.3 Distrib 4.1.1-alpha, for slackware-linux (i486)

How to repeat:
CREATE TABLE QUESTIONS (
  QUESTION_ID int(10) unsigned NOT NULL auto_increment,
  SET_ID int(10) unsigned NOT NULL default '0',
  QUESTION text NOT NULL,
  QUESTION_TYPE int(1) unsigned NOT NULL default '0',
  TIME_STAMP datetime NOT NULL default '0000-00-00 00:00:00',
  ANSWER text,
  HINT text,
  COST_HINT decimal(3,2) default NULL,
  TOPIC_KEYWORDS text,
  TEXT_SEARCH_KEYWORDS text,
  PRIMARY KEY  (QUESTION_ID),
  KEY QUESTIONS_SET_ID_I (SET_ID),
  FULLTEXT KEY ANSWER (ANSWER),
  FULLTEXT KEY QUESTION (QUESTION),
  FULLTEXT KEY TOPIC_KEYWORDS (TOPIC_KEYWORDS),
  FULLTEXT KEY TEXT_SEARCH_KEYWORDS (TEXT_SEARCH_KEYWORDS),
  FULLTEXT KEY QUESTION_2 (QUESTION,ANSWER)
) TYPE=MyISAM DEFAULT CHARSET=latin1;

INSERT INTO `QUESTIONS` (set_id,question,question_type,time_stamp,answer,hint,cost_hint) VALUES ( 0 , 'Question  0 ', 2 , NOW() , 'Answer to question  0 ', 'Hint to question  0 ', 0.5 ) ;

INSERT INTO `QUESTIONS` (set_id,question,question_type,time_stamp,answer,hint,cost_hint) VALUES ( 1 , 'Question  1 ', 2 , NOW() , 'Answer to question  1 ', 'Hint to question  1 ', 0.5 ) ;

INSERT INTO `QUESTIONS` (set_id,question,question_type,time_stamp,answer,hint,cost_hint) VALUES ( 2 , 'Question  2 ', 2 , NOW() , 'Answer to question  2 ', 'Hint to question  2 ', 0.5 ) ;

INSERT INTO `QUESTIONS` (set_id,question,question_type,time_stamp,answer,hint,cost_hint) VALUES ( 3 , 'Question  3 ', 2 , NOW() , 'Answer to question  3 ', 'Hint to question  3 ', 0.5 ) ;

...

And so on.
Fields that change with the counter: set_id, question, answer, hint.

Suggested fix:
Debug query serializer.
[25 Apr 2004 23:40] Sergei Golubchik
there were several bugs about "Duplicate error" on fulltext key.
Most probably they are all fixed in 4.1.2 - at least I failed to repeat this error.

Please try 4.1.2 when it will be out (soon!).
[14 Feb 2005 22:54] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".