Github user anoopsharma00 commented on a diff in the pull request:
https://github.com/apache/incubator-trafodion/pull/545#discussion_r67392794
--- Diff: core/sql/common/NumericType.h ---
@@ -445,6 +443,99 @@ class SQLBPInt : public NumericType
// ***********************************************************************
//
+// SQLTiny : SQL TINY
+//
+// ***********************************************************************
+class SQLTiny : public NumericType
+{
+public:
+ // ---------------------------------------------------------------------
+ // Constructor functions
+ // ---------------------------------------------------------------------
+ SQLTiny (NABoolean allowNegValues = TRUE,
+ NABoolean allowSQLnull = TRUE,
+ CollHeap * heap =0);
+
+ short getFSDatatype() const
+ {
+ if (isUnsigned())
+ return REC_BIN8_UNSIGNED;
+ else
+ return REC_BIN8_SIGNED;
+ }
+
+ NABoolean roundTripConversionToDouble() const { return TRUE; };
+
+ virtual Lng32 getMagnitude() const { return isUnsigned() ? 28 : 25; }
--- End diff --
Magnitude is the number of digits to the left of decimal point.
NUMERIC(5,2) as magnitude of 3.
It is used during expression set up to correctly determine what an
expression result should be.
Datatypes with binary precision and no scale (int, smallint, etc) do not
have exact
precision. Tinyint has precision of 3 digits (max val
255 for unsigned or 127 for signed).
The getMagnitude method returns an approx magnitude that
is used during expression set up. 28 means magnitude between 2 and 3
(multiplied by 10). Unsigned magnitude is larger value than signed
magnitude.
---
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 [email protected] or file a JIRA ticket
with INFRA.
---