fixed some issues about mysql millis losing accuracy and related tests