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: disallow modifying the generated expression of stored or indexed column #10932

Merged
merged 12 commits into from
Jul 3, 2019

Conversation

tangenta
Copy link
Contributor

@tangenta tangenta commented Jun 25, 2019

What problem does this PR solve?

A temporary solution for issue #10924 and issue #10937.

And fix issue #10973.

What is changed and how it works?

Now it forbids three modify or change operations:

  • changing the expression of the generated stored column is not allowed.
  • changing the expression of the generated column with indexes is not allowed.
  • changing a non-generated column to a generated stored column is not allowed.

Check List

Tests

  • Unit test
  • Integration test

Side effects

Related changes

  • Need to update the documentation

@tangenta
Copy link
Contributor Author

/run-all-tests

@codecov
Copy link

codecov bot commented Jun 25, 2019

Codecov Report

Merging #10932 into master will decrease coverage by 0.0092%.
The diff coverage is 100%.

@@               Coverage Diff                @@
##             master     #10932        +/-   ##
================================================
- Coverage   81.1376%   81.1283%   -0.0093%     
================================================
  Files           419        419                
  Lines         89432      89155       -277     
================================================
- Hits          72563      72330       -233     
+ Misses        11627      11577        -50     
- Partials       5242       5248         +6

@codecov
Copy link

codecov bot commented Jun 25, 2019

Codecov Report

Merging #10932 into master will not change coverage.
The diff coverage is n/a.

@@             Coverage Diff             @@
##             master     #10932   +/-   ##
===========================================
  Coverage   81.0483%   81.0483%           
===========================================
  Files           419        419           
  Lines         89533      89533           
===========================================
  Hits          72565      72565           
  Misses        11741      11741           
  Partials       5227       5227

@tangenta
Copy link
Contributor Author

/run-all-tests

ddl/ddl_api.go Outdated Show resolved Hide resolved
ddl/db_test.go Outdated Show resolved Hide resolved
ddl/db_test.go Outdated Show resolved Hide resolved
@tangenta tangenta changed the title ddl: disallow modifying virtual columns with index ddl: disallow modifying generated columns with index Jun 25, 2019
ddl/ddl_api.go Outdated Show resolved Hide resolved
@tangenta
Copy link
Contributor Author

/run-all-tests

ddl/db_test.go Outdated Show resolved Hide resolved
ddl/ddl_api.go Outdated Show resolved Hide resolved
@tangenta tangenta changed the title ddl: disallow modifying generated columns with index ddl: disallow modifying generated columns with stored or index Jun 28, 2019
ddl/generated_column.go Show resolved Hide resolved
ddl/generated_column.go Show resolved Hide resolved
Copy link
Contributor

@winkyao winkyao left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@crazycs520 crazycs520 left a comment

Choose a reason for hiding this comment

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

LGTM

@crazycs520 crazycs520 added the status/LGT2 Indicates that a PR has LGTM 2. label Jul 2, 2019
@crazycs520
Copy link
Contributor

/run-all-tests

@tangenta tangenta changed the title ddl: disallow modifying generated columns with stored or index ddl: disallow modifying the generated expression of stored or indexed column Jul 2, 2019
Copy link
Member

@bb7133 bb7133 left a comment

Choose a reason for hiding this comment

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

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sig/sql-infra SIG: SQL Infra status/LGT2 Indicates that a PR has LGTM 2.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants