Permalink
Browse files

Give an error when USE_RESULT is used with fetch_all

  • Loading branch information...
Andrey Hristov
Andrey Hristov committed Jul 13, 2010
1 parent 25710a4 commit 12f8599b865e57a12f1a161e2b7e8bbfec0fc1a9
Showing with 4 additions and 0 deletions.
  1. +4 −0 ext/mysqlnd/mysqlnd_result.c
@@ -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;
}

0 comments on commit 12f8599

Please sign in to comment.