Request for Sensor Support of MySQL scripts

Languages available for analysis include PL/SQL and T-SQL.

In our project, we have a number of scripts targeting MySQL 8.0. These have the extension .sql, so scans were (by default) attempting to parse as PL/SQL.

Unfortunately, I wasted a couple of hours trying to understand why code that looked valid and was working was causing parse errors during analysis.

It would be valuable if there were a sensor configured for MySQL syntax. For now, I’ve changed the PL/SQL settings to avoid attempting analysis on .sql files, and I have to rely on manual techniques to ensure quality.

NOTE: I understand that support for MySQL as the storage for SonarQube was dropped a couple of years ago. This request is about the language of the source code to be analyzed.

Hey there.

Is there MySQL syntax that isn’t supported by the T-SQL sensor?

Hi Colin, thanks for the prompt response.

Of course, I should have tried that rather than assuming that a different default extension would imply a different syntax.

Unfortunately, the T-SQL sensor also encounters parse errors, on every single one of our scripts.

We use the \! syntax to run system (shell) commands, often simply an echo statement to provide progress information on the run. This and other ‘mysql client commands’ are documented here: MySQL :: MySQL 8.0 Reference Manual :: mysql Client Commands

Other lines reported as parse errors are:

SET NAMES utf8mb4;
SET foreign_key_checks=1
SET autocommit=0;