mirror of
https://github.com/php/php-src.git
synced 2024-11-26 19:33:55 +08:00
No more httpd restart is required when PostgreSQL is rebooted.
# Works for pg_query()/pg_send_query()
This commit is contained in:
parent
dc82c80981
commit
ddee00da0e
@ -829,6 +829,9 @@ PHP_FUNCTION(pg_query)
|
||||
|
||||
ZEND_FETCH_RESOURCE2(pgsql, PGconn *, pgsql_link, id, "PostgreSQL link", le_link, le_plink);
|
||||
|
||||
if (PQstatus(pgsql) != CONNECTION_OK) {
|
||||
PQreset(pgsql);
|
||||
}
|
||||
convert_to_string_ex(query);
|
||||
PQsetnonblocking(pgsql, 0);
|
||||
while ((pgsql_result = PQgetResult(pgsql))) {
|
||||
@ -2510,6 +2513,9 @@ PHP_FUNCTION(pg_send_query)
|
||||
|
||||
ZEND_FETCH_RESOURCE2(pgsql, PGconn *, &pgsql_link, id, "PostgreSQL link", le_link, le_plink);
|
||||
|
||||
if (PQstatus(pgsql) != CONNECTION_OK) {
|
||||
PQreset(pgsql);
|
||||
}
|
||||
if (PQsetnonblocking(pgsql, 1)) {
|
||||
php_error(E_NOTICE,"%s() cannot set connection to nonblocking mode",
|
||||
get_active_function_name(TSRMLS_C));
|
||||
|
Loading…
Reference in New Issue
Block a user