Project

General

Profile

Actions

Bug #67204

closed

Calling DatabaseConnection::exec_SELECTgetRows() with an invalid $uidIndexField returns only a single row

Added by Markus Klein almost 9 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Should have
Assignee:
Category:
Database API (Doctrine DBAL)
Target version:
Start date:
2015-05-29
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
6.2
PHP Version:
Tags:
Complexity:
easy
Is Regression:
No
Sprint Focus:

Description

If one accidentally calls DatabaseConnection::exec_SELECTgetRows() with an invalid $uidIndexField, the method only returns a single record.

The reason is that the existence of the specified field is not verified. If the field is not set, the code

$output[$tempRow[$uidIndexField]] = $tempRow;

results in
$output[0] = $tempRow;

which simply overrides the first entry of the array. This happens for every record, hence finally only the last record of the query result is returned.

The method should check the $uidIndexField really exists and should throw an exception otherwise, in order to inform the developer of the mistake.

Actions

Also available in: Atom PDF