andrey                                   Fri, 25 Sep 2009 12:35:58 +0000

Revision: http://svn.php.net/viewvc?view=revision&revision=288789

Log:
Fix returned value, if mysql_stmt_attr_set fails
then mysqli returns true, otherwise false. Wrong logic.

Changed paths:
    U   php/php-src/branches/PHP_5_2/ext/mysqli/mysqli_api.c

Modified: php/php-src/branches/PHP_5_2/ext/mysqli/mysqli_api.c
===================================================================
--- php/php-src/branches/PHP_5_2/ext/mysqli/mysqli_api.c        2009-09-25 
12:33:27 UTC (rev 288788)
+++ php/php-src/branches/PHP_5_2/ext/mysqli/mysqli_api.c        2009-09-25 
12:35:58 UTC (rev 288789)
@@ -1848,14 +1848,13 @@
        zval    *mysql_stmt;
        ulong   mode;
        ulong   attr;
-       int             rc;

        if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), 
"Oll", &mysql_stmt, mysqli_stmt_class_entry, &attr, &mode) == FAILURE) {
                return;
        }
        MYSQLI_FETCH_RESOURCE(stmt, MY_STMT *, &mysql_stmt, "mysqli_stmt", 
MYSQLI_STATUS_VALID);

-       if ((rc = mysql_stmt_attr_set(stmt->stmt, attr, (void *)&mode))) {
+       if (FALSE == mysql_stmt_attr_set(stmt->stmt, attr, (void *)&mode)) {
                RETURN_FALSE;
        }
        RETURN_TRUE;

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to