fixed Issue 1500:MySQL driver unable to handle IntegrityError, thanks wheresgatsby