Skip to content

MySQL UDF for validating SQL queries using MySQL server code without executing the sub queries

License

Notifications You must be signed in to change notification settings

adrpar/mysql_validateSQL

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This UDF exposes some of the SQL parsing and validation routines of
MySQL to the outside world. It basically enables you to parse and validate
a query, without being executed (similar to prepared statements... maybe
we should have used those?? hmm...).

At the moment, only SELECT, CREATE TABLE, DROP and ALTER (partially) are
supported. Further options need to be implemented... Queries are parsed
as multi-queries.

UDF returns NULL if no error is found or the MySQL internal error message.

WARNING: IT COULD BE THAT THIS UDF HAS UNKNOWN SIDE EFFECTS ON YOUR SERVER!
IT COULD BRING THE SERVER TO A CRASH, OR WORSE, BLOW THE WHOLE THING UP!
YOU HAVE BEEN WARNED! WE DON'T TAKE ANY RESPONSIBILITY FOR THIS. IT IS YOUR
PROBLEM IF YOU JUST INGEST SOME RANDOM CODE FOUND ON THE INTERNET INTO A 
SERVER DAEMON...

To install
----------

1) Download the mysql source corresponding to your installed
   version. Building mysql from scratch is recommended.

   Note: ONLY MYSQL VERSION 5.5 AND ABOVE ARE CURRENTLY 
   	 SUPPORTED

2) edit CMakeList.txt accordingly to point to the directory 
   where mysql is installed.

3) edit CMakeList.txt accordingly to point to the directory
   of the mysql sources

4) mkdir build
   cd build

5) cmake ..

6) make

7) make install

8) log into mysql server as root and execute the commands in 
   install_validateSQL.sql

About

MySQL UDF for validating SQL queries using MySQL server code without executing the sub queries

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published