Skip to content

Commit

Permalink
Extract common part from if
Browse files Browse the repository at this point in the history
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
  • Loading branch information
kamil-tekiela committed Jan 6, 2022
1 parent 01438e9 commit a4cb490
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions libraries/classes/DatabaseInterface.php
Expand Up @@ -446,11 +446,10 @@ static function ($a, $b) {
// If permissions are wrong on even one database directory,
// information_schema does not return any table info for any database
// this is why we fall back to SHOW TABLE STATUS even for MySQL >= 50002
if (empty($tables)) {
if ($tables === []) {
$sql = 'SHOW TABLE STATUS FROM ' . Util::backquote($database);
if ($table || ($tbl_is_group === true) || $table_type) {
$sql = 'SHOW TABLE STATUS FROM '
. Util::backquote($database)
. ' WHERE';
$sql .= ' WHERE';
$needAnd = false;
if ($table || ($tbl_is_group === true)) {
if (is_array($table)) {
Expand Down Expand Up @@ -488,9 +487,6 @@ static function ($a, $b) {
$sql .= " `Comment` != 'VIEW'";
}
}
} else {
$sql = 'SHOW TABLE STATUS FROM '
. Util::backquote($database);
}

$each_tables = $this->fetchResult($sql, 'Name', null, $link);
Expand Down

0 comments on commit a4cb490

Please sign in to comment.