Feature request - prevent truncating query in mytop
Bug #956585 reported by
Vladislav Vaintroub
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
MariaDB |
Fix Released
|
Wishlist
|
Michael Widenius |
Bug Description
Asked by MariaDB user on IRC . He also created a patch for mytop - additional -L option (long queries).
Related branches
Changed in maria: | |
assignee: | nobody → Michael Widenius (monty) |
Changed in maria: | |
status: | In Progress → Fix Released |
To post a comment you must log in.
--- mytop.sh 2012-03-16 00:53:10.418317632 +0100
+++ mytop.sh 2012-03-16 19:20:15.251143868 +0100
@@ -15,6 +15,7 @@
use 5.005;
use strict;
use DBI;
+use Config::IniFiles;
use Getopt::Long;
use Socket;
use List::Util qw(min max);
@@ -75,7 +76,7 @@
my %config = (
batchmode => 0,
color => 1,
- db => 'test',
+ db => '',
delay => 5,
filter_user => qr/.?/,
filter_db => qr/.?/,
@@ -113,6 +114,26 @@
my $RM_RESET = 0;
my $RM_NOBLKRD = 3; ## using 4 traps Ctrl-C :-(
+## Try ~/.my.cnf first /.my.cnf" ; >Parameters ($section)) >val($section, $param) if exists $config{$param}; 'database' }; 'password' };
+
+my $mycnf = "$ENV{HOME}
+
+if (-e $mycnf)
+{
+ my $cfgini = new Config::IniFiles( -file => $mycnf );
+ my @sections = ('client', 'mytop');
+
+ foreach my $section (@sections) {
+ foreach my $param ($cfgini-
+ {
+ $config{$param} = $cfgini-
+ }
+ }
+ ## map database/password onto db/pass (long version gets precedence in .my.cnf)
+ $config{'db'} = $config{'database'} if $config{
+ $config{'pass'} = $config{'password'} if $config{
+}
+
## Read the user's config file, if it exists.
my $config = "$ENV{HOME} /.mytop" ;