Details
-
New Feature
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
-
22.08.2
-
None
Description
Currently, TreeNode::getDecimalVal() throws an error if called for a char type. We can implement a conversion function and throw ERR_FUNC_OUT_OF_RANGE_RESULT if it won't fit into a 128 bit decimal.
Part of this feature is to find all the places where conversion is from char to double when conversion to 128 bit decimal would be more accurate. That is, find where TreeNode::getDoubleVal() is called for CHAR types and replace with TreeNode::getDecimalVal() where appropriate.
Also look for other possible conversion from string that would be better server with decimal.
This feature adds 128 bit precision where currently, only double precision is used. Care must be taken to possibly keep the double if the char value won't fit into a decimal 128.
In SQL, it's inadvisable to use char types to hold numeric values that might actually be used as numeric, such as for calculations or as parameters to functions that act on numbers. Such conversions only serve to slow down processing and may result in loss of accuracy.
Attachments
Issue Links
- relates to
-
MCOL-5248 Truncate on char and varchar columns with numeric digits returned incorrect results
- Closed