Stas,
On 09/06/2011 06:55 PM, Stas Malyshev wrote:
Hi!

On 9/6/11 2:46 AM, Andrey Hristov wrote:
I've looked into
mysqli_result_is_unbuffered_and_not_everything_is_fetched() and it looks
like for libmysql it checks this:
(((r)->handle&& (r)->handle->status == MYSQL_STATUS_USE_RESULT) ||
((r)->data == NULL))
When I step through your code, r->data (which is result->data) is always
NULL for me, which means warning is generated and 0 is returned. Is it a
problem in libmysql?


what kind of a Problem?

Please read above. The above says php with libmysql does not return the
result the tests expects - instead of returning number of rows after the
last fetch it still returns 0. While mysqlnd does not return 0. I would
like to know what is causing this and why php+libmysql result is
different from what your test expects.

r->data should be always NULL, for an unbuffered fetch, r->data holds the data for buffered result sets. It is additional protection, an assert. I don't see a problem with that. I don't see also the behavior you describe - 0 returned even after the last fetch. If all data is fetched r->handle->status will be no more MYSQL_STATUS_USE_RESULT but something else (MYSQL_STATUS_READY), this will signal, that everything has been fetched. Of course, the check could have been !res->eof, but this is not what Georg chose long ago (see 5_2) :
if (result->handle && result->handle->status == MYSQL_STATUS_USE_RESULT) {

On my box the test passes both with libmysql and mysqlnd. What I did was to create consistent behavior, something people expect, although libmysql returns something different, which was mysqlnd's behavior in the beginning too.

Andrey


--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to