icingadb icon indicating copy to clipboard operation
icingadb copied to clipboard

MySQL/MariaDB: Use strict SQL mode instead of just ANSI_QUOTES

Open lippserd opened this issue 1 year ago • 3 comments

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 with TRADITIONAL 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

lippserd avatar Jul 31 '23 14:07 lippserd

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.

julianbrost avatar Aug 01 '23 13:08 julianbrost

#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.

lippserd avatar Mar 18 '24 09:03 lippserd

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 with TRADITIONAL 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).

julianbrost avatar Jul 31 '24 08:07 julianbrost

I doubt that these changes will be necessary in the near future, so I am closing this PR.

lippserd avatar Oct 02 '24 08:10 lippserd