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

Modifying the column type(needn't to change the data) involved in the generated column is not completely prohibited #24321

Closed
zimulala opened this issue Apr 27, 2021 · 8 comments · Fixed by #43350
Labels
severity/moderate sig/sql-infra SIG: SQL Infra type/bug This issue is a bug.

Comments

@zimulala
Copy link
Contributor

Bug Report

Please answer these questions before submitting your issue. Thanks!

There is currently no support for changing the type of a column involving generating a column. Related to compatibility-issues-with-mysql.

1. Minimal reproduce step (Required)

 create table t2(id int, a int, b int generated always as (abs(a)) virtual);
 alter table t2 modify column a bigint;

2. What did you expect to see? (Required)

Return an error like Unsupported modify column: tidb_enable_change_column_type is true, oldCol is a dependent column 'a' for generated column.

3. What did you see instead (Required)

Query OK, 0 rows affected (2.52 sec)

4. What is your TiDB version? (Required)

Release Version: v4.0.0-beta.2-2732-gd9e2bd3da
Edition: Community
Git Commit Hash: d9e2bd3da49ec3e9a062831fb6e4ab1219a8d158
Git Branch: master
UTC Build Time: 2021-04-27 06:27:55
@zimulala zimulala added type/bug This issue is a bug. sig/sql-infra SIG: SQL Infra labels Apr 27, 2021
@zimulala
Copy link
Contributor Author

Related to #24310.

@zimulala zimulala removed the type/bug This issue is a bug. label Apr 28, 2021
@wjhuang2016
Copy link
Member

I think it's ok to allow it. The document should be refined

@zimulala
Copy link
Contributor Author

zimulala commented May 8, 2021

The reason for the ban here is that there is no energy to carry out the complete test at present. Before the complete test is completed, it can be prohibited by the same treatment as the modification of data(#24310).

@wjhuang2016
Copy link
Member

wjhuang2016 commented May 8, 2021

If generate column is GA, then you can't forbid it. If not, then we don't need to forbid it.

@zimulala
Copy link
Contributor Author

zimulala commented May 8, 2021

But we said we don't support this behavior in https://docs.pingcap.com/tidb/stable/generated-columns#limitations. So I think we need to forbid it.
In addition, if a feature is not fully supported, that is, it is available to users, but the results are uncertain, I think it is better to disable it.

@wjhuang2016
Copy link
Member

But we said we don't support this behavior in https://docs.pingcap.com/tidb/stable/generated-columns#limitations. So I think we need to forbid it.
In addition, if a feature is not fully supported, that is, it is available to users, but the results are uncertain, I think it is better to disable it.

Which statement?

@AilinKid
Copy link
Contributor

/cc @zimulala

@tisonkun
Copy link
Contributor

@wjhuang2016 @zimulala I'm unsure how this issue tracked by at least this line https://github.com/pingcap/tidb/pull/25263/files#diff-0485729b654feaebae798e651571d5fd1091fbedb374ac61518e1536de7f37c4R161 shows that the issue is resolved?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
severity/moderate sig/sql-infra SIG: SQL Infra type/bug This issue is a bug.
5 participants