Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-3775

LP:956585 - Feature request - prevent truncating query in mytop

    Details

    • Type: Task
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Fix Version/s: None
    • Component/s: None

      Description

      Asked by MariaDB user on IRC . He also created a patch for mytop - additional -L option (long queries).

        Gliffy Diagrams

          Attachments

            Activity

            Hide
            wlad Vladislav Vaintroub added a comment -

            Patch for -L option
            LPexportBug956585_mytop-fullqueries.diff

            Show
            wlad Vladislav Vaintroub added a comment - Patch for -L option LPexportBug956585_mytop-fullqueries.diff
            Hide
            wlad Vladislav Vaintroub added a comment -

            Re: Feature request - prevent truncating query in mytop

            Show
            wlad Vladislav Vaintroub added a comment - Re: Feature request - prevent truncating query in mytop
            Hide
            jeanweisbuch Jean Weisbuch added a comment -

            Re: Feature request - prevent truncating query in mytop
            — 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 $mycnf = "$ENV

            {HOME}/.my.cnf";
            +
            +if (-e $mycnf)
            +{
            + my $cfgini = new Config::IniFiles( -file => $mycnf );
            + my @sections = ('client', 'mytop');
            +
            + foreach my $section (@sections) {
            + foreach my $param ($cfgini->Parameters ($section))
            + {
            + $config{$param} = $cfgini->val($section, $param) if exists $config{$param};
            + }
            + }
            + ## map database/password onto db/pass (long version gets precedence in .my.cnf)
            + $config{'db'} = $config{'database'} if $config{'database'};
            + $config{'pass'} = $config{'password'} if $config{'password'};
            +}
            +
            ## Read the user's config file, if it exists.

            my $config = "$ENV{HOME}

            /.mytop";

            Show
            jeanweisbuch Jean Weisbuch added a comment - Re: Feature request - prevent truncating query in mytop — 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 $mycnf = "$ENV {HOME}/.my.cnf"; + +if (-e $mycnf) +{ + my $cfgini = new Config::IniFiles( -file => $mycnf ); + my @sections = ('client', 'mytop'); + + foreach my $section (@sections) { + foreach my $param ($cfgini->Parameters ($section)) + { + $config{$param} = $cfgini->val($section, $param) if exists $config{$param}; + } + } + ## map database/password onto db/pass (long version gets precedence in .my.cnf) + $config{'db'} = $config{'database'} if $config{'database'}; + $config{'pass'} = $config{'password'} if $config{'password'}; +} + ## Read the user's config file, if it exists. my $config = "$ENV{HOME} /.mytop";
            Hide
            jeanweisbuch Jean Weisbuch added a comment -

            Re: Feature request - prevent truncating query in mytop
            Diff patch on #2 allow mytop to read informations from ~/.my.cnf like it does in Debian and Ubuntu packaged versions of mytop so you can replace it directly without having to create a ~/.mytop file to put your connection parameters for example.

            Show
            jeanweisbuch Jean Weisbuch added a comment - Re: Feature request - prevent truncating query in mytop Diff patch on #2 allow mytop to read informations from ~/.my.cnf like it does in Debian and Ubuntu packaged versions of mytop so you can replace it directly without having to create a ~/.mytop file to put your connection parameters for example.
            Hide
            monty Michael Widenius added a comment -

            Re: Feature request - prevent truncating query in mytop
            I have added the original patch to MariaDB 5.3.6
            I have added a different patch to read the my.cnf file that relies on my_print_defaults. This way all options files are read, like with all other MariaDB programs.

            Thanks for the patches!

            Show
            monty Michael Widenius added a comment - Re: Feature request - prevent truncating query in mytop I have added the original patch to MariaDB 5.3.6 I have added a different patch to read the my.cnf file that relies on my_print_defaults. This way all options files are read, like with all other MariaDB programs. Thanks for the patches!
            Hide
            ratzpo Rasmus Johansson added a comment -

            Launchpad bug id: 956585

            Show
            ratzpo Rasmus Johansson added a comment - Launchpad bug id: 956585

              People

              • Assignee:
                monty Michael Widenius
                Reporter:
                wlad Vladislav Vaintroub
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: