Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for microsecond precision in timestamps #6

Open
jcristovao opened this issue Sep 14, 2013 · 1 comment
Open

Support for microsecond precision in timestamps #6

jcristovao opened this issue Sep 14, 2013 · 1 comment

Comments

@jcristovao
Copy link

Hi,

Since around the end of 2011, both MySql and MariaDB support (optional) microsecond precision on timestamps.

However, mysql-simple currently raises an exception if faced with such values.
Here I propose a way to address this. My main doubt is of course the conversion of TimeOfDay. I guess you choosen (in the original code) to use attoparsec for speed reasons, but my parsec-foo is not so great, and the solution proposed does parse this values correctly. However, a better (faster!) approach would be nice :)

@abbradar
Copy link

Can we merge this solution? I'll add my own doubts: this probably should somehow check if MySQL version is new enough, or queries will fail on old versions. I can't test, however, and maybe old MySQL just ignores the fractional part, which is the best situation. If not, I think there is nothing better than a CPP #ifdef for now.

Regarding using of parseTime instead of attoparsec -- is this acceptable? If not, I can try to make an attoparsec version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants