diff options
author | Johannes Schlüter <johannes@php.net> | 2011-05-16 15:37:39 +0000 |
---|---|---|
committer | Johannes Schlüter <johannes@php.net> | 2011-05-16 15:37:39 +0000 |
commit | 3e17b490084ac9ffd77fd483fbb73857390166f7 (patch) | |
tree | 62e7a227584e40c752122a0d5fe82f02043a6360 /ext/pdo_mysql/mysql_statement.c | |
parent | 9e5bc2c1384c850c60b23da11714fbf197d7caa1 (diff) | |
download | php-git-3e17b490084ac9ffd77fd483fbb73857390166f7.tar.gz |
- Fix Bug #53782 (foreach throws irrelevant exception)
Diffstat (limited to 'ext/pdo_mysql/mysql_statement.c')
-rwxr-xr-x | ext/pdo_mysql/mysql_statement.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/ext/pdo_mysql/mysql_statement.c b/ext/pdo_mysql/mysql_statement.c index 79694b368a..470cd0898e 100755 --- a/ext/pdo_mysql/mysql_statement.c +++ b/ext/pdo_mysql/mysql_statement.c @@ -656,7 +656,11 @@ static int pdo_mysql_stmt_fetch(pdo_stmt_t *stmt, #endif /* PDO_USE_MYSQLND */ if ((S->current_data = mysql_fetch_row(S->result)) == NULL) { - if (mysql_errno(S->H->server)) { +#if PDO_USE_MYSQLND + if (S->result->unbuf && !S->result->unbuf->eof_reached && mysql_errno(S->H->server)) { +#else + if (!S->result->eof && mysql_errno(S->H->server)) { +#endif pdo_mysql_error_stmt(stmt); } PDO_DBG_RETURN(0); |