[MDEV-6767] mysqladmin returns success and doesnt output an error message when a logs flushing query fails Created: 2014-09-23 Updated: 2022-09-08 |
|
| Status: | Open |
| Project: | MariaDB Server |
| Component/s: | None |
| Affects Version/s: | 5.5.39, 10.0.13 |
| Fix Version/s: | 5.5 |
| Type: | Bug | Priority: | Minor |
| Reporter: | Jean Weisbuch | Assignee: | Unassigned |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | logging, mysqladmin, upstream | ||
| Environment: |
Debian Wheezy amd64 |
||
| Description |
|
The logs flushing commands of mysqladmin are issuing queries on the server such as "FLUSH LOGS;" but only display an error message on STDOUT/STDERR and return an error code if the query cannot be issued, not if the query itself returns an error. The problem could also be present for other commands of mysqladmin. –
Running "mysqladmin flush-slow-log" doesnt return an error code and no error message on STDOUT or STDERR, the only way to know that something went wrong is to check what mysqld logged :
Expected result : nb: the error log is set to syslog on the example server. |
| Comments |
| Comment by Elena Stepanova [ 2014-09-23 ] | ||||||||||||||||||||||||||
|
It prints the error just fine to me:
Did you run a "clean" test – that is, after trying FLUSH SLOW LOGS via the client, did you made the log file writable, enabled slow_query_log again, and only then tried mysqladmin? | ||||||||||||||||||||||||||
| Comment by Jean Weisbuch [ 2014-09-23 ] | ||||||||||||||||||||||||||
|
You are right, i must have forgot to re-set slow_query_log_file or slow_query_log at the right time. Anyway, the value of slow_query_log should be set to 0 when the server is disabling it as it looks like the logging is active when it is not and make the FLUSH LOGS check again if it could open the file because the query will return success while it wont start to log again even if it could :
| ||||||||||||||||||||||||||
| Comment by Elena Stepanova [ 2014-09-23 ] | ||||||||||||||||||||||||||
|
I agree the whole thing is rather confusing. On top of slow_query_log=1 when it's in fact disabled, the error message that the server prints into the log is not true. It says:
But it is not so. If we fix the problem with the log, in this case permissions, and run SET GLOBAL slow_query_log=1 (yes, even though it is already 1), the slow logging gets enabled again. It's an upstream issue, do you want to report it at bugs.mysql.com? | ||||||||||||||||||||||||||
| Comment by Jean Weisbuch [ 2014-09-30 ] | ||||||||||||||||||||||||||
|
I created the bug report on the MySQL tracker : http://bugs.mysql.com/bug.php?id=74145 |