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

ddl: forbid create Generated column with Grouping function #49930

Merged
merged 1 commit into from
Feb 10, 2024

Conversation

jiyfhust
Copy link
Contributor

@jiyfhust jiyfhust commented Dec 29, 2023

What problem does this PR solve?

Issue Number: close #49909

Problem Summary:

What changed and how does it work?

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

@ti-chi-bot ti-chi-bot bot added release-note-none needs-cherry-pick-release-5.4 Type: Need cherry pick to release-5.4 needs-cherry-pick-release-6.5 needs-cherry-pick-release-7.1 needs-cherry-pick-release-7.5 size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Dec 29, 2023
Copy link

tiprow bot commented Dec 29, 2023

Hi @jiyfhust. 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/test-infra repository.

@jiyfhust
Copy link
Contributor Author

/ok-to-test

Copy link

codecov bot commented Dec 29, 2023

Codecov Report

Merging #49930 (cde3b0e) into master (60dbb61) will increase coverage by 10.7770%.
Report is 401 commits behind head on master.
The diff coverage is 100.0000%.

Additional details and impacted files
@@                Coverage Diff                @@
##             master     #49930         +/-   ##
=================================================
+ Coverage   70.9365%   81.7135%   +10.7770%     
=================================================
  Files          1368       2502       +1134     
  Lines        396016     725055     +329039     
=================================================
+ Hits         280920     592468     +311548     
- Misses        95433     111511      +16078     
- Partials      19663      21076       +1413     
Flag Coverage Δ
integration 52.9846% <100.0000%> (?)
unit 79.9036% <20.0000%> (+8.9671%) ⬆️

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

Components Coverage Δ
dumpling 73.6130% <ø> (+19.6466%) ⬆️
parser ∅ <ø> (∅)
br 68.0277% <ø> (+15.1492%) ⬆️

@jiyfhust
Copy link
Contributor Author

jiyfhust commented Jan 2, 2024

/auto-cc

@@ -289,6 +289,11 @@ type illegalFunctionChecker struct {
func (c *illegalFunctionChecker) Enter(inNode ast.Node) (outNode ast.Node, skipChildren bool) {
switch node := inNode.(type) {
case *ast.FuncCallExpr:
// Grouping function is not allowed, issue #49909.
if node.FnName.L == ast.Grouping {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think it's better to add it to IllegalFunctions4GeneratedColumns ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think it's better to add it to IllegalFunctions4GeneratedColumns ?

illegalFunctionChecker is for that. It parse the expr and set flag, then IllegalFunctions4GeneratedColumns judge it.

@jiyfhust
Copy link
Contributor Author

jiyfhust commented Jan 3, 2024

/cc @mjonss @Defined2014 @tangenta

@jiyfhust
Copy link
Contributor Author

jiyfhust commented Jan 5, 2024

/test pull-integration-ddl-test

Copy link

tiprow bot commented Jan 5, 2024

@jiyfhust: The specified target(s) for /test were not found.
The following commands are available to trigger required jobs:

  • /test tiprow_fast_test

Use /test all to run all jobs.

In response to this:

/test pull-integration-ddl-test

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/test-infra repository.

@jiyfhust
Copy link
Contributor Author

jiyfhust commented Feb 4, 2024

/cc Benjamin2037 tangenta wjhuang2016 ywqzzy zimulala
PTAL, not complex problem.

@ti-chi-bot ti-chi-bot bot added the lgtm label Feb 8, 2024
Copy link

ti-chi-bot bot commented Feb 8, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-01-03 03:58:11.846948894 +0000 UTC m=+2229382.884175821: ☑️ agreed by lcwangchao.
  • 2024-02-08 08:52:18.836709749 +0000 UTC m=+433264.403479624: ☑️ agreed by mjonss.

Copy link

ti-chi-bot bot commented Feb 8, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: lcwangchao, mjonss, 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

@ti-chi-bot ti-chi-bot bot added the approved label Feb 8, 2024
@jiyfhust
Copy link
Contributor Author

/test mysql-test

Copy link

tiprow bot commented Feb 10, 2024

@jiyfhust: The specified target(s) for /test were not found.
The following commands are available to trigger required jobs:

  • /test tidb_parser_test
  • /test tiprow_fast_test

Use /test all to run all jobs.

In response to this:

/test mysql-test

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/test-infra repository.

@ti-chi-bot ti-chi-bot bot merged commit 400bb2c into pingcap:master Feb 10, 2024
22 checks passed
ti-chi-bot pushed a commit to ti-chi-bot/tidb that referenced this pull request Feb 10, 2024
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
@ti-chi-bot
Copy link
Member

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

@ti-chi-bot
Copy link
Member

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

ti-chi-bot pushed a commit to ti-chi-bot/tidb that referenced this pull request Feb 10, 2024
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
ti-chi-bot pushed a commit to ti-chi-bot/tidb that referenced this pull request Feb 10, 2024
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
@ti-chi-bot
Copy link
Member

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

@ti-chi-bot
Copy link
Member

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

ti-chi-bot pushed a commit to ti-chi-bot/tidb that referenced this pull request Feb 10, 2024
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
@jiyfhust jiyfhust deleted the fix_generated_grouping branch February 10, 2024 05:50
ti-chi-bot bot pushed a commit that referenced this pull request May 27, 2024
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 Type: Need cherry pick to release-5.4 needs-cherry-pick-release-6.5 ok-to-test 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.

DDL should report an error when creating a generated column with function "grouping"
5 participants