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 issue of incorrect result when handling unary minus for time #52811

Merged
merged 5 commits into from Apr 23, 2024

Conversation

solotzg
Copy link
Contributor

@solotzg solotzg commented Apr 22, 2024

What problem does this PR solve?

Issue Number: close #52262

Problem Summary:

  • func (c *unaryMinusFunctionClass) getFunction doesn't set decimal represent info for time type expression.

What changed and how does it work?

  • Cast time type expression into decimal in func (c *unaryMinusFunctionClass) getFunction .

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

Please refer to Release Notes Language Style Guide to write a quality release note.

Fix the issue of incorrect result when handling unary minus for time

Signed-off-by: TONG, Zhigao <tongzhigao@pingcap.com>
1
Signed-off-by: TONG, Zhigao <tongzhigao@pingcap.com>
@ti-chi-bot ti-chi-bot bot added do-not-merge/needs-triage-completed do-not-merge/invalid-title release-note size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Apr 22, 2024
Copy link

tiprow bot commented Apr 22, 2024

Hi @solotzg. Thanks for your PR.

PRs from untrusted users cannot be marked as trusted with /ok-to-test in this repo meaning untrusted PR authors can never trigger tests themselves. Collaborators can still trigger tests on the PR using /test all.

I understand the commands that are listed here.

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/test-infra repository.

@solotzg solotzg changed the title Fix the issue of incorrect result when handling unary minus for time expression: fix the issue of incorrect result when handling unary minus for time Apr 22, 2024
Copy link

codecov bot commented Apr 22, 2024

Codecov Report

Merging #52811 (962b6b5) into master (42d58b5) will increase coverage by 3.0595%.
Report is 2 commits behind head on master.
The diff coverage is 100.0000%.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #52811        +/-   ##
================================================
+ Coverage   72.3805%   75.4400%   +3.0595%     
================================================
  Files          1477       1474         -3     
  Lines        427995     422501      -5494     
================================================
+ Hits         309785     318735      +8950     
+ Misses        98964      84025     -14939     
- Partials      19246      19741       +495     
Flag Coverage Δ
integration 49.2904% <70.0000%> (?)
tiprow_ft ?
unit 71.1873% <100.0000%> (-0.0633%) ⬇️

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

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

@solotzg
Copy link
Contributor Author

solotzg commented Apr 22, 2024

/cc @XuHuaiyu @wshwsh12

@ti-chi-bot ti-chi-bot bot requested review from wshwsh12 and XuHuaiyu April 22, 2024 10:00
Signed-off-by: TONG, Zhigao <tongzhigao@pingcap.com>
2
Signed-off-by: TONG, Zhigao <tongzhigao@pingcap.com>
@solotzg
Copy link
Contributor Author

solotzg commented Apr 23, 2024

/cc @guo-shaoge

@ti-chi-bot ti-chi-bot bot requested a review from guo-shaoge April 23, 2024 06:21
Copy link

ti-chi-bot bot commented Apr 23, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: guo-shaoge, XuHuaiyu

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

Copy link

ti-chi-bot bot commented Apr 23, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-04-23 06:04:04.363301305 +0000 UTC m=+67401.103204213: ☑️ agreed by XuHuaiyu.
  • 2024-04-23 09:46:18.906305466 +0000 UTC m=+80735.646208377: ☑️ agreed by guo-shaoge.

Copy link

tiprow bot commented Apr 23, 2024

@solotzg: 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
tidb_parser_test 6bc0d90 link true /test tidb_parser_test

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/test-infra repository. I understand the commands that are listed here.

@solotzg
Copy link
Contributor Author

solotzg commented Apr 23, 2024

/test tidb_parser_test

Copy link

ti-chi-bot bot commented Apr 23, 2024

@solotzg: The specified target(s) for /test were not found.
The following commands are available to trigger required jobs:

  • /test build
  • /test check-dev
  • /test check-dev2
  • /test mysql-test
  • /test pull-br-integration-test
  • /test pull-integration-ddl-test
  • /test pull-lightning-integration-test
  • /test pull-mysql-client-test
  • /test unit-test

The following commands are available to trigger optional jobs:

  • /test canary-notify-when-compatibility-sections-changed
  • /test pingcap/tidb/canary_ghpr_unit_test
  • /test pull-common-test
  • /test pull-e2e-test
  • /test pull-integration-common-test
  • /test pull-integration-copr-test
  • /test pull-integration-jdbc-test
  • /test pull-integration-mysql-test
  • /test pull-integration-nodejs-test
  • /test pull-sqllogic-test
  • /test pull-tiflash-test

Use /test all to run the following jobs that were automatically triggered:

  • pingcap/tidb/ghpr_build
  • pingcap/tidb/ghpr_check
  • pingcap/tidb/ghpr_check2
  • pingcap/tidb/ghpr_mysql_test
  • pingcap/tidb/ghpr_unit_test
  • pingcap/tidb/pull_integration_ddl_test
  • pingcap/tidb/pull_mysql_client_test

In response to this:

/test tidb_parser_test

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/test-infra repository.

Copy link

tiprow bot commented Apr 23, 2024

@solotzg: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

In response to this:

/test tidb_parser_test

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/test-infra repository.

@solotzg
Copy link
Contributor Author

solotzg commented Apr 23, 2024

/test unit-test

Copy link

tiprow bot commented Apr 23, 2024

@solotzg: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

In response to this:

/test unit-test

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/test-infra repository.

@ti-chi-bot ti-chi-bot bot merged commit 0931309 into pingcap:master Apr 23, 2024
21 checks passed
@solotzg solotzg deleted the fix-52262 branch April 23, 2024 12:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm release-note 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.

Unexpected values appeared in select query statements that should logically imply each other
3 participants