mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-24 10:09:47 +01:00
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
This commit is contained in:
parent
aaa3eb07ad
commit
c2d44c5736
@ -1385,7 +1385,7 @@ function maybe_create_table($table_name, $create_ddl) {
|
|||||||
if ( $wpdb->get_var("SHOW TABLES LIKE '$table_name'") == $table_name )
|
if ( $wpdb->get_var("SHOW TABLES LIKE '$table_name'") == $table_name )
|
||||||
return true;
|
return true;
|
||||||
//didn't find it try to create it.
|
//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!
|
// we cannot directly tell that whether this succeeded!
|
||||||
if ( $wpdb->get_var("SHOW TABLES LIKE '$table_name'") == $table_name )
|
if ( $wpdb->get_var("SHOW TABLES LIKE '$table_name'") == $table_name )
|
||||||
return true;
|
return true;
|
||||||
@ -1447,7 +1447,7 @@ function maybe_add_column($table_name, $column_name, $create_ddl) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
//didn't find it try to create it.
|
//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!
|
// we cannot directly tell that whether this succeeded!
|
||||||
foreach ($wpdb->get_col("DESC $table_name", 0) as $column ) {
|
foreach ($wpdb->get_col("DESC $table_name", 0) as $column ) {
|
||||||
if ($column == $column_name) {
|
if ($column == $column_name) {
|
||||||
@ -1794,7 +1794,7 @@ function make_db_current( $tables = 'all' ) {
|
|||||||
* @since 1.5.0
|
* @since 1.5.0
|
||||||
*/
|
*/
|
||||||
function make_db_current_silent( $tables = 'all' ) {
|
function make_db_current_silent( $tables = 'all' ) {
|
||||||
$alterations = dbDelta( $tables );
|
dbDelta( $tables );
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user