From c2d44c57360ac290119e8c0d0953d697d3545104 Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Tue, 6 May 2014 17:27:15 +0000 Subject: [PATCH] In `wp-admin/includes/upgrade.php`, remove dead code: * In `maybe_create_table()` and `maybe_add_column()`, the response of `$wpdb->query()` is set to a variable that is never used. * In `make_db_current_silent()`, which is a wrapper for `dbDelta`, a variable is set that is not used. This function appears to be a copy-paste of `make_db_current()`'s `dbDelta()` call but is meant to return nothing, and still does not. See #27882. Built from https://develop.svn.wordpress.org/trunk@28305 git-svn-id: http://core.svn.wordpress.org/trunk@28133 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/upgrade.php | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/wp-admin/includes/upgrade.php b/wp-admin/includes/upgrade.php index 4a853fed0b..558b88e60b 100644 --- a/wp-admin/includes/upgrade.php +++ b/wp-admin/includes/upgrade.php @@ -1385,7 +1385,7 @@ function maybe_create_table($table_name, $create_ddl) { if ( $wpdb->get_var("SHOW TABLES LIKE '$table_name'") == $table_name ) return true; //didn't find it try to create it. - $q = $wpdb->query($create_ddl); + $wpdb->query($create_ddl); // we cannot directly tell that whether this succeeded! if ( $wpdb->get_var("SHOW TABLES LIKE '$table_name'") == $table_name ) return true; @@ -1447,7 +1447,7 @@ function maybe_add_column($table_name, $column_name, $create_ddl) { } } //didn't find it try to create it. - $q = $wpdb->query($create_ddl); + $wpdb->query($create_ddl); // we cannot directly tell that whether this succeeded! foreach ($wpdb->get_col("DESC $table_name", 0) as $column ) { if ($column == $column_name) { @@ -1555,8 +1555,8 @@ function dbDelta( $queries = '', $execute = true ) { $queries = explode( ';', $queries ); $queries = array_filter( $queries ); } - - /** + + /** * Filter the dbDelta SQL queries. * * @since 3.3.0 @@ -1584,23 +1584,23 @@ function dbDelta( $queries = '', $execute = true ) { // Unrecognized query type } } - - /** + + /** * Filter the dbDelta SQL queries for creating tables and/or databases. * * Queries filterable via this hook contain "CREATE TABLE" or "CREATE DATABASE". - * + * * @since 3.3.0 * * @param array $cqueries An array of dbDelta create SQL queries. */ $cqueries = apply_filters( 'dbdelta_create_queries', $cqueries ); - /** + /** * Filter the dbDelta SQL queries for inserting or updating. * * Queries filterable via this hook contain "INSERT INTO" or "UPDATE". - * + * * @since 3.3.0 * * @param array $iqueries An array of dbDelta insert or update SQL queries. @@ -1794,7 +1794,7 @@ function make_db_current( $tables = 'all' ) { * @since 1.5.0 */ function make_db_current_silent( $tables = 'all' ) { - $alterations = dbDelta( $tables ); + dbDelta( $tables ); } /**