-
Notifications
You must be signed in to change notification settings - Fork 2.5k
DATETIME type conversion problem #536
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
Comments
This is due to the conversion not adding the microseconds here https://github.com/felixge/node-mysql/blob/dd921c3dac1c5dc1afbc2149be6d10665973b9f2/lib/protocol/SqlString.js#L95 |
@dougwilson Sorry. I should mention that I'm using mysql 5.6.12. |
Thanks, @chaoran. So that means it would be nice to get this library to include milliseconds in the date stringification (by default? by a switch?). |
@dougwilson, I think it should be added by default. The milliseconds part is harmless because mysql will silently ignore that part if it does not support fraction of time. |
Though MySQL doesn't ignore it, it produces a warning, and when strict is turned on, it will be fatal, which is why it wasn't included in the library before, I think. |
@dougwilson Really? It doesn't complain at all for me.
The |
If the milisecond support could be checked in server info packet on connection, it could be automatically added if supported. But I'm not sure the server does this. |
The date object inserted into database, and what is retrieved from the database is different.
This throws:
AssertionError: "2013-07-11T16:28:26.218Z" == "2013-07-11T16:28:26.000Z"
The text was updated successfully, but these errors were encountered: