Bug #66953 | log-warnings does not work in session level | ||
---|---|---|---|
Submitted: | 25 Sep 2012 3:04 | Modified: | 26 Sep 2012 8:50 |
Reporter: | vin chen | Email Updates: | |
Status: | Verified | Impact on me: | |
Category: | MySQL Server: Replication | Severity: | S4 (Feature request) |
Version: | 5.5 | OS: | Any |
Assigned to: | CPU Architecture: | Any | |
Tags: | log-warnings |
[25 Sep 2012 3:04]
vin chen
[25 Sep 2012 20:15]
MySQL Verification Team
a problem with allowing session value is that a user can fill up the partition on which the error log resides, with these useless error messages printed zillions of times.
[25 Sep 2012 20:37]
Peter Laursen
@Shane .. in this case the user actually *disables* 'log_warnings' for the SESSION! So this case is about a user realizing that he may do stupid things (what can easily happen with automated tests executing random-generated statements and similar) and don't want to write garbage entries to the log. Your concern 'turns against you' IMO. Peter (not a MySQL/Oracle person)
[25 Sep 2012 20:52]
Peter Laursen
Just 'philosophicating' :-) This could actually be considered a missing logic in the implementation of GLOBAL|SESSION variables in MySQL: There could be situations where it should be legal to SET the variable to OFF for the session if it is globally ON - but not to set in ON if it is globally OFF (or vice versa - depending on the implementation of the variable in discussion).
[26 Sep 2012 8:50]
MySQL Verification Team
Related discussion: http://bugs.mysql.com/bug.php?id=53466 (end_connection() should reference global_system_variables.log_warnings) Ok, verifying this as a feature request. But still, what if a DBA *really* wants to know if his binlogs/slaves could be broken due to unsafe sql? In this case, I think a SUPER should be the only one to disable it on a session level if it is enabled globally. And always, only SUPER to enable the warnings on session if they are globally disabled. What do you think?
[26 Sep 2012 9:05]
MySQL Verification Team
is this FR still valid for 5.6 ? In 5.6 I see this: " if (log_warnings) "
[26 Sep 2012 9:11]
MySQL Verification Team
log_warnings is global only in 5.6... http://dev.mysql.com/doc/refman/5.6/en/server-options.html#option_mysqld_log-warnings mysql> set session log_warnings=2; ERROR 1229 (HY000): Variable 'log_warnings' is a GLOBAL variable and should be set with SET GLOBAL
[26 Sep 2012 9:11]
Peter Laursen
It is not only a feature request as far as I can see. log-warnings is both and option and both global and session variable. Any user can set session variables. That is how it is documented and how "SET variable" is supposed to work currently. Current behavior contradicts documentation!