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

Placeholder: MySQL fractional seconds in time/datetime #705

Closed
paul-rouse opened this issue Sep 17, 2017 · 4 comments
Closed

Placeholder: MySQL fractional seconds in time/datetime #705

paul-rouse opened this issue Sep 17, 2017 · 4 comments
Assignees

Comments

@paul-rouse
Copy link
Contributor

This is just a placeholder arising from the recent discussions about the test failures caused by MySQL changing its handling of fractional seconds in date/time types (#702 (comment), #693 (comment)).

The idea is that persistent-mysql might move towards using SQL types like datetime(6), now that MySQL itself supports types with fractional seconds (since 5.6.4). Almost certainly an explicit option will be needed to enable this, and possibly a runtime test as well: the behaviour would be changed on those MySQL versions which do support it, and older versions of MySQL, which don't, are still in use (eg "trusty").

It is also an option to do nothing. The documentation could be improved to explain the default behaviour and how it can be modified by using sqltype=....

This issue is here while I am thinking about the options, and to invite comments!

@paul-rouse
Copy link
Contributor Author

I am tending towards the "do nothing" approach, together with a documentation improvement. I think it may be better for the developer to be explicit about the storage types when faced with interrelated considerations including: changing existing application behaviour, migrating existing databases, and whether the application will always run against a MySQL server version which supports fractional seconds.

The downside is that any use of sqltype makes a persistent model less portable between different backends. It is not obvious to me that people will use fractional seconds often enough for this to matter much. However, I think the question is still open...

@psibi
Copy link
Member

psibi commented Sep 20, 2017

It would be nice if you can link this issue on the changelog. Sorry for saying it late.

@paul-rouse
Copy link
Contributor Author

Good point! I'll push an edit

@paul-rouse
Copy link
Contributor Author

Closing as there have been no comments for a month. I have put a note in the documentation (#721).

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