Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local tokenizer = require("proxy.tokenizer")
- function read_query( packet )
- if string.byte(packet) == proxy.COM_QUERY then
- local query = string.sub(packet, 2)
- local tokens = tokenizer.tokenize(query)
- if #tokens >= 1 and tokens[1].token_name == 'TK_LITERAL' then
- local command = string.lower(tokens[1].text)
- if command == 'sleep' then
- if #tokens == 2 then
- local sleep_time = tonumber(tokens[2].text)
- os.execute("sleep " .. sleep_time)
- proxy.response.type = proxy.MYSQLD_PACKET_OK
- proxy.response.resultset = {
- fields = {
- { type = proxy.MYSQL_TYPE_LONG, name="sleep_time", },
- },
- rows = {
- { sleep_time },
- }
- }
- return proxy.PROXY_SEND_RESULT
- end
- end
- end
- end
- end
- function read_query_result(inj)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement