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

session: set sql security of tidb_mdl_view to 'invoker' #53265

Merged
merged 1 commit into from
May 16, 2024

Conversation

tangenta
Copy link
Contributor

@tangenta tangenta commented May 14, 2024

What problem does this PR solve?

Issue Number: close #53292

Problem Summary:

See #53292 (comment)

What changed and how does it work?

  • Change view's sql security from definer to invoker. Make users querying tidb_mdl_view responsible for passing permission checks.

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: tangenta <tangenta@126.com>
@ti-chi-bot ti-chi-bot bot added do-not-merge/needs-linked-issue do-not-merge/needs-tests-checked release-note-none size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels May 14, 2024
Copy link

tiprow bot commented May 14, 2024

Hi @tangenta. 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-sigs/prow repository.

@tangenta
Copy link
Contributor Author

/hold need to add upgrade operation

@ti-chi-bot ti-chi-bot bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label May 14, 2024
Copy link

codecov bot commented May 14, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 75.3614%. Comparing base (39383e3) to head (ec44422).
Report is 21 commits behind head on master.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #53265        +/-   ##
================================================
+ Coverage   72.4371%   75.3614%   +2.9243%     
================================================
  Files          1493       1499         +6     
  Lines        429389     437189      +7800     
================================================
+ Hits         311037     329472     +18435     
+ Misses        99064      87786     -11278     
- Partials      19288      19931       +643     
Flag Coverage Δ
integration 50.2513% <ø> (?)
unit 72.5476% <ø> (+1.2230%) ⬆️

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

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

@tangenta
Copy link
Contributor Author

/unhold

@ti-chi-bot ti-chi-bot bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label May 15, 2024
@tangenta tangenta changed the title session: set sql security of tidb_mdl_view to 'invoker' session: set sql security of tidb_mdl_view to 'invoker' May 15, 2024
@easonn7
Copy link

easonn7 commented May 16, 2024

/approve

Copy link

ti-chi-bot bot commented May 16, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: easonn7, lcwangchao, wjhuang2016

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 May 16, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-05-16 02:58:41.221737716 +0000 UTC m=+1708474.978873288: ☑️ agreed by wjhuang2016.
  • 2024-05-16 06:05:47.03021264 +0000 UTC m=+1719700.787348212: ☑️ agreed by lcwangchao.

@tangenta
Copy link
Contributor Author

/retest

Copy link

tiprow bot commented May 16, 2024

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

In response to this:

/retest

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.

@ti-chi-bot ti-chi-bot bot merged commit 125829c into pingcap:master May 16, 2024
23 checks passed
terry1purcell pushed a commit to terry1purcell/tidb that referenced this pull request May 17, 2024
RidRisR pushed a commit to RidRisR/tidb that referenced this pull request May 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm release-note-none size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Root user lack rights to use tidb_mdl_view
4 participants