fixes #6496 prevent mysql error