mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
Fix bug #79375
Make sure deadlock errors are properly propagated and reports in a number of places in mysqli and PDO MySQL. This also fixes a memory and a segfault that can occur under these conditions.
This commit is contained in:
parent
9353f11bd2
commit
b03776adb5
8 changed files with 309 additions and 7 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue