drill-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vvysotskyi <...@git.apache.org>
Subject [GitHub] drill pull request #570: DRILL-4834 decimal implementation is vulnerable to ...
Date Tue, 09 Jan 2018 18:52:03 GMT
Github user vvysotskyi commented on a diff in the pull request:

    https://github.com/apache/drill/pull/570#discussion_r160489866
  
    --- Diff: exec/vector/src/main/codegen/templates/ComplexWriters.java ---
    @@ -99,7 +99,7 @@ public void write(Nullable${minor.class?cap_first}Holder h) {
     
       <#if !(minor.class == "Decimal9" || minor.class == "Decimal18" || minor.class ==
"Decimal28Sparse" || minor.class == "Decimal38Sparse" || minor.class == "Decimal28Dense" ||
minor.class == "Decimal38Dense")>
       public void write${minor.class}(<#list fields as field>${field.type} ${field.name}<#if
field_has_next>, </#if></#list>) {
    -    mutator.addSafe(idx(), <#list fields as field>${field.name}<#if field_has_next>,
</#if></#list>);
    +    mutator.addSafe(idx(), <#list fields as field><#if field.name == "scale"><#break></#if>${field.name}<#if
field_has_next && fields[field_index+1].name != "scale" >, </#if></#list>);
    --- End diff --
    
    I think it would be better to replace these checks by a check for `minor.class`


---

Mime
View raw message