Patch pg_affected_rows_returns_0_after_select.patch for Documentation problem Bug #61266
Patch version 2012-03-03 13:43 UTC
Return to Bug #61266 |
Download this patch
Patch Revisions:
Developer: ben.pineau@gmail.com
--- ext/pgsql/pgsql.c-orig 2012-03-01 17:21:02.000000000 +0100
+++ ext/pgsql/pgsql.c 2012-03-02 11:55:34.000000000 +0100
@@ -2012,7 +2012,8 @@
break;
case PHP_PG_CMD_TUPLES:
#if HAVE_PQCMDTUPLES
- Z_LVAL_P(return_value) = atoi(PQcmdTuples(pgsql_result));
+ Z_LVAL_P(return_value) = (PQresultStatus(pgsql_result) == PGRES_COMMAND_OK) ?
+ atol(PQcmdTuples(pgsql_result)) : 0L;
#else
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Not supported under this build");
Z_LVAL_P(return_value) = 0;
|