icingadb
icingadb copied to clipboard
MySQL/MariaDB: Use strict SQL mode instead of just ANSI_QUOTES
This PR
- introduces
Quoter
that provides utility functions for quoting table names and columns, where the quotation mark depends on the database driver used - and replaces the
ANSI_QUOTES
SQL mode withTRADITIONAL
which enables strict mode.
Previously, setting ANSI_QUOTES
overrode the server defaults, which were most likely stricter. Also Vitess, which will be supported in the near future, does not support ANSI_QUOTES
.
refs #606
I mean the missing of strict mode is not really bug in itself. Enabling it, at best, changes nothing, at worst, it exposes other bugs. In doubt, exposing would mean crashing the Icinga DB process. So better just do this as a whole in 1.2.0.
#699 sets TRADITIONAL
in addition to ANSI_QUOTES
to enable strict mode, while this PR eliminates the latter by introducing driver-specific quoting. I've removed this PR from the next release and will leave it open until we decide whether to support Vitess, which would be the only reason to change quoting.
This PR
- introduces
Quoter
that provides utility functions for quoting table names and columns, where the quotation mark depends on the database driver used- and replaces the
ANSI_QUOTES
SQL mode withTRADITIONAL
which enables strict mode.
Accidentally disabling strict mode was already fixed in #699
So only the other point remains which seems to only be relevant if we'd want to so support Vitess (#606).
I doubt that these changes will be necessary in the near future, so I am closing this PR.