pfui; merging old patches without test
authorMichael Wallner <mike@php.net>
Wed, 6 Feb 2013 16:21:39 +0000 (17:21 +0100)
committerMichael Wallner <mike@php.net>
Wed, 6 Feb 2013 16:21:39 +0000 (17:21 +0100)
src/php_pq.c

index 4c970782d6d7f4f68cdbc5041839b1906b17f7a8..e298d2b8ea5aad37d728233abdfba1cc7ebf1811 100644 (file)
@@ -3601,24 +3601,19 @@ static PHP_METHOD(pqstm, descAsync) {
        if (SUCCESS == zend_parse_parameters_none()) {
                php_pqstm_object_t *obj = zend_object_store_get_object(getThis() TSRMLS_CC);
 
-               if (obj->conn && obj->name) {
-                       php_pqconn_object_t *conn_obj = zend_object_store_get_object(obj->conn TSRMLS_CC);
-
-                       if (conn_obj->conn) {
-                               conn_obj->poller = PQconsumeInput;
-                               if (PQsendDescribePrepared(conn_obj->conn, obj->name)) {
-                                       RETVAL_TRUE;
-                               } else {
-                                       php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not describe statement: %s", PQerrorMessage(conn_obj->conn));
-                                       RETVAL_FALSE;
-                               }
+               if (obj->intern) {
 
-                               php_pqconn_notify_listeners(obj->conn, conn_obj TSRMLS_CC);
+                       obj->intern->conn->intern->poller = PQconsumeInput;
 
+                       if (PQsendDescribePrepared(obj->intern->conn->intern->conn, obj->intern->name)) {
+                               RETVAL_TRUE;
                        } else {
-                               php_error_docref(NULL TSRMLS_CC, E_WARNING, "Connection not initialized");
+                               php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not describe statement: %s", PHP_PQerrorMessage(obj->intern->conn->intern->conn));
                                RETVAL_FALSE;
                        }
+
+                       php_pqconn_notify_listeners(obj->intern->conn TSRMLS_CC);
+
                } else {
                        php_error_docref(NULL TSRMLS_CC, E_WARNING, "Statement not initialized");
                        RETVAL_FALSE;