在 mysql 中为视图创建注释

Create comments for views in mysql(在 mysql 中为视图创建注释)
本文介绍了在 mysql 中为视图创建注释的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我看到视图和常规表一样有一个注释字段,但默认情况下填充了VIEW"值.

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?

我已向 mysql 添加了功能请求.

I've added a feature request to mysql.

推荐答案

根据创建视图的语法,目前无法为视图添加评论:

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

  • http://dev.mysql.com/doc/refman/5.7/en/create-view.html

此功能已被多次请求.有四张与此功能相关的有效工单:

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

  • http://bugs.mysql.com/bug.php?id=5159莉>
  • http://bugs.mysql.com/bug.php?id=64045莉>
  • http://bugs.mysql.com/bug.php?id=52429莉>
  • http://bugs.mysql.com/bug.php?id=15344莉>

...还有几个标记为重复:http://bugs.mysql.com/bug.php?id=19602 , http://bugs.mysql.com/bug.php?id=19602 , http://bugs.mysql.com/bug.php?id=13109, http://bugs.mysql.com/bug.php?id=14369 , http://bugs.mysql.com/bug.php?id=11082, http://bugs.mysql.com/bug.php?id=42870 , http://bugs.mysql.com/bug.php?id=38137, http://bugs.mysql.com/bug.php?id=38137 , http://bugs.mysql.com/bug.php?id=30729

...and several marked as duplicates: http://bugs.mysql.com/bug.php?id=19602 , http://bugs.mysql.com/bug.php?id=19602 , http://bugs.mysql.com/bug.php?id=13109 , http://bugs.mysql.com/bug.php?id=14369 , http://bugs.mysql.com/bug.php?id=11082 , http://bugs.mysql.com/bug.php?id=42870 , http://bugs.mysql.com/bug.php?id=38137 , http://bugs.mysql.com/bug.php?id=38137 , http://bugs.mysql.com/bug.php?id=30729

如果您对此问题感兴趣,请前往四个活动的工单,单击影响我"按钮,并添加评论,询问是否有人正在研究此功能.

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.

这篇关于在 mysql 中为视图创建注释的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

Hibernate reactive No Vert.x context active in aws rds(AWS RDS中的休眠反应性非Vert.x上下文处于活动状态)
Bulk insert with mysql2 and NodeJs throws 500(使用mysql2和NodeJS的大容量插入抛出500)
Flask + PyMySQL giving error no attribute #39;settimeout#39;(FlASK+PyMySQL给出错误,没有属性#39;setTimeout#39;)
auto_increment column for a group of rows?(一组行的AUTO_INCREMENT列?)
Sort by ID DESC(按ID代码排序)
SQL/MySQL: split a quantity value into multiple rows by date(SQL/MySQL:按日期将数量值拆分为多行)