-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Cannot deserialize 00:00:00 from MariaDB into time::Time and chrono::NaiveTime #418
Comments
I noticed that the time and chrono type tests have a micro suffix on Line 54 in a2c55b9
None of our |
Poking around blindly in the tests, with test:
(modified from: https://github.com/launchbadge/sqlx/blob/master/tests/mysql/types.rs#L52-L55)
With |
00:00:00
from MariaDB into time::Time and chrono::NaiveTime
00:00:00
from MariaDB into time::Time and chrono::NaiveTime
The culprit does seem to be these |
I was looking at a similar problem with zero dates panicking on decode in #376, I can see if I can fix this too. |
I'm actually sort of surprised this crashes on MariaDB, according to their docs this should have worked. The docs about the encoding differ from the docs on MySQL, which does say something about times with all 0. I'm implementing a fix in #460 because the |
Not sure how to reproduce this, but lets start with what I do know.
Sqlx version:
0.3.5
Sqlx Features:
mysql
,chrono
,time
. [1]Rust toolchain: nightly-2020-06-01
Database:
MariaDB 10.3.18
Column type:
time
Example values:
00:00:00
,02:00:00
Error message:
I receive the above error message any time I try to
query_as
a MariaDBtime
column type into either achrono::NaiveTime
or atime::Time
type. I'm also unsure about a workaround, as I can't seem deserialize thattime
value into aString
,Vec<u8>
or something comparable, either.Thoughts?
[1]: I've used
chrono
andtime
features in combination, as well as individually.The text was updated successfully, but these errors were encountered: