trafodion-codereview mailing list archives

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

    https://github.com/apache/incubator-trafodion/pull/1288#discussion_r150693830
  
    --- Diff: core/sql/sqlcomp/CmpSeabaseDDLcommentOn.cpp ---
    @@ -0,0 +1,349 @@
    +/**********************************************************************
    +// @@@ START COPYRIGHT @@@
    +//
    +// Licensed to the Apache Software Foundation (ASF) under one
    +// or more contributor license agreements.  See the NOTICE file
    +// distributed with this work for additional information
    +// regarding copyright ownership.  The ASF licenses this file
    +// to you under the Apache License, Version 2.0 (the
    +// "License"); you may not use this file except in compliance
    +// with the License.  You may obtain a copy of the License at
    +//
    +//   http://www.apache.org/licenses/LICENSE-2.0
    +//
    +// Unless required by applicable law or agreed to in writing,
    +// software distributed under the License is distributed on an
    +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    +// KIND, either express or implied.  See the License for the
    +// specific language governing permissions and limitations
    +// under the License.
    +//
    +// @@@ END COPYRIGHT @@@
    +**********************************************************************/
    +
    +/* -*-C++-*-
    + *****************************************************************************
    + *
    + * File:         CmpSeabaseDDLcommentOn.cpp
    + * Description:  Implements ddl operations for Seabase indexes.
    + *
    + *
    + * Created:     8/17/2017
    + * Language:     C++
    + *
    + *
    + *****************************************************************************
    + */
    +
    +#define   SQLPARSERGLOBALS_FLAGS	// must precede all #include's
    +#define   SQLPARSERGLOBALS_NADEFAULTS
    +
    +#include "ComObjectName.h"
    +
    +#include "CmpDDLCatErrorCodes.h"
    +#include "ElemDDLHbaseOptions.h"
    +
    +#include "SchemaDB.h"
    +#include "CmpSeabaseDDL.h"
    +#include "CmpDescribe.h"
    +
    +#include "ExpHbaseInterface.h"
    +
    +#include "ExExeUtilCli.h"
    +#include "Generator.h"
    +
    +#include "ComCextdecs.h"
    +#include "ComUser.h"
    +
    +#include "NumericType.h"
    +
    +#include "PrivMgrCommands.h"
    +
    +#include "StmtDDLCommentOn.h"
    +
    +#include "PrivMgrComponentPrivileges.h"
    +#include "PrivMgrCommands.h"
    +#include "ComUser.h"
    +
    +
    +short CmpSeabaseDDL::getSeabaseObjectComment(Int64 object_uid, 
    +                                                    enum ComObjectType object_type, 
    +                                                    ComTdbVirtObjCommentInfo & comment_info,
    +                                                    CollHeap * heap)
    +{
    +  Lng32 retcode = 0;
    +  Lng32 cliRC = 0;
    +
    +  char query[4000];
    +
    +  comment_info.objectUid = object_uid;
    +  comment_info.objectComment = NULL;
    +  comment_info.numColumnComment = 0;
    +  comment_info.columnCommentArray = NULL;
    +  comment_info.numIndexComment = 0;
    +  comment_info.indexCommentArray = NULL;
    +
    +  ExeCliInterface cliInterface(STMTHEAP, NULL, NULL, 
    +                               CmpCommon::context()->sqlSession()->getParentQid());
    +
    +  //get object comment
    +  sprintf(query, "select TEXT from %s.\"%s\".%s where TEXT_UID = %ld and TEXT_TYPE =
%d and SUB_ID = %d ; ",
    --- End diff --
    
    Ah, you decided to keep the comment text in the TEXT table. That's a good idea; you don't
need to add columns to OBJECTS or COLUMNS that way, reducing the work for metadata upgrade.


---

Mime
View raw message