Project

General

Profile

Actions

Bug #78129

closed

Statement::rowCount not reliable for SELECT queries

Added by Oliver Hader about 8 years ago. Updated almost 5 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Database API (Doctrine DBAL)
Target version:
-
Start date:
2016-10-02
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
8
PHP Version:
7.0
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

see https://github.com/doctrine/dbal/blob/master/lib/Doctrine/DBAL/Driver/Statement.php#L127

... taken from the PHPdoc comment:

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

If the last SQL statement executed by the associated Statement object was a SELECT statement,
some databases may return the number of rows returned by that statement. However,
this behaviour is not guaranteed for all databases and should not be
relied on for portable applications.

In particular rowCount() on valid SELECT statements for SQLite as DBMS returns 0 when fetch() would retrieve existing records. Thus, using rowCount() should be avoided and replaced by proper COUNT statements instead - if required at all.


Related issues 4 (0 open4 closed)

Related to TYPO3 Core - Bug #85228: Invalid count query in SuggestWizardDefaultReceiverClosedAlexander Stehlik2018-06-11

Actions
Related to TYPO3 Core - Bug #85359: BE-Pagebrowser brokenClosed2018-06-23

Actions
Related to TYPO3 Core - Bug #90231: Linkvalidator makes use of rowCount() and does not work with sqliteClosedDaniel Siepmann2020-01-28

Actions
Precedes TYPO3 Core - Bug #85743: An exception occurred if I click on ListClosed2016-10-032016-10-03

Actions
Actions #1

Updated by Gerrit Code Review about 8 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/50083

Actions #2

Updated by Gerrit Code Review about 8 years ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/50083

Actions #3

Updated by Benni Mack about 8 years ago

  • Sprint Focus set to Stabilization Sprint
Actions #4

Updated by Benni Mack about 8 years ago

  • Target version set to 8.4
Actions #5

Updated by Gerrit Code Review about 8 years ago

Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/50083

Actions #6

Updated by Gerrit Code Review about 8 years ago

Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/50083

Actions #7

Updated by Benni Mack about 8 years ago

  • Target version changed from 8.4 to 8.5
Actions #8

Updated by Morton Jonuschat almost 8 years ago

  • Category changed from 999 to Database API (Doctrine DBAL)
Actions #9

Updated by Benni Mack almost 8 years ago

  • Target version changed from 8.5 to 8.6
Actions #10

Updated by Benni Mack almost 8 years ago

  • Target version changed from 8.6 to 8 LTS
Actions #11

Updated by Christian Kuhn over 7 years ago

  • Target version deleted (8 LTS)
  • Sprint Focus deleted (Stabilization Sprint)
Actions #12

Updated by Gerrit Code Review over 6 years ago

Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/50083

Actions #13

Updated by Gerrit Code Review over 6 years ago

Patch set 6 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/50083

Actions #14

Updated by Gerrit Code Review over 6 years ago

Patch set 7 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/50083

Actions #15

Updated by Gerrit Code Review over 6 years ago

Patch set 8 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/50083

Actions #16

Updated by Gerrit Code Review over 6 years ago

Patch set 9 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/50083

Actions #17

Updated by Susanne Moog over 6 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #18

Updated by Alexander Stehlik over 6 years ago

  • Related to Bug #85228: Invalid count query in SuggestWizardDefaultReceiver added
Actions #19

Updated by Georg Ringer over 6 years ago

  • Related to Bug #85359: BE-Pagebrowser broken added
Actions #20

Updated by Stephan Großberndt over 6 years ago

  • Precedes Bug #85743: An exception occurred if I click on List added
Actions #21

Updated by Benni Mack about 6 years ago

  • Status changed from Resolved to Closed
Actions #22

Updated by Daniel Siepmann almost 5 years ago

  • Related to Bug #90231: Linkvalidator makes use of rowCount() and does not work with sqlite added
Actions #23

Updated by Sybille Peters almost 5 years ago

What is the status here? This issue is closed but it seems that rowCount() is still a problem with sqlite, see #90231

Actions

Also available in: Atom PDF