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/core: fix a wrong privilege check for CTE & UPDATE statement #57430

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

bb7133
Copy link
Member

@bb7133 bb7133 commented Nov 15, 2024

What problem does this PR solve?

Issue Number: close #53490

Problem Summary:

What changed and how does it work?

See #53490 (comment), for statement like:

with t_f as (
         select id,pid,name,'AAA' fullname from test.tt1 )
         update test.tt1 inner join t_f
         set tt1.fullname=t_f.fullname
         where tt1.id=t_f.id;

The privilege check for CTE in the update statement should be avoided.

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

Therocially it consumes more CPU to remove the privilege check, but I believe the real world performance will not be impacted.

Documentation

  • NA

Release note

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

Fix a wrong privilege check when using the `UPDATE` statement with CTE

@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. do-not-merge/needs-triage-completed sig/planner SIG: Planner size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed do-not-merge/needs-triage-completed labels Nov 15, 2024
Copy link

codecov bot commented Nov 16, 2024

Codecov Report

Attention: Patch coverage is 83.33333% with 1 line in your changes missing coverage. Please review.

Project coverage is 73.4466%. Comparing base (ef8cac2) to head (f1bbb79).
Report is 1 commits behind head on master.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #57430        +/-   ##
================================================
+ Coverage   72.8597%   73.4466%   +0.5868%     
================================================
  Files          1672       1672                
  Lines        462630     462672        +42     
================================================
+ Hits         337071     339817      +2746     
+ Misses       104795     102130      -2665     
+ Partials      20764      20725        -39     
Flag Coverage Δ
integration 43.4894% <83.3333%> (?)
unit 72.2566% <83.3333%> (+0.0081%) ⬆️

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

Components Coverage Δ
dumpling 52.7673% <ø> (ø)
parser ∅ <ø> (∅)
br 45.1379% <ø> (+0.0122%) ⬆️

Copy link

ti-chi-bot bot commented Nov 16, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: hawkingrei

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 approved needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Nov 16, 2024
Copy link

ti-chi-bot bot commented Nov 16, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-11-16 06:43:11.842919092 +0000 UTC m=+684154.033788085: ☑️ agreed by hawkingrei.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved needs-1-more-lgtm Indicates a PR needs 1 more LGTM. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/planner SIG: Planner 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.

"ERROR 8121 (HY000): privilege check for 'Select' fail" occurs with an UPDATE statement that includes a CTE
2 participants