[MDEV-8435] [PATCH] In case of no stdin tty, wrong silent level can be set Created: 2015-07-08  Updated: 2015-11-11  Resolved: 2015-11-11

Status: Closed
Project: MariaDB Server
Component/s: Scripts & Clients
Affects Version/s: 5.5, 10.0, 10.1
Fix Version/s: N/A

Type: Bug Priority: Major
Reporter: Elena Stepanova Assignee: Sergei Golubchik
Resolution: Won't Fix Votes: 0
Labels: None

Sprint: 10.1.8-3, 10.1.8-4, 10.1.9-3

 Description   

Note: filed on behalf of maartenvanraes / alien.

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



 Comments   
Comment by Sergey Vojtovich [ 2015-09-28 ]

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.

serg, could you share your opinion on this?

Comment by Sergei Golubchik [ 2015-10-03 ]

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

alien, 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.

Generated at Thu Feb 08 07:27:08 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.