Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions ext/mysqlnd/mysqlnd.h
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ PHPAPI enum_func_status mysqlnd_poll(MYSQLND **r_array, MYSQLND **e_array, MYSQL
#define mysqlnd_get_proto_info(conn) ((conn)->data)->m->get_protocol_information((conn)->data)
#define mysqlnd_thread_id(conn) ((conn)->data)->m->get_thread_id((conn)->data)
#define mysqlnd_get_server_status(conn) ((conn)->data)->m->get_server_status((conn)->data)
#define mysqlnd_check_stream_eof(conn) php_stream_eof(((conn)->data)->vio->data->m.get_stream((conn)->data->vio))

#define mysqlnd_num_rows(result) (result)->m.num_rows((result))
#define mysqlnd_num_fields(result) (result)->m.num_fields((result))
Expand Down
7 changes: 7 additions & 0 deletions ext/pdo_mysql/mysql_driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -506,10 +506,17 @@ static int pdo_mysql_check_liveness(pdo_dbh_t *dbh)
PDO_DBG_ENTER("pdo_mysql_check_liveness");
PDO_DBG_INF_FMT("dbh=%p", dbh);

#ifdef PDO_USE_MYSQLND
if (mysqlnd_check_stream_eof(H->server)) {
PDO_DBG_RETURN(FAILURE);
}
PDO_DBG_RETURN(SUCCESS);
#else
if (mysql_ping(H->server)) {
PDO_DBG_RETURN(FAILURE);
}
PDO_DBG_RETURN(SUCCESS);
#endif
}
/* }}} */

Expand Down