Bug #84688 Ban change sql_mode on session level
Submitted: 26 Jan 2017 19:52
Reporter: Aleksey Filippov Email Updates:
Status: Open Impact on me:
Category:MySQL Server: General Severity:S4 (Feature request)
Version:5.7 OS:Any
Assigned to: CPU Architecture:Any
Tags: ban, session variables

[26 Jan 2017 19:52] Aleksey Filippov
Global variable sql_mode set to STRICT_ALL_TABLES(mysqld.cnf).
But someone changes this variable on session level, and from time to time we have problem with data in our database.
And there is no ability to ban changing sql_mode on session level.
It could be good decision to have some mysqld.cnf parameter(global variable) than allow to ban changing sql_mode on session level.
Actually, great decision is to have ability to ban setting session variables listed in some global variable.

How to repeat:
set global sql_mode to STRICT_ALL_TABLES.
connect to mysql.
set session sql_mode to other value.
now you can damage data inside database.
[8 Feb 2017 20:49] Morgan Tocker
See also: http://mysqlserverteam.com/feedback-request-enforcing-sql-mode/