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 #644: Trafodion 1788
Date Mon, 08 Aug 2016 20:38:24 GMT
Github user DaveBirdsall commented on a diff in the pull request:

    https://github.com/apache/incubator-trafodion/pull/644#discussion_r73949536
  
    --- Diff: core/sql/common/ComViewColUsage.h ---
    @@ -0,0 +1,89 @@
    +// @@@ 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 @@@
    +
    +/*
    + *****************************************************************************
    + *
    + * File:         ComViewColUsage.h
    + * Description:  Defines the referenced object (table or view) column 
    + *               relationship to the corresponding view column.
    + *               
    + * Created:      7/15/16
    + * Language:     C++
    + *
    + *****************************************************************************
    + */
    +
    +#ifndef COMVIEWCOLUSAGE_H
    +#define COMVIEWCOLUSAGE_H
    +
    +#include "ComSmallDefs.h"
    +#include "str.h"
    +
    +class ComViewColUsage
    +{
    +  Int64 viewUID_;
    +  Int32 viewColNumber_;
    +  Int64 refdUID_;
    +  Int32 refdColNumber_;
    +  ComObjectType refdObjectType_;
    +
    +public:
    +  virtual ~ComViewColUsage()
    +  {};
    +
    +  Int64 getViewUID () { return viewUID_; }
    +  void setViewUID(Int64 viewUID) { viewUID_ = viewUID; }
    +
    +  Int32 getViewColNumber () { return viewColNumber_; }
    +  void setViewColNumber(Int32 viewColNumber) { viewColNumber_ = viewColNumber; }
    +
    +  Int64 getRefdUID () { return refdUID_; }
    +  void setRefdUID(Int64 refdUID) { refdUID_ = refdUID; }
    +
    +  Int32 getRefdColNumber () { return refdColNumber_; }
    +  void setRefdColNumber(Int32 refdColNumber) { refdColNumber_ = refdColNumber; }
    +
    +  Int32 getRefdObjectType () { return refdObjectType_; }
    +  void setRefdObjectType(ComObjectType refdObjectType) { refdObjectType_ = refdObjectType;
}
    +
    +  void packUsage (NAString &viewColUsageStr)
    +  {
    +      char buf[sizeof(Int64)*2 + sizeof(Int32)*3 + 100];
    +      str_sprintf(buf, "viewUID: %Ld viewCol: %d refUID: %Ld refCol: %d refType: %d;",
    +                  viewUID_, viewColNumber_,
    +                  refdUID_, refdColNumber_, refdObjectType_);
    +      viewColUsageStr = buf;
    +  }
    +
    +  void unpackUsage (const char *viewColUsageStr)
    +  {
    +      Int32 theRefdObjectType;
    +      sscanf(viewColUsageStr, "viewUID: %Ld viewCol: %d refUID: %Ld refCol: %d refType:
%d%*s",
    --- End diff --
    
    I take it we don't care about errors here?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message