mirror of
https://github.com/WordPress/WordPress.git
synced 2025-02-16 19:46:21 +00:00
Site Health: Standardize on SELECT VERSION()
query for checking the database server version, due to the MariaDB version declaration potentially causing issues in production environments.
Partially reverts [45691]. Props Clorith. Fixes #47738. Built from https://develop.svn.wordpress.org/trunk@45904 git-svn-id: http://core.svn.wordpress.org/trunk@45715 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
181d77f04e
commit
6cad27efcd
@ -719,7 +719,7 @@ class WP_Debug_Data {
|
|||||||
$extension = null;
|
$extension = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
$server = $wpdb->db_version();
|
$server = $wpdb->get_var( 'SELECT VERSION()' );
|
||||||
|
|
||||||
if ( isset( $wpdb->use_mysqli ) && $wpdb->use_mysqli ) {
|
if ( isset( $wpdb->use_mysqli ) && $wpdb->use_mysqli ) {
|
||||||
$client_version = $wpdb->dbh->client_info;
|
$client_version = $wpdb->dbh->client_info;
|
||||||
|
@ -132,18 +132,16 @@ class WP_Site_Health {
|
|||||||
private function prepare_sql_data() {
|
private function prepare_sql_data() {
|
||||||
global $wpdb;
|
global $wpdb;
|
||||||
|
|
||||||
if ( method_exists( $wpdb, 'db_version' ) ) {
|
if ( $wpdb->use_mysqli ) {
|
||||||
if ( $wpdb->use_mysqli ) {
|
// phpcs:ignore WordPress.DB.RestrictedFunctions.mysql_mysqli_get_server_info
|
||||||
// phpcs:ignore WordPress.DB.RestrictedFunctions.mysql_mysqli_get_server_info
|
$mysql_server_type = mysqli_get_server_info( $wpdb->dbh );
|
||||||
$mysql_server_type = mysqli_get_server_info( $wpdb->dbh );
|
} else {
|
||||||
} else {
|
// phpcs:ignore WordPress.DB.RestrictedFunctions.mysql_mysql_get_server_info
|
||||||
// phpcs:ignore WordPress.DB.RestrictedFunctions.mysql_mysql_get_server_info
|
$mysql_server_type = mysql_get_server_info( $wpdb->dbh );
|
||||||
$mysql_server_type = mysql_get_server_info( $wpdb->dbh );
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->mysql_server_version = $wpdb->db_version();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$this->mysql_server_version = $wpdb->get_var( 'SELECT VERSION()' );
|
||||||
|
|
||||||
$this->health_check_mysql_rec_version = '5.6';
|
$this->health_check_mysql_rec_version = '5.6';
|
||||||
|
|
||||||
if ( stristr( $mysql_server_type, 'mariadb' ) ) {
|
if ( stristr( $mysql_server_type, 'mariadb' ) ) {
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '5.3-alpha-45903';
|
$wp_version = '5.3-alpha-45904';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user