failed to add column comment by using alter column statement
-
What did you do? If possible, provide a recipe for reproducing the error. as #4224 stated, the table/column comments were lost when I executed the mysql DDL, then I tried the alter column statement: alter table 't_bs_s_data_item' modify column 'ITEM_CD' comment '数据项代码'; and alter table 't_bs_s_data_item' column 'ITEM_CD' comment '数据项代码';
-
What did you expect to see? Query OK
-
What did you see instead? error msg: MySQL [gin]> alter table 't_bs_s_data_item' modify column 'ITEM_CD' comment '数据项代码'; ERROR 1105 (HY000): line 0 column 31 near "modify column 'ITEM_CD' comment '数据项代码'" (total length 80) and MySQL [gin]> alter table 't_bs_s_data_item' column 'ITEM_CD' comment '数据项代码'; ERROR 1105 (HY000): line 0 column 31 near "column 'ITEM_CD' comment '数据项代码'" (total length 73)
-
What version of TiDB are you using (
tidb-server -V)? Git Commit Hash: 365e4ab491b683a69c2004f30b1ae4f86256e2ad Git Commit Branch: master UTC Build Time: 2017-08-16 01:24:27
@tshqin
I tried this statement alter table `t_bs_s_data_item` modify column `ITEM_CD` comment '数据项代码'; in MySQL, it also returns an error ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'comment '数据项代码'' at line 1.
I think this statement needs to add the type like alter table `t_bs_s_data_item` modify column `ITEM_CD` varchar(11) comment '数据项代码';
using your statement, i got an ok msg, thanks!
@tshqin Not at all.