Bug #61266 [ReO->Csd]: pg_affected_rows inconsistent behavior (depends on PostgreSQL server version)
| From: | yohgaki@php.net | Date: | Wed, 29 Jan 2014 06:00:21 +0000 |
| Subject: | Bug #61266 [ReO->Csd]: pg_affected_rows inconsistent behavior (depends on PostgreSQL server version) | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-10906@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=61266&edit=1
ID: 61266
Updated by: yohgaki@php.net
Reported by: ben dot pineau at gmail dot com
Summary: pg_affected_rows inconsistent behavior (depends on
PostgreSQL server version)
-Status: Re-Opened
+Status: Closed
Type: Bug
Package: Documentation problem
Operating System: all
PHP Version: Irrelevant
-Assigned To:
+Assigned To: yohgaki
Block user comment: N
Private report: N
Previous Comments:
------------------------------------------------------------------------
[2014-01-29 05:59:27] yohgaki@php.net
Automatic comment from SVN on behalf of yohgaki
Revision: http://svn.php.net/viewvc/?view=revision&revision=332751
Log: Fixed Bug #61266pg_affected_rows inconsistent behavior (depends on PostgreSQL server version)
------------------------------------------------------------------------
[2013-06-28 08:45:56] yohgaki@php.net
Ok, them we should document this.
------------------------------------------------------------------------
[2013-06-27 19:56:46] ben dot pineau at gmail dot com
We had code using pg_affected_rows() to detect if the previous query was a simple SELECT or a DML.
Yes, that's dumb and our code was fixed since then ;) I understand there may not be that many
other persons affected.
Right, I also think the documentation deserves an update (including the case reported by
bs@php.net).
------------------------------------------------------------------------
[2013-06-26 22:06:48] yohgaki@php.net
I guess no one was used pg_affected_rows() for SELECT query before PostgreSQL
9.0.
Thank you for the patch, but I think it's nice to keep new behavior and document
it.
Any comments?
------------------------------------------------------------------------
[2013-03-26 17:17:46] bs@php.net
It's actually possible that a writing command produces a result set (which can
differ in the number of affected / returned rows):
Simple example would be:
INSERT INTO foo (bar, baz)
VALUES (DEFAULT, 'bang')
RETURNING (bar);
Therefore i don't see this has having only a low impact.
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
https://bugs.php.net/bug.php?id=61266
--
Edit this bug report at https://bugs.php.net/bug.php?id=61266&edit=1