Guest User

Untitled

a guest
Feb 15th, 2019
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. START TRANSACTION;
  2. SELECT @id := id, ip, port, type FROM ip WHERE (isnull(get_time) or get_time < now() - interval 24 hour) and status = 'new' and (SELECT count(*) FROM acc_reg WHERE ip = ip.ip and ban = 1) = 0 ORDER BY get_time LIMIT 1 FOR UPDATE;
  3. UPDATE ip SET get_time = now() WHERE id = @id;
  4. COMMIT;
Add Comment
Please, Sign In to add comment