trafodion-codereview mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From DaveBirdsall <...@git.apache.org>
Subject [GitHub] trafodion pull request #1502: various fixes, details in pull request
Date Thu, 05 Apr 2018 17:51:51 GMT
Github user DaveBirdsall commented on a diff in the pull request:

    https://github.com/apache/trafodion/pull/1502#discussion_r179541863
  
    --- Diff: core/sql/executor/ExExeUtilGet.cpp ---
    @@ -5795,40 +5833,51 @@ short ExExeUtilHiveMDaccessTcb::work()
                 str_cpy(infoCol->colName, 
                         (hcd ? hcd->name_ : hpd->name_), 256, ' ');
     
    -            infoCol->fsDatatype = 
    -              getFSTypeFromHiveColType(hcd ? hcd->type_ : hpd->type_);
    -
    -	    if (infoCol->fsDatatype < 0)
    +            Lng32 fstype = -1;
    +            Lng32 length = -1;
    +            Lng32 precision = -1;
    +            Lng32 scale = -1;
    +            char sqlType[50];
    +            char displayType[100];
    --- End diff --
    
    I get a little worried when I see hard-coded lengths. Elsewhere for example the displayType
seems to be 96. Seems like if we are not checking buffer lengths at run time we should be
using some enum or const ints for these items or risk buffer overrun problems down the line
when someone else is too casual about these lengths.


---

Mime
View raw message