trafodion-codereview mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From robertamarton <...@git.apache.org>
Subject [GitHub] incubator-trafodion pull request #1288: New COMMENT-ON SQL statement
Date Thu, 02 Nov 2017 20:43:53 GMT
Github user robertamarton commented on a diff in the pull request:

    https://github.com/apache/incubator-trafodion/pull/1288#discussion_r148654170
  
    --- Diff: core/sql/sqlcomp/CmpDescribe.cpp ---
    @@ -3059,6 +3061,36 @@ short CmpDescribeSeabaseTable (
     
           outputLongLine(*space, viewtext, 0);
     
    +      //display comment for VIEW
    +      if (objectUID > 0/* && COMMENT_CQD*/)
    +        {
    +          if (cmpSBD.switchCompiler())
    +            {
    +              *CmpCommon::diags() << DgSqlCode(-CAT_UNABLE_TO_RETRIEVE_PRIVS);
    +              return -1;
    +            }
    +
    +            ComTdbVirtObjCommentInfo * objCommentInfo = NULL;
    +            cmpSBD.getSeabaseObjectComment(objectUID, COM_VIEW_OBJECT, objCommentInfo);
    +
    +          if (objCommentInfo != NULL)
    +            {
    +              //new line
    +              outputLine(*space, "", 0);
    +
    +              //display VIEW COMMENT statements
    +              if (objCommentInfo->objectComment != NULL)
    +              {
    +                sprintf(buf, "COMMENT ON VIEW %s IS '%s' ;",
    +                             tableName.data(),
    +                             objCommentInfo->objectComment);
    +                outputLine(*space, buf, 0);
    --- End diff --
    
    Can you have comments on view columns?


---

Mime
View raw message