trafodion-codereview mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zellerh <...@git.apache.org>
Subject [GitHub] incubator-trafodion pull request #882: TMUDF fixes and related changes
Date Thu, 22 Dec 2016 17:35:07 GMT
Github user zellerh commented on a diff in the pull request:

    https://github.com/apache/incubator-trafodion/pull/882#discussion_r93665587
  
    --- Diff: core/sql/src/main/java/org/trafodion/sql/udr/TupleInfo.java ---
    @@ -1079,19 +1230,48 @@ else if (t.getByteLength() == 8)
                 row_.putLong(t.getDataOffset(), val);
                 break;
     
    +        case TINYINT_UNSIGNED:
    +            if (val < 0 || val > Byte.MAX_VALUE)
    +                if (val > (2 * Byte.MAX_VALUE + 1))
    +                    throw new UDRException(
    +                        38900,
    +                        "Overflow/underflow when assigning to TINYINT UNSIGNED type");
    +                else
    +                    // use the signed value that has the same bit
    +                    // pattern as the desired unsigned value, since
    +                    // Java doesn't support "unsigned" basic types
    +                    val = val + Byte.MIN_VALUE + Byte.MIN_VALUE;
    --- End diff --
    
    Done.


---
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