My business consists on allowing people to select from a mysql 5.6 innodb table, and I need that a specific user has a restrictions, all his queries against all tables, or one table (they only query one table) are automatically appended “limit=1”. Is there a way to do that? If not, how do I kill the query if it takes more than a limit in time, like “1 sec”.
If you want to modify the queries sent in then your best bet is the MySQL-Proxy.
You can kill queries automatically with pt-kill from Percona Toolkit. We are also adding a query timeout feature to Percona Server for a future release. Otherwise, sorry, MySQL can’t do that.