← Back to team overview

maria-developers team mailing list archive

Re: Feature request: Add support for a syntax check for SQL scripts

 

Hi, Sergei,

Zitat von Sergei Golubchik <serg@xxxxxxxxxxxx>:

Hi, Raphael!

On Oct 13, Raphael Vullriede wrote:

For that it would be great to have a feature that checks the script
against a given database without actually executing it. It should not
only check the SQL syntax but also if all mentioned tables, columns
etc.  exists in the given database.

I'm thinking of something like this:

SET DISABLE_EXECUTION="TRUE";

-- here come the sql statements

SET DISABLE_EXECUTION="FALSE";

You will get a similar effect (not exactly the same, but close)
by wrapping your sql statements in

  CREATE PROCEDURE ... BEGIN

  END
  DROP PROCEDURE

your sql wil be parsed, the server will check all mentioned tables,
columns, etc. But nothing will be executed.

Thanks for the hint, I didn't know that! I'll try that, sorry for the noise.

Thanks,
Raphael





References