fixed mysql case branch