Build/Test Tools: Fix the Travis CI build for the 3.7 branch.

Among other fixes, this backports [26087], [26091], [26095], [26252], [26307], [26318], [26512], [26705], [26871], [26909-26910], [26940], [27086], [27168], [28799], [28873], [28943], [28961], [28964], [28966-28967], [29120], [29251], [29503], [29860], [29869], [29954], [30001], [30282], [30285], [30289-30291], [30513-30514], [30516-30521], [30524], [30526], [30529-30530], [31253-31254], [31257-31259], [31622], [40241], [40255], [40257], [40259], [40269], [40271], [40446], [40449], [40457], [40604], [40538], [40833], [41082], [41303], [41306], [44993].

See #49485.
Built from https://develop.svn.wordpress.org/branches/3.7@47343


git-svn-id: http://core.svn.wordpress.org/branches/3.7@47130 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2020-02-22 12:06:09 +00:00
parent 803b9ff032
commit f27b277f7a
4 changed files with 17 additions and 9 deletions

View File

@ -1644,9 +1644,9 @@ function dbDelta( $queries = '', $execute = true ) {
continue;
// Fetch the table column structure from the database
$wpdb->suppress_errors();
$suppress = $wpdb->suppress_errors();
$tablefields = $wpdb->get_results("DESCRIBE {$table};");
$wpdb->suppress_errors( false );
$wpdb->suppress_errors( $suppress );
if ( ! $tablefields )
continue;

View File

@ -558,9 +558,9 @@ function update_meta_cache($meta_type, $object_ids) {
return $cache;
// Get meta info
$id_list = join(',', $ids);
$meta_list = $wpdb->get_results( $wpdb->prepare("SELECT $column, meta_key, meta_value FROM $table WHERE $column IN ($id_list)",
$meta_type), ARRAY_A );
$id_list = join( ',', $ids );
$id_column = 'user' == $meta_type ? 'umeta_id' : 'meta_id';
$meta_list = $wpdb->get_results( "SELECT $column, meta_key, meta_value FROM $table WHERE $column IN ($id_list) ORDER BY $id_column ASC", ARRAY_A );
if ( !empty($meta_list) ) {
foreach ( $meta_list as $metarow) {

View File

@ -1130,10 +1130,10 @@ function install_blog($blog_id, $blog_title = '') {
require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
$wpdb->suppress_errors();
$suppress = $wpdb->suppress_errors();
if ( $wpdb->get_results( "DESCRIBE {$wpdb->posts}" ) )
die( '<h1>' . __( 'Already Installed' ) . '</h1><p>' . __( 'You appear to have already installed WordPress. To reinstall please clear your old database tables first.' ) . '</p></body></html>' );
$wpdb->suppress_errors( false );
$wpdb->suppress_errors( $suppress );
$url = get_blogaddress_by_id( $blog_id );
@ -1180,11 +1180,11 @@ function install_blog_defaults($blog_id, $user_id) {
require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
$wpdb->suppress_errors();
$suppress = $wpdb->suppress_errors();
wp_install_defaults($user_id);
$wpdb->suppress_errors( false );
$wpdb->suppress_errors( $suppress );
}
/**

View File

@ -1258,7 +1258,15 @@ class wpdb {
$client_flags = defined( 'MYSQL_CLIENT_FLAGS' ) ? MYSQL_CLIENT_FLAGS : 0;
if ( WP_DEBUG ) {
$error_reporting = false;
if ( defined( 'E_DEPRECATED' ) ) {
$error_reporting = error_reporting();
error_reporting( $error_reporting ^ E_DEPRECATED );
}
$this->dbh = mysql_connect( $this->dbhost, $this->dbuser, $this->dbpassword, $new_link, $client_flags );
if ( false !== $error_reporting ) {
error_reporting( $error_reporting );
}
} else {
$this->dbh = @mysql_connect( $this->dbhost, $this->dbuser, $this->dbpassword, $new_link, $client_flags );
}