trafodion-codereview mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zellerh <...@git.apache.org>
Subject [GitHub] trafodion pull request #1646: [TRAFODION-3145] Make "hbase_options" as defau...
Date Mon, 16 Jul 2018 18:29:45 GMT
Github user zellerh commented on a diff in the pull request:

    https://github.com/apache/trafodion/pull/1646#discussion_r202778388
  
    --- Diff: core/sql/sqlcomp/CmpSeabaseDDLcommon.cpp ---
    @@ -10991,7 +10997,20 @@ CmpSeabaseDDL::setupHbaseOptions(ElemDDLHbaseOptions * hbaseOptionsClause,
               hbaseOptionsStr += optionStr;
             }
         }
    +  if (!flushSize.isNull() && !memstoreFlushSizeOptionSpecified)
    +    {
    +      hbaseOption = new(STMTHEAP) HbaseCreateOption("MEMSTORE_FLUSH_SIZE", 
    +                                                    flushSize.data());
    +      hbaseCreateOptions.insert(hbaseOption);
     
    +      if (ActiveSchemaDB()->getDefaults().userDefault
    +          (HBASE_MEMSTORE_FLUSH_SIZE_OPTION) == TRUE)
    +        {
    +          numHbaseOptions += 1;
    +          sprintf(optionStr, "MEMSTORE_FLUSH_SIZE='%s'|", flushSize.data());
    --- End diff --
    
    I would recommend using snprintf instead of sprintf, to avoid the possibility of a buffer
overrun (probably not likely here, but just in case).
    
    ```
    snprintf(optionStr, sizeof(optionStr), ...)
    ```


---

Mime
View raw message