summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
db9efd3)
For native handler types multiple rows can be inserted using the mysql
INSERTmultipleRows API call. When another handler was used, the operation
was done twice, due to a missing else after the native handler condition.
This resulted in two database records for every INSERT statement.
The patch adds the missing else branch for the condition, preventing
the second run that was only meant to handle non-native handler types.
Change-Id: Ibab98a0c73b379bac063c8d1c19e30e93f38faf4
Resolves: #48220
Releases: 6.2, 6.1, 6.0, 4.7, 4.5
Related: #34327
Reviewed-on: https://review.typo3.org/21085
Tested-by: Alexander Opitz
Reviewed-by: Alexander Opitz
Reviewed-by: Xavier Perseguers
Tested-by: Xavier Perseguers
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring
Reviewed-by: Stefan Neufeind
Tested-by: Stefan Neufeind
if ($this->lastHandlerKey === '_DEFAULT' && !$this->isConnected()) {
$this->connectDB();
}
if ($this->lastHandlerKey === '_DEFAULT' && !$this->isConnected()) {
$this->connectDB();
}
parent::INSERTmultipleRows($table, $fields, $rows, $no_quote_fields),
$this->handlerInstance[$this->lastHandlerKey]['link']
);
parent::INSERTmultipleRows($table, $fields, $rows, $no_quote_fields),
$this->handlerInstance[$this->lastHandlerKey]['link']
);
- }
- foreach ($rows as $row) {
- $fields_values = array();
- foreach ($fields as $key => $value) {
- $fields_values[$value] = $row[$key];
+ } else {
+ foreach ($rows as $row) {
+ $fields_values = array();
+ foreach ($fields as $key => $value) {
+ $fields_values[$value] = $row[$key];
+ }
+ $res = $this->exec_INSERTquery($table, $fields_values, $no_quote_fields);
- $res = $this->exec_INSERTquery($table, $fields_values, $no_quote_fields);
}
foreach ($this->postProcessHookObjects as $hookObject) {
$hookObject->exec_INSERTmultipleRows_postProcessAction($table, $fields, $rows, $no_quote_fields, $this);
}
foreach ($this->postProcessHookObjects as $hookObject) {
$hookObject->exec_INSERTmultipleRows_postProcessAction($table, $fields, $rows, $no_quote_fields, $this);