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

SimpleExpr::Constant conversion to string drops second fractions #808

Open
davidhewitt opened this issue Aug 20, 2024 · 0 comments
Open

Comments

@davidhewitt
Copy link

Looking at

#[cfg(feature = "with-chrono")]
Value::ChronoDateTimeUtc(Some(v)) => {
write!(s, "'{}'", v.format("%Y-%m-%d %H:%M:%S %:z")).unwrap()
}
#[cfg(feature = "with-chrono")]
Value::ChronoDateTimeLocal(Some(v)) => {
write!(s, "'{}'", v.format("%Y-%m-%d %H:%M:%S %:z")).unwrap()
}
#[cfg(feature = "with-chrono")]
Value::ChronoDateTimeWithTimeZone(Some(v)) => {
write!(s, "'{}'", v.format("%Y-%m-%d %H:%M:%S %:z")).unwrap()
}

I think these format strings don't account for second fractions. I hit a case where I was trying to feed constant date-times into a query and the microseconds were getting dropped, I believe the cause was in these lines.

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

1 participant