Github user zellerh commented on a diff in the pull request:
https://github.com/apache/incubator-trafodion/pull/618#discussion_r72300023
--- Diff: core/sql/optimizer/NATable.cpp ---
@@ -3702,25 +3706,47 @@ NAType* getSQColTypeForHive(const char* hiveType,
NAMemory* heap)
else
continue;
}
+
if(pend - pstart > 0)
{
+ if( (pend - pstart) >= MAX_NUM_LEN ) // too long
+ return NULL;
strncpy(pstr,hiveType+pstart, pend-pstart);
p=atoi(pstr);
}
+
if(send - sstart > 0)
{
+ if( (send - sstart) >= MAX_NUM_LEN ) // too long
+ return NULL;
strncpy(sstr,hiveType+sstart,send-sstart);
s=atoi(sstr);
}
- if( (p>0) && (s>0) )
+ if( (p>0) && (p <= MAX_PRECISION_ALLOWED) ) //have precision between 1
- 18
{
- return new (heap) SQLDecimal( p, s, TRUE, TRUE);
+ if( ( s >=0 ) && ( s<= MAX_SCALE_ALLOWED) ) //have valid scale
--- End diff --
See comment above about valid scale above.
---
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.
---