I\'m getting the following error
#1690 - BIGINT UNSIGNED value is out of range in \'(
legends.spawns.quantity-
I actualy found that question why I was searching for solution. If you have same problem as I do, try disabling "unsigned" parameter.
It is quite possible that your code fails here:
(
quantity - COUNT( game_moblist.spawn_id )
)
because if result of that matematic operation is less than zero it will fail with "unsigned" parameter.