I think the SQL_MODE setting is a sort-of good idea, but that the
implementation of it is useless, more or less. What I would want
from a feature like this is to allow me to control the quality of
the data in the database, but that is not what SQL_MODE does,
regrettably.
Rather, what SQL_MODE does is define a default quality checking
level for an individual session. This is NOT the same thing as
guaranteeing that data has certain qualities in the
database.
- To begin with, a specific session can change it. If you want to insert an invalid data, just set SQL_MODE=ALLOW_INVALID_DATES and go ahead and insert.
- Secondly, setting this to a non-default value requires no specific privileges at all!
- Thirdly, as anyone can bypass these checks, you would assume that there was a way to check afterwards that data follows a specific SQL_MODE, or at least a function that I could apply to a table or column …