Bug #115503 The sql_log_off parameter is not working as expected at the session level #578
Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
When we modify a session variable, the changes should be reflected in the same session. The new privilege SESSION_VARIABLES_ADMIN controls the setting of certain variables, including sql_log_off. However, even after a user with the SESSION_VARIABLES_ADMIN privilege changes the session value of sql_log_off, the change is not applicable to the session unless the user also has additional admin privileges. To be precise, it appears that we are checking for the SUPER or CONNECTION_ADMIN privilege to turn off logging at the session level.
This change address the issue by allowing users with SESSION_VARIABLES_ADMIN or SYSTEM_VARIABLES_ADMIN privilege to turn off logging at the session level, in addition to users with the SUPER privilege.
This commit fixes the bug https://bugs.mysql.com/bug.php?id=115503
This contribution is under the OCA signed by Amazon and covering submissions to the MySQL project.