fix mysql cast issue