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

Xavier Perseguers typo3 at perseguers.ch
Mon Jan 11 19:00:00 CET 2010


Hi,

Please find enclosed v3 for DBAL. Please note that DBAL patches should be made separately as there is a dedicated repository for it and the version in Core is not always the most up-to-date, meaning 
it may not apply cleanly with the rest of the Core patch.

I'm still not 100% happy with how error are handled. At the moment, a failure in an INSERT may fail but the next rows will (or might at least) be inserted anyway. This is neither the MyISAM behavior, 
nor the InnoDB one.

Personally, I would prefer the InnoDB behavior, meaning a transaction should be started as in exec_INSERTquery when it comes to a combination of plain columns and blob ones:

$this->handlerInstance[$this->lastHandlerKey]->StartTrans();
...
$this->handlerInstance[$this->lastHandlerKey]->CompleteTrans();

or

$this->handlerInstance[$this->lastHandlerKey]->CompleteTrans(FALSE);

in case of failure.

What is others' opinion?

In addition, adding support for inserting multiple rows should be reflected to the SQL parser, this would allow the Install Tool to be used (hopefully) with DBAL when it comes to importing an existing 
MySQL database dump. But I may implement this. I added it in the bug tracker: http://bugs.typo3.org/view.php?id=13209

-- 
Xavier Perseguers
http://xavier.perseguers.ch/en
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 12858_dbal_v3.diff
URL: <http://lists.typo3.org/pipermail/typo3-team-core/attachments/20100111/69681193/attachment.asc>


More information about the TYPO3-team-core mailing list