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, tables: support the column type change between the integer types #19059

Merged
merged 27 commits into from
Aug 26, 2020

Conversation

zimulala
Copy link
Contributor

@zimulala zimulala commented Aug 7, 2020

What problem does this PR solve?

Issue Number: close #19118
Support the column type change between the integer types(no rollback operation is supported yet).

Related PR: pingcap/parser#966

What is changed and how it works?

Proposal: #18435

Related changes

  • PR to update pingcap/docs/pingcap/docs-cn:
  • Need to cherry-pick to the release branch

Check List

Tests

  • Unit test

Release note

@zimulala zimulala added sig/sql-infra SIG: SQL Infra feature/accepted This feature request is accepted by product managers component/DDL labels Aug 7, 2020
@zimulala zimulala requested a review from a team as a code owner August 7, 2020 06:44
@zimulala zimulala requested review from wshwsh12 and removed request for a team August 7, 2020 06:44
@codecov
Copy link

codecov bot commented Aug 10, 2020

Codecov Report

Merging #19059 into master will increase coverage by 0.5462%.
The diff coverage is n/a.

@@               Coverage Diff                @@
##             master     #19059        +/-   ##
================================================
+ Coverage   79.0884%   79.6347%   +0.5462%     
================================================
  Files           549        549                
  Lines        149047     152068      +3021     
================================================
+ Hits         117879     121099      +3220     
+ Misses        21659      21514       -145     
+ Partials       9509       9455        -54     

@zimulala zimulala added the require-LGT3 Indicates that the PR requires three LGTM. label Aug 11, 2020
@zimulala
Copy link
Contributor Author

PTAL @AilinKid @bb7133 @tangenta

Copy link
Contributor

@AilinKid AilinKid left a comment

Choose a reason for hiding this comment

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

LGTM

@ti-srebot ti-srebot added the status/LGT1 Indicates that a PR has LGTM 1. label Aug 12, 2020
@zimulala
Copy link
Contributor Author

PTAL @bb7133 @tangenta

@bb7133
Copy link
Member

bb7133 commented Aug 26, 2020

/run-unit-test

@AilinKid
Copy link
Contributor

/run-check_dev_2

@AilinKid
Copy link
Contributor

/run-unit-test

@AilinKid
Copy link
Contributor

AilinKid commented Aug 26, 2020

The CI failure analysis:

1: problem occurs with ctx.(sqlexec.RestrictedSQLExecutor).ExecRestrictedSQL(valStr), the session doesn't set its connectID to keep the database used. Here better change the table name in valStr to test.tt

2: better put modification of the job and tableInfo after the fail point.

failpoint.Inject("mockInsertValueAfterCheckNull", func(val failpoint.Value) {
....
}
updateChangingInfo(job, changingCol, changingIdxs, model.StateDeleteOnly)
job.Args = append(job.Args, changingCol, changingIdxs)

ver, err = updateVersionAndTableInfoWithCheck(t, job, tblInfo, originalState != changingCol.State)

Because once it errors in fail point, it will return without updateVersionAndTableInfoWithCheck. That will also cause the job updated with raw args which has already had the changingCol and ChangingIdxs appended.

@zimulala
Copy link
Contributor Author

2: better put modification of the job and tableInfo after the fail point.

failpoint.Inject("mockInsertValueAfterCheckNull", func(val failpoint.Value) {
....
}
updateChangingInfo(job, changingCol, changingIdxs, model.StateDeleteOnly)
job.Args = append(job.Args, changingCol, changingIdxs)

ver, err = updateVersionAndTableInfoWithCheck(t, job, tblInfo, originalState != changingCol.State)

Because once it errors in fail point, it will return without updateVersionAndTableInfoWithCheck. That will also cause the job updated with raw args which has already had the changingCol and ChangingIdxs appended.

The failpoint is used for the test, so I think we needn't to do it. However, in order to get the test failure information more easily, I set the job state to JobStateCancelled.

@zimulala
Copy link
Contributor Author

PTAL @bb7133 @tangenta

@zimulala
Copy link
Contributor Author

/run-all-tests

@bb7133
Copy link
Member

bb7133 commented Aug 26, 2020

LGTM

@ti-srebot ti-srebot removed the status/LGT2 Indicates that a PR has LGTM 2. label Aug 26, 2020
@ti-srebot ti-srebot added the status/LGT3 The PR has already had 3 LGTM. label Aug 26, 2020
@zimulala zimulala added the status/can-merge Indicates a PR has been approved by a committer. label Aug 26, 2020
@ti-srebot
Copy link
Contributor

/run-all-tests

@ti-srebot
Copy link
Contributor

@zimulala merge failed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/executor component/expression feature/accepted This feature request is accepted by product managers require-LGT3 Indicates that the PR requires three LGTM. sig/execution SIG execution sig/sql-infra SIG: SQL Infra status/can-merge Indicates a PR has been approved by a committer. status/LGT3 The PR has already had 3 LGTM.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a framework for column type transformation(no rollback operation is supported yet)
9 participants