summaryrefslogtreecommitdiff
path: root/ext/pdo_mysql/mysql_statement.c
diff options
context:
space:
mode:
authorJohannes Schlüter <johannes@php.net>2011-05-16 15:37:39 +0000
committerJohannes Schlüter <johannes@php.net>2011-05-16 15:37:39 +0000
commita90b7da4358e9fdd873035fb58f4418ddbdd9e65 (patch)
tree05663c3210436283998ce0215a95ae190a3110c2 /ext/pdo_mysql/mysql_statement.c
parent8ab4c89d0b7eba20020773d5c28067c4ca282443 (diff)
downloadphp-git-a90b7da4358e9fdd873035fb58f4418ddbdd9e65.tar.gz
- Fix Bug #53782 (foreach throws irrelevant exception)
Diffstat (limited to 'ext/pdo_mysql/mysql_statement.c')
-rwxr-xr-xext/pdo_mysql/mysql_statement.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/ext/pdo_mysql/mysql_statement.c b/ext/pdo_mysql/mysql_statement.c
index 375e493930..6adba96168 100755
--- a/ext/pdo_mysql/mysql_statement.c
+++ b/ext/pdo_mysql/mysql_statement.c
@@ -640,7 +640,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);