Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
MySQL UDF for validating SQL queries using MySQL server code without executing the sub queries
Fetching latest commit…
Cannot retrieve the latest commit at this time.
|Failed to load latest commit information.|
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