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