php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #36176 PDO_PGSQL - PDO::exec() return 1 but no row affected
Submitted: 2006-01-27 00:55 UTC Modified: 2006-01-29 18:36 UTC
From: kodmasin at gmail dot com Assigned:
Status: Closed Package: PDO related
PHP Version: 5.1.2 OS: Linux - openSUSE 10.0
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: kodmasin at gmail dot com
New email:
PHP Version: OS:

 

 [2006-01-27 00:55 UTC] kodmasin at gmail dot com
Description:
------------
PDO::exec under postgresql driver returns 1 even when there are no rows affected

Reproduce code:
---------------
Tehre are no rows in table with index==20
<?php

$db_connection = new PDO("pgsql:host=localhost port=5432 dbname=test", "test", "test", array(PDO::ATTR_PERSISTENT => true));

print var_dump($db_connection->exec("DELETE FROM test WHERE index=20"));

?>

Expected result:
----------------
int(0)


Actual result:
--------------
int(1)

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-01-29 18:36 UTC] iliaa@php.net
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 13:01:29 2024 UTC