[BUGFIX] Statement::rowCount not reliable for SELECT queries 83/50083/10
authorSusanne Moog <susanne.moog@typo3.org>
Thu, 31 May 2018 13:43:36 +0000 (15:43 +0200)
committerBenni Mack <benni@typo3.org>
Thu, 31 May 2018 17:27:38 +0000 (19:27 +0200)
commit0367dbda85deb5009671ea8bf0484458a920a7a2
tree9cf5096563d44f9837822f8fd3cf94b197c0dcda
parentfd9e620a0b4f7ee748c2dee35592c8829a192f03
[BUGFIX] Statement::rowCount not reliable for SELECT queries

Concerning the usage of Statement::rowCount() the Doctrine DBAL
documentation states the following:

  Returns the number of rows affected by the last
  DELETE, INSERT, or UPDATE statement
  executed by the corresponding object.

For default configurations using MySQL as platform,
rowCount() is returning the expected
value for SELECT statements as well.
However, on other DBMS this value will be zero
as mentioned in the documentation - for instance
SQLite is a candidate for that.

For retrieving the row count for given criteria, the count()
expression has to be used explicitly.

Resolves: #78129
Releases: master
Change-Id: Id28d72a1a21e8615ec45b63d4aecc100d03a39a3
Reviewed-on: https://review.typo3.org/50083
Reviewed-by: Oliver Hader <oliver.hader@typo3.org>
Tested-by: Oliver Hader <oliver.hader@typo3.org>
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Benni Mack <benni@typo3.org>
Tested-by: Benni Mack <benni@typo3.org>
14 files changed:
typo3/sysext/backend/Classes/Form/Wizard/SuggestWizardDefaultReceiver.php
typo3/sysext/backend/Classes/History/RecordHistory.php
typo3/sysext/backend/Classes/View/PageLayoutView.php
typo3/sysext/core/Classes/Authentication/BackendUserAuthentication.php
typo3/sysext/core/Classes/Configuration/FlexForm/FlexFormTools.php
typo3/sysext/core/Tests/Functional/DataHandling/AbstractDataHandlerActionTestCase.php
typo3/sysext/core/Tests/Unit/Configuration/FlexForm/FlexFormToolsTest.php
typo3/sysext/indexed_search/Classes/Domain/Repository/AdministrationRepository.php
typo3/sysext/indexed_search/Classes/Hook/CrawlerHook.php
typo3/sysext/info/Classes/Controller/TranslationStatusController.php
typo3/sysext/lowlevel/Classes/Command/DeletedRecordsCommand.php
typo3/sysext/lowlevel/Classes/Command/LostFilesCommand.php
typo3/sysext/lowlevel/Classes/Command/OrphanRecordsCommand.php
typo3/sysext/recordlist/Classes/RecordList/DatabaseRecordList.php