]> granicus.if.org Git - php/commitdiff
Give an error when USE_RESULT is used with fetch_all
authorAndrey Hristov <andrey@php.net>
Tue, 13 Jul 2010 13:02:00 +0000 (13:02 +0000)
committerAndrey Hristov <andrey@php.net>
Tue, 13 Jul 2010 13:02:00 +0000 (13:02 +0000)
ext/mysqlnd/mysqlnd_result.c

index b9a05da05b7e21fe2c21929aee0f5bc30732b11a..4de2f39ee3bf981eb253287d1733b43efbbe785b 100644 (file)
@@ -1569,6 +1569,10 @@ MYSQLND_METHOD(mysqlnd_res, fetch_all)(MYSQLND_RES * result, unsigned int flags,
 
        /* mysqlnd_res::fetch_all works with buffered resultsets only */
        if (result->unbuf || (!result->unbuf && !set)) {
+               php_error_docref(NULL TSRMLS_CC, E_WARNING, "fetch_all can be used only with buffered sets");
+               if (result->conn) {
+                       SET_CLIENT_ERROR(result->conn->error_info, CR_NOT_IMPLEMENTED, UNKNOWN_SQLSTATE, "fetch_all can be used only with buffered sets");
+               }
                RETVAL_NULL();
                DBG_VOID_RETURN;
        }