PHP Question2Answer MySQL query error 1206: The total number of locks exceeds the lock table size - Query: INSERT INTO qa_userpoints (userid, aselecteds, points) VALUES ('986', @_aselecteds:=(SELECT COUNT(*) AS aselecteds FROM qa_posts AS userid_src JOIN qa_posts AS questions ON questions.selchildid=userid_
src.postid WHERE userid_src.userid='986' AND userid_src.type='A' AND NOT (questions.userid<=>userid_src.userid)), 300+(50*@_aselecteds)) ON DUPLICATE KEY UPDATE aselecteds=@_aselecteds, points=300+(5*qposts)+(10*aposts)+(0*cposts)+(5*aselects)+(50*@_aselecteds)+(0*qupvotes)+(-2*qdownvotes)+(0*aupvotes)+(-2*adownvotes)+(1*qvoteds)+(1*avoteds)+(0*upvoteds)+(0*downvoteds)+bonus, referer: http://ww.spaceamigos.com/1949515/voce-ja-aprendeu-a-esperar