创建mysql注释,在mysql中为视图创建注释

I see that the views have a comment field just like the regular tables, but is by default populated with the "VIEW" value.

[TABLE_CATALOG] =>

[TABLE_SCHEMA] => xxx

[TABLE_NAME] => view__xxxx

[TABLE_TYPE] => VIEW

[ENGINE] =>

[VERSION] =>

[ROW_FORMAT] =>

[TABLE_ROWS] =>

[AVG_ROW_LENGTH] =>

[DATA_LENGTH] =>

[MAX_DATA_LENGTH] =>

[INDEX_LENGTH] =>

[DATA_FREE] =>

[AUTO_INCREMENT] =>

[CREATE_TIME] =>

[UPDATE_TIME] =>

[CHECK_TIME] =>

[TABLE_COLLATION] =>

[CHECKSUM] =>

[CREATE_OPTIONS] =>

[TABLE_COMMENT] => VIEW

When I am trying to create a view with a comment I get an error.

CREATE OR REPLACE VIEW view__x AS

SELECT

*

FROM `some_table`

COMMENT = 'some comment'

Is there a way to modify the comment field or that field is used internally for something else and should stay like it is?

I've added a feature request to mysql.

解决方案

According to the create view syntax there is no way currently to add comment a view:

This feature has been requested several times. There are four active tickets related to this functionality:

If you are interested in this issue, go to the four active tickets, click the "affects me" button, and also add a comment, asking if anyone is working on this feature.

This will add visibility, and increase the likelyhood of it being implemented.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值