Updated dialect with mysql logic