[TYPO3-core] RFC #12858: Feature: Provide a DB API to insert multiple rows at once

Christian Kuhn lolli at schwarzbu.ch
Sun Jan 10 21:52:47 CET 2010


Hey,

Ries van Twisk wrote:
> What would be the behavior of the multiple insert if one row invalidates
> a particular constrain
> like a unique constrain for example?
> 
> Should:
> 1) The whole insert fail (all rows)
> 2) Should only the single row fail?
> 
> I don't know what MySQL's behavior is in that,
> it sounds logical to me that that all rows should fail.

Tested with duplicate key for a UNIQUE key field:

- If engine = InnoDB, the whole query will be rolled back, no row inserted.
- If engine = MyISAM, all rows until the error occurs are inserted, no
row after the error.

This is inconsistent in mysql itself.

Regards
Christian


More information about the TYPO3-team-core mailing list