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

Ensure DB schema uses microsecond precision #4647

Open
julen opened this issue Apr 15, 2016 · 0 comments
Open

Ensure DB schema uses microsecond precision #4647

julen opened this issue Apr 15, 2016 · 0 comments

Comments

@julen
Copy link
Contributor

julen commented Apr 15, 2016

MySQL versions prior to 5.6.4 didn't support microsecond precision, and whenever microseconds were specified, these were ignored. Versions 5.6.4+ support microsecond precision fine, with an important gotcha though: if the DB schema didn't define microsecond precision (datetime(0), default for <5.6.4), passing microseconds will result in rounding.
I.e. a datetime such as 2016-03-31 23:59:59.999999 would be stored as 2016-04-01 00:00:00.000000

This is a MySQL bug (68760) which can easily make people shoot themselves in the foot, and can (in some edge cases, critically) affect Pootle installations which were created in older versions of MySQL, then upgraded to 5.6.4+, but didn't adjust the underlying DB schema to enable support for microseconds.

We should have some check/data migration which ensures installations using 5.6.4+ have the correct schema definition. Note new installations are not affected by this.

@phlax phlax added this to the 2.8.1 milestone Apr 21, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants