summaryrefslogtreecommitdiff
path: root/ext/pdo_pgsql/pgsql_driver.c
diff options
context:
space:
mode:
authorGustavo André dos Santos Lopes <cataphract@php.net>2012-03-08 08:52:28 +0000
committerGustavo André dos Santos Lopes <cataphract@php.net>2012-03-08 08:52:28 +0000
commitfee191658d2d51e76911f1d804cf6458ee9243e8 (patch)
tree398c6cd0d4584fe3e58d5749edd8abbccd4b6969 /ext/pdo_pgsql/pgsql_driver.c
parentef61504b3529699cbc242f62621a48a780fbcde6 (diff)
downloadphp-git-fee191658d2d51e76911f1d804cf6458ee9243e8.tar.gz
- Fixed bug #61267: pdo_pgsql's PDO::exec() returns the number of SELECTed
rows on postgresql >= 9
Diffstat (limited to 'ext/pdo_pgsql/pgsql_driver.c')
-rw-r--r--ext/pdo_pgsql/pgsql_driver.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/pdo_pgsql/pgsql_driver.c b/ext/pdo_pgsql/pgsql_driver.c
index d96c3e8e35..23ea5e58a2 100644
--- a/ext/pdo_pgsql/pgsql_driver.c
+++ b/ext/pdo_pgsql/pgsql_driver.c
@@ -299,7 +299,7 @@ static long pgsql_handle_doer(pdo_dbh_t *dbh, const char *sql, long sql_len TSRM
return -1;
}
H->pgoid = PQoidValue(res);
- ret = atol(PQcmdTuples(res));
+ ret = (qs == PGRES_COMMAND_OK) ? atol(PQcmdTuples(res)) : 0L;
PQclear(res);
return ret;