[TYPO3-mvc] QueryResult object has issues with offsets and "count" method ?
Franz Koch
typo3.RemoveForMessage at elements-net.de
Fri Nov 19 11:48:47 CET 2010
Hey Bastian,
>>> If the Result has not been touched yet, count will actually execute a
>>> COUNT(*) Query. That's nice, because you can count all objects before
>>> retrieving only a subset from the Database.
>>> The problem is: Count queries ignore the LIMIT constraint.
>>
>> That should at least lead to a result - but I don't get any with the
>> count query.
>
> Can you please debug $statement at the end of
> Tx_Extbase_Persistence_Storage_Typo3DbBackend::getObjectCountByQuery()?
hehe, I already did in the meantime. The query itself looks ok, except
for the fact that the LIMIT statement is not filtered out, and this
somehow leads to a FALSE return value in the Typo3DBBackend instead of
returning the count of the limited subset. The query looks like:
SELECT DISTINCT COUNT(*) FROM xyz LEFT JOIN ... WHERE ... ORDER BY
xyz.title ASC LIMIT 100, 50
--
kind regards,
Franz Koch
More information about the TYPO3-project-typo3v4mvc
mailing list