-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
[release-1.0]ddl: update the column's offset when we do modify column #6269
Conversation
/run-all-tests |
LGTM |
/run-all-tests tidb-test=release-1.0 tidb-private-test=release-1.0 tikv=release-1.0 |
ddl/column.go
Outdated
@@ -450,6 +450,8 @@ func (d *ddl) doModifyColumn(t *meta.Meta, job *model.Job, col *model.ColumnInfo | |||
return ver, infoschema.ErrColumnNotExists.GenByArgs(oldName, tblInfo.Name) | |||
} | |||
|
|||
col.Offset = oldCol.Offset |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rename col to newCol
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add some comments why we set offset here.
ddl/ddl_api.go
Outdated
ID: col.ID, | ||
Offset: col.Offset, | ||
State: col.State, | ||
ID: col.ID, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add some comments why we not set offset here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think to add the comment to line454 in column.go
is enough.
ddl/column.go
Outdated
@@ -450,6 +450,8 @@ func (d *ddl) doModifyColumn(t *meta.Meta, job *model.Job, col *model.ColumnInfo | |||
return ver, infoschema.ErrColumnNotExists.GenByArgs(oldName, tblInfo.Name) | |||
} | |||
|
|||
col.Offset = oldCol.Offset |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add some comments why we set offset here.
Plz fix ci |
ddl/column.go
Outdated
@@ -450,6 +450,9 @@ func (d *ddl) doModifyColumn(t *meta.Meta, job *model.Job, col *model.ColumnInfo | |||
return ver, infoschema.ErrColumnNotExists.GenByArgs(oldName, tblInfo.Name) | |||
} | |||
|
|||
// We need the latest column's offset and state. This information can be obtained from. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can be obtained from? from what?
b77ac61
to
4ad6535
Compare
PTAL @winkyao |
/run-common-test tidb-test=pr/495 tidb-private-test=release-1.0 tikv=release-1.0 |
/run-common-test tidb-test=release-1.0 tidb-private-test=release-1.0 tikv=release-1.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reset LGTM
@@ -450,6 +450,9 @@ func (d *ddl) doModifyColumn(t *meta.Meta, job *model.Job, col *model.ColumnInfo | |||
return ver, infoschema.ErrColumnNotExists.GenByArgs(oldName, tblInfo.Name) | |||
} | |||
|
|||
// We need the latest column's offset and state. This information can be obtained from the store. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can't set the offset in ddl.ModifyColumn, because the offset may be changed when we execute the ddl.doModifyColumn.
/run-common-test tidb-test=pr/498 tidb-private-test=release-1.0 tikv=release-1.0 |
/run-common-test tidb-test=pr/498 tidb-private-test=release-1.0 tikv=release-1.0 |
/run-integration-common-test tidb-test=pr/498 tidb-private-test=release-1.0 tikv=release-1.0 |
We should get the latest offset from the store when we do modify the column.