You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please answer these questions before submitting your issue. Thanks!
What did you do?
If possible, provide a recipe for reproducing the error.
create table t(id int);
insert into t values(1);
ALTER TABLE t ADD COLUMN a int as (id+1) stored;
select * from t;
What did you expect to see?
mysql> create table t(id int);
Query OK, 0 rows affected (0.03 sec)
mysql> insert into t values(1);
Query OK, 1 row affected (0.00 sec)
mysql> ALTER TABLE t ADD COLUMN a int as (id+1) stored;
Query OK, 1 row affected (0.03 sec)
Records: 1 Duplicates: 0 Warnings: 0
mysql> select * from t;
+------+------+
| id | a |
+------+------+
| 1 | 2 |
+------+------+
1 row in set (0.01 sec)
What did you see instead?
tidb> create table t(id int);
Query OK, 0 rows affected (0.00 sec)
tidb> insert into t values(1);
Query OK, 1 row affected (0.00 sec)
tidb> ALTER TABLE t ADD COLUMN a int as (id+1) stored;
Query OK, 0 rows affected (0.02 sec)
tidb> select * from t;
+------+------+
| id | a |
+------+------+
| 1 | NULL |
+------+------+
1 row in set (0.00 sec)
What version of TiDB are you using (tidb-server -V or run select tidb_version(); on TiDB)?
Release Version: v3.0.0-beta-69-g84d1513b0
Git Commit Hash: 84d1513
Git Branch: master
The text was updated successfully, but these errors were encountered:
You cannot add the generated column in the storage type of STORED through ALTER TABLE.
You cannot create an index on the generated column through ALTER TABLE.
Bug Report
Please answer these questions before submitting your issue. Thanks!
If possible, provide a recipe for reproducing the error.
tidb-server -V
or runselect tidb_version();
on TiDB)?Release Version: v3.0.0-beta-69-g84d1513b0
Git Commit Hash: 84d1513
Git Branch: master
The text was updated successfully, but these errors were encountered: