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

[PATCH] In case of no stdin tty, wrong silent level can be set

    Details

    • Type: Bug
    • Status: In Review
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 10.1, 10.0, 5.5
    • Fix Version/s: 10.1
    • Component/s: Scripts & Clients
    • Labels:
      None
    • Sprint:
      10.1.8-3, 10.1.8-4

      Description

      Note: filed on behalf of Maarten Vanraes / AL13N.

      If you execute silent=1 query in mysql, from a tty or some kind of automated script, the output will be different, because silent will then be 2 instead of 1. This will have the effect of removing column names.

      I postponed the decision for being silent when not using a tty AFTER processing the options, the output of the scripts will be the same, except if you don't add a -s flag, in which case (for historical relevance) it will become silent after all...

      Patch: https://github.com/MariaDB/server/pull/82

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

              Hide
              svoj Sergey Vojtovich added a comment -

              It is documented behavior that batch enables "--silent" and multiple "--silent" produces less output: https://mariadb.com/kb/en/mariadb/mysql-command-line-client/

              This patch makes single "--silent" on a non-tty meaningless.
              This patch also makes "--batch --silent" on a tty to behave differently from "--silent" on a non-tty.

              Sergei Golubchik, could you share your opinion on this?

              Show
              svoj Sergey Vojtovich added a comment - It is documented behavior that batch enables "--silent" and multiple "--silent" produces less output: https://mariadb.com/kb/en/mariadb/mysql-command-line-client/ This patch makes single "--silent" on a non-tty meaningless. This patch also makes "--batch --silent" on a tty to behave differently from "--silent" on a non-tty. Sergei Golubchik , could you share your opinion on this?
              Hide
              serg Sergei Golubchik added a comment -

              Yeah, I can easily imagine that this change would break existing scripts that use mysql --silent.

              AL13N, what is your use case? You have silent=1 in the my.cnf and you see different behavior for batch and interactive? An easy workaround would be to add silent=0 (or disable-silent) before silent=1. That would reset silent, and as a result you'll have identical value of silent both in batch and interactive modes.

              Show
              serg Sergei Golubchik added a comment - Yeah, I can easily imagine that this change would break existing scripts that use mysql --silent . AL13N , what is your use case? You have silent=1 in the my.cnf and you see different behavior for batch and interactive? An easy workaround would be to add silent=0 (or disable-silent ) before silent=1 . That would reset silent , and as a result you'll have identical value of silent both in batch and interactive modes.

                People

                • Assignee:
                  serg Sergei Golubchik
                  Reporter:
                  elenst Elena Stepanova
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  4 Start watching this issue

                  Dates

                  • Created:
                    Updated:

                    Agile