Open aytrack opened 1 year ago
Introduced by #43350
So this is the side effect after fixing https://github.com/pingcap/tidb/issues/24321 In other words, the expected behaviour here conflict with the expected behaviour in #24321
Depending on the correctness definition, we have 3 options:
So this is the side effect after fixing #24321 In other words, the expected behaviour here conflict with the expected behaviour in #24321
Depending on the correctness definition, we have 3 options:
- Prohibite modifying the column type(needn't to change the data) involved in the generated column (close #24321, leave this one open)
- Allow modifying the column type(needn't to change the data) involved in the generated column (reopen #24321, close this one) ... and update document for the limitations.
- Support modify column type involving data change on generated column, fully mysql compatible but takes much more work.
Let's choose 1 because the data reorg for generated columns is not implemented yet(a missing piece of data reorg).
We don't even support changing the collation for a column with index covered:
tidb> create table t(a varchar(20) collate utf8mb4_bin, key idx(a));
Query OK, 0 rows affected (0.01 sec)
tidb> alter table t modify column a char character set utf8mb4 collate utf8mb4_unicode_ci;
ERROR 8200 (HY000): Unsupported modifying collation of column 'a' from 'utf8mb4_bin' to 'utf8mb4_general_ci' when index is defined on it.
When will this issue be fixed?
Same issue in hive metastore:
ALTER TABLE `NOTIFICATION_SEQUENCE` MODIFY COLUMN `NNI_ID` BIGINT(20) GENERATED ALWAYS AS (1) STORED NOT NULL;
TiDB Version: v7.1.2
Source code:
Bug Report
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
2. What did you expect to see? (Required)
3. What did you see instead (Required)
4. What is your TiDB version? (Required)