diff options
Diffstat (limited to 'ext/pdo_mysql/mysql_statement.c')
-rw-r--r-- | ext/pdo_mysql/mysql_statement.c | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/ext/pdo_mysql/mysql_statement.c b/ext/pdo_mysql/mysql_statement.c index 4e23d10245..f3811abfe6 100644 --- a/ext/pdo_mysql/mysql_statement.c +++ b/ext/pdo_mysql/mysql_statement.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 7 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2018 The PHP Group | + | Copyright (c) The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -257,7 +257,10 @@ static int pdo_mysql_stmt_execute_prepared_libmysql(pdo_stmt_t *stmt) /* {{{ */ /* if buffered, pre-fetch all the data */ if (H->buffered) { - mysql_stmt_store_result(S->stmt); + if (mysql_stmt_store_result(S->stmt)) { + pdo_mysql_error_stmt(stmt); + PDO_DBG_RETURN(0); + } } } } @@ -300,6 +303,7 @@ static int pdo_mysql_stmt_execute_prepared_mysqlnd(pdo_stmt_t *stmt) /* {{{ */ /* if buffered, pre-fetch all the data */ if (H->buffered) { if (mysql_stmt_store_result(S->stmt)) { + pdo_mysql_error_stmt(stmt); PDO_DBG_RETURN(0); } } @@ -388,7 +392,8 @@ static int pdo_mysql_stmt_next_rowset(pdo_stmt_t *stmt) /* {{{ */ /* if buffered, pre-fetch all the data */ if (H->buffered) { if (mysql_stmt_store_result(S->stmt)) { - PDO_DBG_RETURN(1); + pdo_mysql_error_stmt(stmt); + PDO_DBG_RETURN(0); } } } @@ -623,6 +628,7 @@ static int pdo_mysql_stmt_fetch(pdo_stmt_t *stmt, enum pdo_fetch_orientation ori PDO_DBG_INF_FMT("stmt=%p", S->stmt); if (S->stmt) { if (FAIL == mysqlnd_stmt_fetch(S->stmt, &fetched_anything) || fetched_anything == FALSE) { + pdo_mysql_error_stmt(stmt); PDO_DBG_RETURN(0); } @@ -938,12 +944,3 @@ const struct pdo_stmt_methods mysql_stmt_methods = { pdo_mysql_stmt_next_rowset, pdo_mysql_stmt_cursor_closer }; - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ |