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

mytop does not honor settings from ~/.mytop if there is ~/.my.cnf

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Minor
    • Resolution: Unresolved
    • 10.2.22, 10.3.12
    • 10.4
    • Scripts & Clients

    Description

      FreeBSD packages didn't install mytop in versions before 10.3 and I was using mytop as a standalone package for the last 10+ years without any issues. Right after the upgrade from MariaDB 10.1 to 10.3 (and to bundled mytop) it doesn't work anymore. The problem is I have dedicated user account "mytop" specified in ~/.mytop and some other settings in ~/.my.cnf where password for another user account is stored too. MariaDB's version of mytop reads settings from ~/.my.cnf and uses them (different password) for mytop instead of settings from ~/.mytop so mytop cannot connect to database and settings cannot be overridden on commandline too.

      I found that MariaDB's version implemented reading of ~/.my.cnf few years ago but it does not work as it should.

      from manpage:
      mytop will first read the [client] and [mytop] sections from your my.cnf
      files. After that it will read the ("~/.mytop") file from your home
      directory (if present). These are read before any of your command-line
      arguments are processed, so your command-line arguments will override
      directives in the config file.

      I am not a Perl programmer but I tried to fix it and it works for me now (see attached patch).
      I moved around the code for reading ~/.my.cnf and the way ~/.mytop is processed. Now all 3 kinds of configuration parameters are in ARGV and processed in correct order:
      1) ~/.my.cnf (actually "my_print_defaults client mytop")
      2) ~/.mytop
      3) command line options

      The later overrides value of earlier options.
      Now everything works for me as before the upgrade.

      Attachments

        Activity

          People

            Unassigned Unassigned
            Lachman Miroslav Lachman
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.