1.8.3.1 PRIMARY KEY and UNIQUE Index Constraints

Normally, errors occurs for data-change statements (such as
INSERT or
UPDATE) that would violate
primary-key, unique-key, or foreign-key constraints. If you
are using a transactional storage engine such as
InnoDB, MySQL automatically rolls back the
statement. If you are using a nontransactional storage engine,
MySQL stops processing the statement at the row for which the
error occurred and leaves any remaining rows unprocessed.