mirror of
https://github.com/MariaDB/server.git
synced 2025-01-29 02:05:57 +01:00
Search through options to find where the slow query log actually is.
This commit is contained in:
parent
3c04f839b9
commit
76daa59fc8
1 changed files with 8 additions and 2 deletions
|
@ -40,6 +40,7 @@ unless (@ARGV) {
|
|||
warn "basedir=$basedir\n" if $opt{v};
|
||||
|
||||
my $datadir = ($defaults =~ m/--datadir=(.*)/)[0];
|
||||
my $slowlog = ($defaults =~ m/--log-slow-queries=(.*)/)[0];
|
||||
if (!$datadir or $opt{i}) {
|
||||
# determine the datadir from the instances section of /etc/my.cnf, if any
|
||||
my $instances = `my_print_defaults instances`;
|
||||
|
@ -55,8 +56,13 @@ unless (@ARGV) {
|
|||
warn "datadir=$datadir\n" if $opt{v};
|
||||
}
|
||||
|
||||
@ARGV = <$datadir/$opt{h}-slow.log>;
|
||||
die "Can't find '$datadir/$opt{h}-slow.log'\n" unless @ARGV;
|
||||
if ( -f $slowlog ) {
|
||||
@ARGV = ($slowlog);
|
||||
die "Can't find '$slowlog'\n" unless @ARGV;
|
||||
} else {
|
||||
@ARGV = <$datadir/$opt{h}-slow.log>;
|
||||
die "Can't find '$datadir/$opt{h}-slow.log'\n" unless @ARGV;
|
||||
}
|
||||
}
|
||||
|
||||
warn "\nReading mysql slow query log from @ARGV\n";
|
||||
|
|
Loading…
Add table
Reference in a new issue