summaryrefslogtreecommitdiff
path: root/scripts/mysqldumpslow.sh
diff options
context:
space:
mode:
authorunknown <mtaylor@qualinost.(none)>2006-12-18 21:12:01 -0800
committerunknown <mtaylor@qualinost.(none)>2006-12-18 21:12:01 -0800
commit76daa59fc8252afa4c374a1be725fdc4827561e7 (patch)
treea1278704267f8cac2bd0a8d2cd85a36c72364979 /scripts/mysqldumpslow.sh
parent3c04f839b9326a9eb3090a74128d7466af9827dd (diff)
downloadmariadb-git-76daa59fc8252afa4c374a1be725fdc4827561e7.tar.gz
Search through options to find where the slow query log actually is.
Diffstat (limited to 'scripts/mysqldumpslow.sh')
-rw-r--r--scripts/mysqldumpslow.sh10
1 files changed, 8 insertions, 2 deletions
diff --git a/scripts/mysqldumpslow.sh b/scripts/mysqldumpslow.sh
index ccb006f692d..ff82a35ec3f 100644
--- a/scripts/mysqldumpslow.sh
+++ b/scripts/mysqldumpslow.sh
@@ -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";