Issue Bug Closed

#65789Extbase: Wrong SQL statement when using Offset and no Limit

Eric no-lastname-given 03/17/15, 15:05 updated 10/02/18, 11:45

Description

When building a query with OFFSET but no LIMIT, this line in

TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbBackend

protected function createQueryCommandParametersFromStatementParts(array $statementParts):

321:  'limit' => ($statementParts['offset'] ? $statementParts['offset'] . ', ' : '')
322:     . ($statementParts['limit'] ? $statementParts['limit'] : '')

produces an SQL Error, because the SQL ends with a comma: …DESC LIMIT 3,

It should only add a comma, when there is a OFFSET and a LIMIT

Reviews 3