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

expression: fix the fsp of casting json as datetime/duration #53535

Merged
merged 1 commit into from
May 25, 2024

Conversation

YangKeao
Copy link
Member

What problem does this PR solve?

Issue Number: close #53352

Problem Summary:

When casting json as datetime/duration, the fsp of target type is not obeyed.

This PR is split from #53363, because #53363 will be held for a while (as long as MySQL didn't confirm the behavior on JSON implicit cast). This one is a pure/simple bug fix, so it can be merged at first.

What changed and how does it work?

Follow the configuration of the return type to set the correct fsp. This PR didn't remove the original GetTime function, but just mark it as deprecated, because there are still many usages inside the json itself.

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No need to test
    • I checked and no code files have been changed.

Side effects

  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Breaking backward compatibility

Documentation

  • Affects user behaviors
  • Contains syntax changes
  • Contains variable changes
  • Contains experimental features
  • Changes MySQL compatibility

Release note

Fix the issue that casting json as time or duration will drop the fractional part.

@ti-chi-bot ti-chi-bot bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels May 24, 2024
@YangKeao YangKeao requested review from zanmato1984 and xhebox May 24, 2024 06:19
@ti-chi-bot ti-chi-bot bot added approved needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels May 24, 2024
Copy link

codecov bot commented May 24, 2024

Codecov Report

Attention: Patch coverage is 87.50000% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 74.7153%. Comparing base (6928519) to head (07fadad).
Report is 18 commits behind head on master.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #53535        +/-   ##
================================================
+ Coverage   72.5278%   74.7153%   +2.1874%     
================================================
  Files          1505       1505                
  Lines        429901     432112      +2211     
================================================
+ Hits         311798     322854     +11056     
+ Misses        98809      89340      -9469     
- Partials      19294      19918       +624     
Flag Coverage Δ
integration 49.1438% <62.5000%> (?)
unit 71.3800% <87.5000%> (-0.0459%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
dumpling 53.9957% <ø> (ø)
parser ∅ <ø> (∅)
br 50.4028% <ø> (+8.9988%) ⬆️

Copy link

tiprow bot commented May 24, 2024

@YangKeao: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
fast_test_tiprow 07fadad link true /test fast_test_tiprow

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

Copy link

ti-chi-bot bot commented May 25, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: xhebox, zanmato1984

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot bot added lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels May 25, 2024
Copy link

ti-chi-bot bot commented May 25, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-05-24 06:30:41.395297472 +0000 UTC m=+2412395.152433045: ☑️ agreed by zanmato1984.
  • 2024-05-25 04:26:37.038206882 +0000 UTC m=+2491350.795342454: ☑️ agreed by xhebox.

@ti-chi-bot ti-chi-bot bot merged commit 45318da into pingcap:master May 25, 2024
22 of 23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm release-note Denotes a PR that will be considered when it comes time to generate release notes. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cast json to datetime didn't have a correct fsp
3 participants