Details
-
New Feature
-
Status: Open (View Workflow)
-
Minor
-
Resolution: Unresolved
-
None
-
None
Description
Users migrating large codebases, and/or wanting to take advantage of stricter sql_modes to enforce cleaner data/sql, face a testing challenge if they haven't got full tests for the application.
What they hope for a non-fatal record of SQL statements that would have otherwise caused an error.
Since MDEV-7389 was implemented warnings that a user SQL statement received can be logged by the sq_log_err plugin.
What would be ideal is a new system variable sql_mode_to_warning to mirror the sql_mode variable of settings that would otherwise case an error. When that mode is also set in sql_mode_to_warning, rather than a SQL error, a SQL warning is generated.
There are a number of non-error generating sql_mode setting sql_mode_to_warning need not have an has no effect on.
All sql_mode settings like the following will cause errors where there previously was no error: ERROR_FOR_DIVISION_BY_ZERO, NO_AUTO_CREATE_USER, NO_ZERO_DATE, NO_ZERO_IN_DATE, ONLY_FULL_GROUP_BY, STRICT_*.
ALLOW_INVALID_DATES is a notable one where the logic is inverted, that setting this sql_mode prevents an error. Having a sql_mode_warnings=DISABLE_ALLOW_INVALID_DATES might be a way to handle this as an optional extension to the previous behaviour.
Attachments
Issue Links
- is duplicated by
-
MDEV-35572 sql_mode errors to warnings
-
- Closed
-