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

planner: the recursive cte will make UPDATE's result wrong #49400

Merged
merged 1 commit into from
Dec 13, 2023

Conversation

winoros
Copy link
Member

@winoros winoros commented Dec 12, 2023

What problem does this PR solve?

Issue Number: close #48969

Problem Summary:

What changed and how does it work?

When we build the recursive CTE, we'll first try to build it as a non-recursive one. And going to treat it as a real recursive one when we actually meet the recursive part.

So the non-recursive part is built twice, but we don't pop the rowid information correctly, causing the UPDATE's result wrong.

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 possible wrong result when the UPDATE/DELETE contains the Recursive CTE.

@ti-chi-bot ti-chi-bot bot added do-not-merge/needs-triage-completed release-note Denotes a PR that will be considered when it comes time to generate release notes. labels Dec 12, 2023
@ti-chi-bot ti-chi-bot bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. needs-cherry-pick-release-5.4 Should cherry pick this PR to release-5.4 branch. needs-cherry-pick-release-6.1 Should cherry pick this PR to release-6.1 branch. needs-cherry-pick-release-6.5 Should cherry pick this PR to release-6.5 branch. needs-cherry-pick-release-7.1 Should cherry pick this PR to release-7.1 branch. needs-cherry-pick-release-7.5 Should cherry pick this PR to release-7.5 branch. and removed do-not-merge/needs-triage-completed labels Dec 12, 2023
Copy link

codecov bot commented Dec 12, 2023

Codecov Report

Merging #49400 (2dd7615) into master (7c58082) will increase coverage by 0.6856%.
Report is 14 commits behind head on master.
The diff coverage is 100.0000%.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #49400        +/-   ##
================================================
+ Coverage   71.0510%   71.7367%   +0.6856%     
================================================
  Files          1368       1417        +49     
  Lines        401590     421572     +19982     
================================================
+ Hits         285334     302422     +17088     
- Misses        96424     100253      +3829     
+ Partials      19832      18897       -935     
Flag Coverage Δ
integration 44.3523% <100.0000%> (?)
unit 71.0510% <ø> (ø)

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

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

@ti-chi-bot ti-chi-bot bot added approved needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Dec 13, 2023
Copy link

ti-chi-bot bot commented Dec 13, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: AilinKid, time-and-fate

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:
  • OWNERS [AilinKid,time-and-fate]

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 Dec 13, 2023
Copy link

ti-chi-bot bot commented Dec 13, 2023

[LGTM Timeline notifier]

Timeline:

  • 2023-12-13 09:33:23.214392953 +0000 UTC m=+435094.251619890: ☑️ agreed by AilinKid.
  • 2023-12-13 12:20:24.799386368 +0000 UTC m=+445115.836613295: ☑️ agreed by time-and-fate.

@winoros
Copy link
Member Author

winoros commented Dec 13, 2023

/retest

@ti-chi-bot ti-chi-bot bot merged commit 421aee1 into pingcap:master Dec 13, 2023
@ti-chi-bot
Copy link
Member

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

@ti-chi-bot
Copy link
Member

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

ti-chi-bot pushed a commit to ti-chi-bot/tidb that referenced this pull request Dec 13, 2023
@ti-chi-bot
Copy link
Member

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

@ti-chi-bot
Copy link
Member

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

ti-chi-bot pushed a commit to ti-chi-bot/tidb that referenced this pull request Dec 13, 2023
@ti-chi-bot
Copy link
Member

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

ti-chi-bot pushed a commit to ti-chi-bot/tidb that referenced this pull request Dec 13, 2023
@winoros winoros deleted the issue48969 branch December 13, 2023 16:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm needs-cherry-pick-release-5.4 Should cherry pick this PR to release-5.4 branch. needs-cherry-pick-release-6.1 Should cherry pick this PR to release-6.1 branch. needs-cherry-pick-release-6.5 Should cherry pick this PR to release-6.5 branch. needs-cherry-pick-release-7.1 Should cherry pick this PR to release-7.1 branch. needs-cherry-pick-release-7.5 Should cherry pick this PR to release-7.5 branch. 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
4 participants