developer.jelix.org is not used any more and exists only for history. Post new tickets on the Github account.
developer.jelix.org n'est plus utilisée, et existe uniquement pour son historique. Postez les nouveaux tickets sur le compte github.

Opened 13 years ago

Closed 13 years ago

#532 closed bug (wontfix)

API Inconsistency between jDbResultSet::rowCount() and jDbPDOResultSet::rowCount()

Reported by: bballizlife Owned by:
Priority: normal Milestone:
Component: jelix:db Version: trunk
Severity: normal Keywords: jDb, PDO, rowCount
Cc: Blocked By:
Blocking: Documentation needed: no
Hosting Provider: Php version:

Description

jDbResultSet::rowCount() returns the number of rows in the resultset

jDbPDOResultSet::rowCount() is an inherited method of PDOStatement.

According to PDOStatement::rowCount() :

returns the number of rows affected by the last DELETE, INSERT, or UPDATE statement executed by the corresponding PDOStatement object. If the last SQL statement executed by the associated PDOStatement 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.

This means that using "rowCount()" on a resultset with or without PDO is not the same thing. Here i guess this is an inconsistency in the API.

Change History (5)

comment:1 Changed 13 years ago by laurentj

Well, jDbResultSet and jDbPDOResultSet are returns only for SELECT statement, so, in this case, rowCount has the same behaviors.

For me it is a WONTFIX or INVALID bug.

comment:2 Changed 13 years ago by bballizlife

The bug appears for sqlite3. Even if the resultset has rows, PDOStatement::rowCount() returns 0.

But as the php documentation says : "However, this behaviour is not guaranteed for all databases and should not be relied on for portable applications."

Jelix can do nothing for that i guess.

comment:3 Changed 13 years ago by laurentj

  • Resolution set to fixed
  • Status changed from new to closed

comment:4 Changed 13 years ago by laurentj

  • Resolution fixed deleted
  • Status changed from closed to reopened

comment:5 Changed 13 years ago by laurentj

  • Resolution set to wontfix
  • Status changed from reopened to closed
Note: See TracTickets for help on using tickets.