I\'m making a simple tool that will get a string of MySQL commands and run it (on several DB servers sequentially). I trust the users to be sensible, but mistakes happen, and I\
You can temporarily create a stored procedure with your code and unique name.
Then you can drop it immediately. Transactions can't rollback SP creation.
But be careful, because it just syntax validation, so it doesn't check if an object (in your query) exists or not.