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

fix(mysql): don't print milliseconds if date precision is 0 #15838

Merged
merged 4 commits into from
Mar 24, 2023
Merged

Conversation

ephys
Copy link
Member

@ephys ephys commented Mar 24, 2023

Pull Request Checklist

  • Have you added new tests to prevent regressions?
  • If a documentation update is necessary, have you opened a PR to the documentation repository?
  • Did you update the typescript typings accordingly (if applicable)?
  • Does the description below contain a link to an existing issue (Closes #[issue]) or a description of the issue you are solving?
  • Does the name of your PR follow our conventions?

Description Of Change

This PR is an updated version of PR #13145

Looks like the bug was fixed, so I only added a regression test

Closes #13145
Closes #12717

@ephys ephys requested a review from a team March 24, 2023 10:12
@ephys
Copy link
Member Author

ephys commented Mar 24, 2023

Interesting that it was fixed for mssql but not mysql

It was caused by us comparing a date without milliseconds in the database to a date with milliseconds in the query

It's not truly fixed, because the same problem will occur for precision 1 & 2, but due to a bug in dayjs, I have not fixed that yet

Alternatively we could drop dayjs.format here, and format things ourselves

@ephys ephys changed the title meta: add regression test for #12717 fix(mysql): don't print milliseconds if date precision is 0 Mar 24, 2023
WikiRik
WikiRik previously approved these changes Mar 24, 2023
Copy link
Member

@WikiRik WikiRik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Implementing my suggestion is optional, we can also fix it when we migrate this test suite to TS

packages/core/test/integration/instance/update.test.js Outdated Show resolved Hide resolved
Co-authored-by: Rik Smale <13023439+WikiRik@users.noreply.github.com>
@ephys ephys merged commit 551e7ef into main Mar 24, 2023
@ephys ephys deleted the ephys/pr-13145 branch March 24, 2023 12:53
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

Successfully merging this pull request may close these issues.

Model instance.update does not bind where parameters according to field type
2 participants