MySQL Forums
Forum List  »  InnoDB

Duplicated VARCHAR primary key ignored
Posted by: Jure Vizjak
Date: September 03, 2013 02:27AM

I have a table with a VARCHAR primary key. Records are inserted into the table with a regular INSERT statement (without the IGNORE keyword) and sometimes two inserts happen concurrently with the same primary key value. Normally I'd expect to get a duplicated key error, but not in my case - the second statement is processed (ignored, discarded) without an error. If I try to do 2 inserts sequentially, then it works as expected (the error occurs).
Here is information about the db/table:

tx_isolation = REPEATABLE-READ

CREATE TABLE IF NOT EXISTS `token` (
`id` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`value` text COLLATE utf8_unicode_ci NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

If you need more information, I'll gladly provide it. Thanks in advance.

Options: ReplyQuote


Subject
Views
Written By
Posted
Duplicated VARCHAR primary key ignored
2176
September 03, 2013 02:27AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.