From: Michael Wallner Date: Mon, 21 Jan 2013 17:10:59 +0000 (+0100) Subject: remove superfluous error text in pgres errors X-Git-Tag: v0.1.0~45 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=f96bf1b561253e6259f02332d3895a292511d519;p=m6w6%2Fext-pq remove superfluous error text in pgres errors --- diff --git a/src/php_pq.c b/src/php_pq.c index ce191b3..f1db28f 100644 --- a/src/php_pq.c +++ b/src/php_pq.c @@ -799,7 +799,11 @@ static PHP_METHOD(pqconn, poll) { if (obj->conn) { if (obj->poller) { - RETURN_LONG(obj->poller(obj->conn)); + if (obj->poller == PQconsumeInput) { + RETURN_LONG(obj->poller(obj->conn) * PGRES_POLLING_OK); + } else { + RETURN_LONG(obj->poller(obj->conn)); + } } else { php_error_docref(NULL TSRMLS_CC, E_WARNING, "No asynchronous operation active"); } @@ -816,7 +820,7 @@ static STATUS php_pqres_success(PGresult *res TSRMLS_DC) case PGRES_BAD_RESPONSE: case PGRES_NONFATAL_ERROR: case PGRES_FATAL_ERROR: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s: %s", PQresStatus(PQresultStatus(res)), PQresultErrorMessage(res)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", PQresultErrorMessage(res)); return FAILURE; default: return SUCCESS;