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

domain: do not use fmt.Sprint to format SQL #49620

Merged
merged 5 commits into from Dec 21, 2023

Conversation

hi-rustin
Copy link
Member

@hi-rustin hi-rustin commented Dec 20, 2023

What problem does this PR solve?

Issue Number: close #49619

Problem Summary:

What changed and how does it work?

https://github.com/pingcap/tidb/blob/master/pkg/domain/plan_replayer.go#L169

We use fmt.Sprintf here. But this would generate an invalid SQL if the user's SQL contains a '.

So I added a test case to cover it and also fixed it by using the %? syntax.

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.

None

Signed-off-by: hi-rustin <rustin.liu@gmail.com>
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
Copy link
Member Author

@hi-rustin hi-rustin left a comment

Choose a reason for hiding this comment

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

🔢 Self-check

@hi-rustin hi-rustin added the sig/planner SIG: Planner label Dec 20, 2023
Copy link

codecov bot commented Dec 20, 2023

Codecov Report

Merging #49620 (5b5bcdd) into master (da460f1) will increase coverage by 0.4327%.
Report is 11 commits behind head on master.
The diff coverage is 18.7500%.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #49620        +/-   ##
================================================
+ Coverage   70.9801%   71.4128%   +0.4326%     
================================================
  Files          1368       1423        +55     
  Lines        398761     418754     +19993     
================================================
+ Hits         283041     299044     +16003     
- Misses        95945     100860      +4915     
+ Partials      19775      18850       -925     
Flag Coverage Δ
integration 44.1392% <18.7500%> (?)
unit 70.9813% <ø> (+0.0012%) ⬆️

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

Components Coverage Δ
dumpling 53.9663% <ø> (ø)
parser ∅ <ø> (∅)
br 47.1060% <ø> (-5.7766%) ⬇️

Signed-off-by: hi-rustin <rustin.liu@gmail.com>
Copy link

ti-chi-bot bot commented Dec 21, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: lance6716, zimulala

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 Dec 21, 2023

[LGTM Timeline notifier]

Timeline:

  • 2023-12-21 02:48:40.913709617 +0000 UTC m=+1102011.950936544: ☑️ agreed by zimulala.
  • 2023-12-21 03:55:01.188366763 +0000 UTC m=+1105992.225593691: ☑️ agreed by lance6716.

@ti-chi-bot ti-chi-bot bot merged commit 11aefee into pingcap:master Dec 21, 2023
17 checks passed
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-7.5: #49649.

ti-chi-bot pushed a commit to ti-chi-bot/tidb that referenced this pull request Dec 21, 2023
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
@hi-rustin hi-rustin deleted the rustin-patch-replayer branch December 21, 2023 06:27
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-7.1: #49657.

ti-chi-bot pushed a commit to ti-chi-bot/tidb that referenced this pull request Dec 21, 2023
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
ti-chi-bot bot pushed a commit that referenced this pull request Feb 1, 2024
ti-chi-bot bot pushed a commit that referenced this pull request Feb 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TiDB can not record replayer stats correcly
4 participants