Skip to content

minimal database list retrieval #537

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 28, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions mysqltuner.pl
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,9 @@ package main;
# Checks for supported or EOL'ed MySQL versions
my ( $mysqlvermajor, $mysqlverminor, $mysqlvermicro );

# Database
my @dblist;

# Super structure containing all information
my %result;
$result{'MySQLTuner'}{'version'} = $tunerversion;
Expand Down Expand Up @@ -5849,8 +5852,8 @@ sub mysql_databases {
return;
}

my @dblist = select_array(
"SELECT DISTINCT TABLE_SCHEMA FROM information_schema.TABLES WHERE TABLE_SCHEMA NOT IN ( 'mysql', 'performance_schema', 'information_schema', 'sys' );"
@dblist = select_array(
"SELECT SCHEMA_NAME FROM information_schema.SCHEMATA WHERE SCHEMA_NAME NOT IN ( 'mysql', 'performance_schema', 'information_schema', 'sys' );"
);
infoprint "There is " . scalar(@dblist) . " Database(s).";
my @totaldbinfo = split /\s/,
Expand Down Expand Up @@ -6027,9 +6030,6 @@ sub mysql_tables {
if (mysql_version_ge(8) and not mysql_version_eq(10)) {
infoprint "MySQL and Percona version 8 and greater have remove PROCEDURE ANALYSE feature"
}
my @dblist = select_array(
"SELECT DISTINCT TABLE_SCHEMA FROM information_schema.TABLES WHERE TABLE_SCHEMA NOT IN ( 'mysql', 'performance_schema', 'information_schema', 'sys' );"
);
foreach (@dblist) {
my $dbname = $_;
next unless defined $_;
Expand Down