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: Do not allow variables in create view #57474

Merged
merged 3 commits into from
Nov 19, 2024

Conversation

mjonss
Copy link
Contributor

@mjonss mjonss commented Nov 18, 2024

What problem does this PR solve?

Issue Number: close #53176

Problem Summary:
No check if there were variables in the CREATE VIEW statement.

What changed and how does it work?

Added a visitor to check for VariableExpr and give an error for such CREATE VIEW

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.

Do not allow Variables or Parameters in CREATE VIEW, just like MySQL.

@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. sig/planner SIG: Planner size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Nov 18, 2024
Copy link

tiprow bot commented Nov 18, 2024

Hi @mjonss. 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.

Copy link

codecov bot commented Nov 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 73.4071%. Comparing base (4f047be) to head (f6363f5).
Report is 21 commits behind head on master.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #57474        +/-   ##
================================================
+ Coverage   72.9015%   73.4071%   +0.5056%     
================================================
  Files          1672       1672                
  Lines        462716     462775        +59     
================================================
+ Hits         337327     339710      +2383     
+ Misses       104590     102337      -2253     
+ Partials      20799      20728        -71     
Flag Coverage Δ
integration 43.3445% <100.0000%> (?)
unit 72.2135% <47.3684%> (-0.0724%) ⬇️

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

Components Coverage Δ
dumpling 52.7673% <ø> (ø)
parser ∅ <ø> (∅)
br 45.1244% <ø> (+0.0337%) ⬆️
---- 🚨 Try these New Features:

@Defined2014
Copy link
Contributor

/retest

@ti-chi-bot ti-chi-bot bot added the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Nov 19, 2024
Copy link

tiprow bot commented Nov 19, 2024

@Defined2014: 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.

@Defined2014 Defined2014 changed the title ddl: Do not allow variables in create view planner: Do not allow variables in create view Nov 19, 2024
Copy link

ti-chi-bot bot commented Nov 19, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Defined2014, 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 lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Nov 19, 2024
Copy link

ti-chi-bot bot commented Nov 19, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-11-19 01:19:49.707906011 +0000 UTC m=+923951.898775008: ☑️ agreed by Defined2014.
  • 2024-11-19 03:22:48.610478901 +0000 UTC m=+931330.801347898: ☑️ agreed by hawkingrei.

@ti-chi-bot ti-chi-bot bot merged commit 153d5aa into pingcap:master Nov 19, 2024
24 checks passed
@ti-chi-bot ti-chi-bot bot added the needs-cherry-pick-release-8.5 Should cherry pick this PR to release-8.5 branch. label Nov 20, 2024
@ti-chi-bot
Copy link
Member

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

@mjonss mjonss deleted the no-variables-in-create-view-53176 branch November 20, 2024 07:50
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-8.5 Should cherry pick this PR to release-8.5 branch. 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.

TiDB allows variables and parameters in VIEWs while MySQL does not
4 participants