fix a long outstanding bug vs. MySQL