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

[release-1.0]ddl: update the column's offset when we do modify column #6269

Merged
merged 2 commits into from
Apr 12, 2018

Conversation

zimulala
Copy link
Contributor

@zimulala zimulala commented Apr 11, 2018

We should get the latest offset from the store when we do modify the column.

@zimulala zimulala added the DDL label Apr 11, 2018
@zimulala
Copy link
Contributor Author

/run-all-tests

@jackysp
Copy link
Member

jackysp commented Apr 11, 2018

LGTM

@zimulala
Copy link
Contributor Author

/run-all-tests tidb-test=release-1.0 tidb-private-test=release-1.0 tikv=release-1.0

@zimulala zimulala added the status/LGT1 Indicates that a PR has LGTM 1. label Apr 11, 2018
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
Copy link
Contributor

Choose a reason for hiding this comment

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

rename col to newCol

Copy link
Contributor

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,
Copy link
Contributor

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.

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 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
Copy link
Contributor

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.

@winkyao
Copy link
Contributor

winkyao commented Apr 11, 2018

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.
Copy link
Contributor

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?

@zimulala
Copy link
Contributor Author

PTAL @winkyao

@zimulala
Copy link
Contributor Author

/run-common-test tidb-test=pr/495 tidb-private-test=release-1.0 tikv=release-1.0

@zimulala
Copy link
Contributor Author

/run-common-test tidb-test=release-1.0 tidb-private-test=release-1.0 tikv=release-1.0

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.

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.
Copy link
Contributor

@winkyao winkyao Apr 12, 2018

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.

@zimulala
Copy link
Contributor Author

/run-common-test tidb-test=pr/498 tidb-private-test=release-1.0 tikv=release-1.0

@zimulala
Copy link
Contributor Author

/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

@zimulala
Copy link
Contributor Author

/run-integration-common-test tidb-test=pr/498 tidb-private-test=release-1.0 tikv=release-1.0

@zimulala zimulala merged commit 9799093 into pingcap:release-1.0 Apr 12, 2018
@zimulala zimulala deleted the fix-modify-col branch April 16, 2018 08:53
@you06 you06 added the sig/sql-infra SIG: SQL Infra label Mar 4, 2020
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/LGT1 Indicates that a PR has LGTM 1.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants