From codereview-return-7278-apmail-trafodion-codereview-archive=trafodion.apache.org@trafodion.apache.org Mon Jul 16 18:29:46 2018 Return-Path: X-Original-To: apmail-trafodion-codereview-archive@minotaur.apache.org Delivered-To: apmail-trafodion-codereview-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 0F23118129 for ; Mon, 16 Jul 2018 18:29:46 +0000 (UTC) Received: (qmail 16592 invoked by uid 500); 16 Jul 2018 18:29:46 -0000 Delivered-To: apmail-trafodion-codereview-archive@trafodion.apache.org Received: (qmail 16557 invoked by uid 500); 16 Jul 2018 18:29:46 -0000 Mailing-List: contact codereview-help@trafodion.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: codereview@trafodion.apache.org Delivered-To: mailing list codereview@trafodion.apache.org Received: (qmail 16546 invoked by uid 99); 16 Jul 2018 18:29:45 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 16 Jul 2018 18:29:45 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 3F208DFE60; Mon, 16 Jul 2018 18:29:45 +0000 (UTC) From: zellerh To: codereview@trafodion.apache.org Reply-To: codereview@trafodion.apache.org References: In-Reply-To: Subject: [GitHub] trafodion pull request #1646: [TRAFODION-3145] Make "hbase_options" as defau... Content-Type: text/plain Message-Id: <20180716182945.3F208DFE60@git1-us-west.apache.org> Date: Mon, 16 Jul 2018 18:29:45 +0000 (UTC) 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), ...) ``` ---