diff --git a/wp-admin/includes/upgrade.php b/wp-admin/includes/upgrade.php index 4919fd4317..f41422b576 100644 --- a/wp-admin/includes/upgrade.php +++ b/wp-admin/includes/upgrade.php @@ -926,19 +926,13 @@ function upgrade_270() { */ function maybe_create_table($table_name, $create_ddl) { global $wpdb; - foreach ($wpdb->get_col("SHOW TABLES",0) as $table ) { - if ($table == $table_name) { - return true; - } - } + 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); // we cannot directly tell that whether this succeeded! - foreach ($wpdb->get_col("SHOW TABLES",0) as $table ) { - if ($table == $table_name) { - return true; - } - } + if ( $wpdb->get_var("SHOW TABLES LIKE '$table_name'") == $table_name ) + return true; return false; }