PGconn *link = (PGconn *)rsrc->ptr;
PGresult *res;
- PQsetnonblocking(link,1);
- if (PQisBusy(link)) {
- if (!PQrequestCancel(link)) {
- php_error(E_WARNING,"PostgreSQL: failed to cancel qeury. %s", PQerrorMessage(link));
- }
- }
while ((res = PQgetResult(link))) {
PQclear(res);
}
PGconn *link = (PGconn *)rsrc->ptr;
PGresult *res;
- PQsetnonblocking(link,1);
- if (PQisBusy(link)) {
- if (!PQrequestCancel(link)) {
- php_error(E_WARNING,"PostgreSQL: failed to cancel qeury. %s", PQerrorMessage(link));
- }
- }
while ((res = PQgetResult(link))) {
PQclear(res);
}
link = (PGconn *) rsrc->ptr;
- PQsetnonblocking(link,0); /* Just in case */
- if (PQisBusy(link)) {
- if (!PQrequestCancel(link)) {
- php_error(E_WARNING,"PostgreSQL: failed to cancel qeury. %s", PQerrorMessage(link));
- }
- }
+ PQsetnonblocking(link, 0);
while ((res = PQgetResult(link))) {
PQclear(res);
}
ZEND_FETCH_RESOURCE2(pgsql, PGconn *, pgsql_link, id, "PostgreSQL link", le_link, le_plink);
convert_to_string_ex(query);
- if (PQisBusy(pgsql)) {
- php_error(E_NOTICE,"%s() cannot execute query while executing async query.",
- get_active_function_name(TSRMLS_C));
- RETURN_FALSE;
- }
+ PQsetnonblocking(pgsql, 0);
while ((pgsql_result = PQgetResult(pgsql))) {
PQclear(pgsql_result);
leftover = 1;
}
if (leftover) {
- php_error(E_WARNING,"%s() found results on this connection. Use pg_get_result() to get results",
+ php_error(E_NOTICE,"%s() found results on this connection. Use pg_get_result() to get results",
get_active_function_name(TSRMLS_C));
}
pgsql_result = PQexec(pgsql, Z_STRVAL_PP(query));
ZEND_FETCH_RESOURCE2(pgsql, PGconn *, &pgsql_link, id, "PostgreSQL link", le_link, le_plink);
+ if (PQsetnonblocking(pgsql, 1)) {
+ php_error(E_NOTICE,"%s() cannot set connection to nonblocking mode",
+ get_active_function_name(TSRMLS_C));
+ RETURN_FALSE;
+ }
switch(entry_type) {
case PHP_PG_ASYNC_IS_BUSY:
PQconsumeInput(pgsql);
php_error(E_ERROR,"Pgsql module error. Report this error");
break;
}
+ if (PQsetnonblocking(pgsql, 0)) {
+ php_error(E_NOTICE,"%s() cannot set connection to blocking mode",
+ get_active_function_name(TSRMLS_C));
+ }
convert_to_boolean_ex(&return_value);
}
/* }}} */
if (PQsetnonblocking(pgsql, 1)) {
php_error(E_NOTICE,"%s() cannot set connection to nonblocking mode",
get_active_function_name(TSRMLS_C));
- }
- if (PQisBusy(pgsql)) {
- php_error(E_WARNING,"%s() annot send multiple query",
- get_active_function_name(TSRMLS_C));
RETURN_FALSE;
}
while ((res = PQgetResult(pgsql))) {
leftover = 1;
}
if (leftover) {
- php_error(E_NOTICE,"%s() - There are results on this connection. Call pg_get_result() until it returns false",
+ php_error(E_NOTICE,"%s() - There are results on this connection. Call pg_get_result() until it returns FALSE",
get_active_function_name(TSRMLS_C));
}
if (!PQsendQuery(pgsql, query)) {
ZEND_FETCH_RESOURCE2(pgsql, PGconn *, &pgsql_link, id, "PostgreSQL link", le_link, le_plink);
- if (PQsetnonblocking(pgsql, 1)) {
- php_error(E_NOTICE,"%s() failed to set connection to nonblocking mode",
- get_active_function_name(TSRMLS_C));
- }
pgsql_result = PQgetResult(pgsql);
if (!pgsql_result) {
/* no result */
RETURN_FALSE;
}
- if (PQsetnonblocking(pgsql, 0)) {
- php_error(E_NOTICE,"%s() failed to set connection to blocking mode",
- get_active_function_name(TSRMLS_C));
- }
pg_result = (pgsql_result_handle *) emalloc(sizeof(pgsql_result_handle));
pg_result->conn = pgsql;
pg_result->result = pgsql_result;